• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

30 Day Average Volume

decoder

New member
Hi everybody, is there a study that shows the average volume over 30 days excluding todays bar? thanks!
 

korygill

Active member
VIP
Works for me.

g0WG7ia.png
 

decoder

New member
I don't want to include the last candle in the calculation -- plot avervol = average(volume[1],2); --
the last two candles with out todays candle is only about 1.5 mil average this is showing about 17mil.


NRWjT3Z.png
 

korygill

Active member
VIP
It appears you are looking 1 value past your last bar.

Try this:
Code:
plot avervol = average(volume[1],2);
avervol.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);

t0Cgo5s.png
 

korygill

Active member
VIP
Also try this:

Code:
plot avervol = if !IsNaN(close) then average(volume[1],2) else double.nan;
avervol.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
 

Similar threads

Top