This script allows to calculate the cumulative volume during the intraday session. Let's just define the start and the end time of the day you want the cumulated volume to be calculated within and you'll be good to go! You can also define two thresholds (min and max) where to plot it on a different color. For my strategy, I find it very useful for calculating the pre-market volume since I need to see enough (but not too much) interest on a stock for trusting it after the bell rings. I place it in the same panel where I display the actual volume, so that no extra space on my layout needs to be allocated to this one indicator. I hope you'll be finding it useful too!
for i=0 to barsSince
if i >= 1
volsum := volsum + volume[i-1]
if volsum < minVol
col := red
if volsum >= minVol and volsum < maxVol
col := green
if volsum >= maxVol
col := orange
plot(volsum, color=col, linewidth=2)
Prize_Fighter
⋅
Hi FT,
Thanks for this. When I compare the end of day cumulative volume to the in-built daily volume they are different. I feel like they should be the same. Can you tell me if you've found this also? Thanks.
freedom_trader_
⋅
@Prize_Fighter, Strange. Are you sure you're not including the extended session volume? The daily chart wuld exclude that.
inet100
⋅
Hi, can you write a script to get previous days intraday volume sum and average intraday volume sum of n days? I'm ready to pay for it.
I pasted your code from the comments and getting the following error.
Add to Chart operation failed, reason: line 17: Syntax error at input 'to'.
for i=0 to barsSince
if i >= 1
volsum := volsum + volume
Thank you