Primary series is Futures daily.
State.SetDefaults >
Calculate = Calculate.OnEachTick;
State.Configure >
AddDataSeries(null, new BarsPeriod { BarsPeriodType = BarsPeriodType.Second, Value = 86400 });
AddDataSeries(null, Data.BarsPeriodType.Second, 1);
OnBarUpdate >
if (BarsInProgress == 1 && IsFirstTickOfBar)
Output:
30-Jan-20 17:00:00 | 30-Jan-20 17:00:00 | State=Historical
31-Jan-20 17:00:00 | 31-Jan-20 17:00:00 | State=Historical
03-Feb-20 17:00:00 | 03-Feb-20 17:00:00 | State=Historical
04-Feb-20 17:00:00 | 03-Feb-20 23:59:57 | State=Historical
Enabling NinjaScript strategy 'Test Series/192771176' : On starting a real-time strategy ...
05-Feb-20 17:00:00 | 04-Feb-20 18:00:01 | State=Realtime
06-Feb-20 17:00:00 | 05-Feb-20 18:00:01 | State=Realtime
07-Feb-20 17:00:00 | 06-Feb-20 18:00:01 | State=Realtime
The call in bold should take place AFTER "Enabling NinjaScript strategy" with State=Realtime. The reason it is there in the first place is because Calculate is set to OnEachTick. When the state is not yet Realtime, how can OnEachTick be already in effect.
I have separate implementations for historical and realtime - said call is wrongly routed in my code to the historical segment because it comes in too early, and then it is absent from the first session in realtime because of that, making double the mess.
Should I expect the same behavior on live run or is this only happening in Playback?
Thank you.
Comment