Is there any way to compare time of last bar of 2 stocks in pair trading?
Author: akuzn
Creation Date: 7/26/2012 1:40 PM
profile picture

akuzn

#1
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.
profile picture

Eugene

#2
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?
profile picture

akuzn

#3
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.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).