[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Daily Accumulator



PureBytes Links

Trading Reference Links

I assume you are only plotting the day session. If so, then a
simple reset for anything is to use a change in date which does
the reset on the first bar of the next day.

if date<>date[1] then myvar=resetval;

"Southwest Transaction Group, Inc." wrote:

> Lets say I was using 5 minute bars, and wanted to add the High-Low for each
> bar, to the previous bar, BUT reset at day's end.
>
> Vars:
>
> BarSpread(0), Accum(0);
>
> BarSpread = H-L;
>
> Accum = BarSpread + Accum[1];
>
> Plot1(Accum,"");
>
> The above accumulates, but does not reset.
>
> Thanks for the help.