What I'm after is how to get an "OnBarClose" in a live OnEachTick call to OnBarUpdate.
The reason for this is that I have to have separate logic to determine at what point we are looking at price (or any) data series.
For example if I run Calculate.OnEachTick and I want to look for a simple thing such as the last candle closed UP I would have to do something like this:
if(IsFirstTickOfBar && Close[1] > Open[1])
Print("Up Candle");
if(IsFirstTickOfBar && Close[1] > Open[1])
EnterLong(...);
...in State.Configure
IsBackTest = Account.Name == Account.BackTestAccountName;
if(IsBackTest)
Calculate = Calculate.OnBarClose();
...in OnBarUpdate
if(IsBackTest && Close[0] > Open[0])
EnterLong(...);
else if(IsFirstTickOfBar && !IsBackTest && Close[1] > Open[1])
EnterLong(...);

Comment