I'm seeing unexpected behavior in an indicator that is running OnBarClose that is hosted from a strategy that is running OnEachTick. When running in Historical state the bar sequence is as expected, but when running in Realtime state I'm seeing a pattern of repeating timestamps and bar indices. Here are snippets of outputs from the indicator:
Historical:
------------------------------
1217 9/9/2020 6:27:06 PM
Historical
Volume 876
------------------------------
1218 9/9/2020 7:18:26 PM
Historical
Volume 1610
------------------------------
1219 9/9/2020 7:44:00 PM
Historical
Volume 665
Realtime:
------------------------------
1217 9/9/2020 6:27:06 PM
Realtime
Volume 876
------------------------------
1218 9/9/2020 6:27:06 PM
Realtime
Volume 1
------------------------------
1218 9/9/2020 7:18:26 PM
Realtime
Volume 1610
------------------------------
1219 9/9/2020 7:18:26 PM
Realtime
Volume 1
------------------------------
1219 9/9/2020 7:44:00 PM
Realtime
Volume 665
------------------------------
1220 9/9/2020 7:44:00 PM
Realtime
Volume 1
There is an additional instance of the timestamp but with the index incremented and with the volume = 1 (not shown here, but with Open[] == Close[] too).
Details that might be relevant:
- the strategy has an additional data series added in State.Configure: AddDataSeries(Data.BarsPeriodType.Tick, 1);
- the strategy calls this indicator only when (BarsInProgress == 0) && (IsFirstTickOfBar == true)
- the indicator sets Calculate = OnBarClose on State.SetDefaults and State.Historical
- the indicator only runs this code segment when (BarsInProgress == 0) && (IsFirstTickOfBar == true) although it doesn't have an additional data series added
- the strategy needs to necessarily run OnEachTick for another hosted indicator. It needs the 1 tick data series for this second indicator
- the bar type is a renko from a particular vendor. I believe it runs in TickReplay mode by default but I'm not sure. The TickReplay check box is grayed out in the Data Series dialog box
- The pattern occurs regardless of whether I access one barsAgo when IsFirstTickOfBar or zero barsAgo. It just offset by one from this repeating sequence
The pattern illustrated occurs for ES and CL. I'm able to work around this but I just discovered that there is a different pattern for YM. Rather than find ways to workaround all this I'd like to get to the bottom of why it's happening and the best way to deal with it. I could get rid of the tick indicator as a last resort and run the strategy OnBarClode but I'd rather not.
Thanks.
Comment