Thanks Tomasz,
that worked with a bit of jigging. Subtracting the volume from the
start of the day leaves you with no volume on that bar so have to
subtract from end of yesterday.
Is there a better way to get last bar of day without forward looking?

d = Day();
newDay = d != Ref(d, -1);
eod = Ref(newDay, 1);       // Last bar of day
CumVolume = Cum(V);
Vw = Ref(ValueWhen(eod, CumVolume), -1);  // Subtract volume from eod
Vw = Nz(Vw, 0);  // Zeros for first day
intradayCumVolume = CumVolume - Vw;


--- In [email protected], "Tomasz Janeczko" <gro...@...> wrote:
>
> Did you switch periodicity to "Intraday"?
> 
> Plus, don't add that "1". should be
> Sum( V, BarsSince( newDay ) )
> 
> or better yet,
> 
> cv = Cum( Volume );
> 
> intradaycumvolume = cv - ValueWhen( newDay, cv );
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com

Reply via email to