first, please confirm that CurrentBarArray[] is exactly the same (an alias of) as CurrentBars[]. I found the former in an imported indicator (PairsCorrelation) from this forum, but afaik it is not documented.
Now the more serious thing:
I found in some cases that calls to the OnBarUpdate() event appear to happen in whatever order (i.e. historical bars belonging to different instruments but closing at the same time, are not passed on to the OnBarUpdate() event at the same time).
protected override void OnBarUpdate()
{
Print("CurrentBars[0] = " + CurrentBars[0]);
Print("CurrentBars[1] = " + CurrentBars[1]);
.....
}
CurrentBars[0]=0
CurrentBars[1]=-1
CurrentBars[0]=1
CurrentBars[1]=-1
CurrentBars[0]=2
CurrentBars[1]=-1
CurrentBars[0]=3
CurrentBars[1]=-1
CurrentBars[0]=4
CurrentBars[1]=-1
...
...
CurrentBars[0]=X
CurrentBars[1]=0
CurrentBars[0]=X
CurrentBars[1]=1
CurrentBars[0]=X
CurrentBars[1]=2
CurrentBars[0]=X
CurrentBars[1]=3
CurrentBars[0]=X
CurrentBars[1]=4
...
...
Before you ask, yes, both instruments overlap in time (but not all the time).
So, the questions are,
(1) first to confirm wether this is a bug or expected behaviour.
(2) Then, how can I force an indicator (or strategy) to make calculations with bars of all instruments closing at the same time. It should be easy to check bar closing times, and checking that closing times match across instruments, but I need to have the bar values of same-time-bars simultaneously available.
(3) I assume that in some of the instruments I can have gaps without bar data. How can I check for these?
Thank you very much.

Comment