I have a strategy that is applied to a 100-tick bar chart. This strategy adds a 1 tick bar series with Add(PeriodType.Tick, 1), then prints out the close price each time OnBarUpdate() is called.
When I run a backtest, in strategy analyzer, on this strat (just 2 days of data) I do not get the results that I expect. It seems that OnBarUpdate is not called until several ticks AFTER the first 100-tick bar (primary) has closed, even though the 1-tick series bars (secondary) have closed 99 times prior to the close of the first 100-tick bar.
I would expect to see 99 ticks print (secondary series), then, the 100th tick is the close of the primary bar, so that should print (since the primary series has priority), then the 100th tick (secondary) should print. At this point, the primary bar close price should be the same as the 100th tick (secondary) close price.
I have attached my code.
I have the backtester's dataseries type set to tick and value set to 100.
Can someone explain why this code is executing differently that I expect it to?
TIA,
-billy
Comment