I am trying to run a back test with multiple series added and I've discovered that the CurrentBars count is not in sync even when the time interval is the same for all instruments. The indicator code below is applied to the instrument EURUSD 60min chart. I've included the output which shows that the current bar is dramatically out of sync even though all bars have a uniform period. How can I go about synchronizing the CurrentBar such that I can accurately back test?
if (State == State.Configure)
{
// EURUSD 60 minute chart is BarsInProgress 0
AddDataSeries("AUDUSD", Data.BarsPeriodType.Minute, 60, Data.MarketDataType.Last); // BarsInProgress 1
AddDataSeries("USDCAD", Data.BarsPeriodType.Minute, 60, Data.MarketDataType.Last); // BarsInProgress 2
}
protected override void OnBarUpdate()
{
var print = $"BIP: {BarsInProgress}, Current Bar: {CurrentBar}";
Print(print);
}
[...]
BIP: 0, Current Bar: 1135
BIP: 1, Current Bar: 660
BIP: 2, Current Bar: 817
BIP: 0, Current Bar: 1136
BIP: 1, Current Bar: 661
BIP: 2, Current Bar: 818
[...]
Desired Console Output:
[...]
BIP: 0, Current Bar: 1135
BIP: 1, Current Bar: 1135
BIP: 2, Current Bar: 1135
BIP: 0, Current Bar: 1136
BIP: 1, Current Bar: 1136
BIP: 2, Current Bar: 1136
[...]

Comment