'TradingView pinescript volume accumulation by time

I want to calculate the volume within a specific time range.

For example:

I want to get the volume from time 4:00am - 9:30am. How can I code that?

I know input(10) would give me back the last 10 points. I know volume[point] would give me the volume at that point.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source