private int i = 0;
Then in update I have as follows:
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[1] < 2)
return;
if (Bars.IsFirstBarOfSession == true) // reset indicator at start of session
i = 0;
This is what I want, reset i to zero at start of session.
What's odd, is that this works just fine in playback but with a live data feed it sets to -1. During the day therefore it rests at -1 instead of zero.
Thoughts?

...
Comment