When I tried to develop a multiple instrument strategy. I noticed the following problem.
The strategy involves two instruments, one for trading and the other for reference only. Lets refer them as "Pri" and "Ref".
Here are the settings:
CalculateOnBarClose=true;
Bar period is set to 1-minute;
Then comes my confusion:
Suppose Time[0] is now 11:00 AM. In function OnBarUpdate, if BarsInProgress==0 then this event is driven by "Pri". But at this moment, all the data series for "Ref" are still at 10:59 AM. I.e., Closes[0][0] is the close price of Pri at 11:00 however Closes[1][0] is the close price of Ref at 10:59!
How could I access the synchronized data series of Ref correctly?
I'd appreciate any ideas or suggestions. Thx.
Comment