Synchronization of Bars object of second security after SetContext gives only filled fields of series based on last available value ( it may be filled even by previous day price ). Pair testing and real time trading based on such DataSeries unpredictable results.
Is there any way to compare time of last bars of series? Unfortunately description of Bars object in quick ref doesnt give any answer.
Size:
Color:
Let's see what answer can the QuickRef description of
SetContext give:
QUOTE:
The synchronize parameter specifies whether the data for the new symbol will be automatically date-synchronized with the primary symbol (the one that the Strategy was originally executed on, and charted.)
How about deferring synchronization to get the actual last DateTime?
Size:
Color:
I was not sure about final result.
But i think now it s enough to compare Bars.Date[bar] of 2 stocks in trading cycle.
Seems that s enough for real time trading to avoid some trades with not real prices.
But DataSeries calculated on not fair values may not be correct.
This is life). It s not already wealthlab questionn.
Size:
Color: