I'm trying to write a NT7 indicator that uses Gomi non-cumulative delta for multiple time frames. I'm getting a discrepancy in the results of the second time frame when it's added as a second bar series than when it's standalone as the primary time frame. e.g. in single time frame case, the data is ES 10-tick range bar, and in the multi-time frame the primary bar is ES 5-tick range bar and the second is ES 10-tick range bar. The discrepancy appears to be when the FirstTickOfBar event is issued. Here are some details from logging to illustrate:
Single bar case
- First GomOnBarUpdate::FirstTickOfBar before any GomOnMarketData
- Second GomOnBarUpdate::FirstTickOfBar at 8/2/2017 3:26:18AM : cumulative delta -1393 after 27843 iterations of GomOnMarketData
Multi bar case:
- First GomOnBarUpdate::FirstTickOfBar for BarsInProgress=1 after 11 BarsInProgress=0
- Timestamp is the same, 8/2/2017 3:26:18AM.
- Cumulative delta is -1649 after 27481 iterations of GomOnMarketData. This is the same value as the single bar case at its iteration 27481, but it didn't trigger the update until after iteration 27843, by which the delta had become -1393.
The delta is reset during FirstTickOfBar, so the -1649 would be considered the close of the previous bar. As a sanity test, by iteration 27843 of the multi-bar case, the delta was 256. So had it not reset, the delta at that point would have been -1649 + 256 = -1393. So the data accumulation is not the issue. It's the syncing of when the FirstTickOfBar are arriving. For the single bar case it's after 27843 iterations of onMarketData, for the multi-bar case it's after 27481 iterations, and yet both have the same timestamps.
This behavior is the same regardless of the CalculateOnBarClose setting.
Is there any way to force the FirstTickOfBar for the second bar series to behave the same as the standalone single bar case?
Alternatively, is there a way to access indicator data from another chart?
Thanks.
Comment