TradingView
freedom_trader_
8 jun 2019 10:04

Intraday Cumulative Volume 

Apple Inc.NASDAQ

Beskrivning

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!

Versionsinformation

Fixed the max bars back issue
Kommentarer
vwgm
Hi,

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
twingall
Thanks FT, great indicator.

Using the code below, why do the plotted points not progress upward only?
twingall
@twingall, if you could share the updated code it'd make my day, been puzzling over this for too long!
flamingstudios
@twingall, same problem here
flamingstudios
@twingall, Managed to fix the code provided in the comments by the Author. If you need the fix get in touch with me.
robbiecee2
Please could I get access to the code?
freedom_trader_
@robbiecee2, here you go
//@version=3
study("Intraday Cumulative Volume", overlay=true, precision=2)

minVol = input(title="Low Volume Threshold", defval=50000)
maxVol = input(title="High Volume Threshold", defval=1500000)
inputSession = input(title="Time Start - End", type=session, defval="0400-0930", confirm=true)
volsum = 0.0
barInSession(sess) => time(period, sess) != 0
barsSince = barssince(not(barInSession(inputSession)))

col = na

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.
Mer