I'm attempting to better understand the ordering of events inside OnBarUpdate. I understand this is all event driven and triggered by each incoming tick. A few questions:
Assuming a chart with SPY 1min (Primary), and then I Add(QQQ, 1min) Secondary, both very active issues.
1) If COBC=true, will SPY (BarsInProgress == 0) ALWAYS be the first of the two series to call the OnBarUpdate routine when a new bar is closed/finalized? Or will it be random depending on which of the two series delivers the "closing" tick first?
2) Again with COBC=true...
if (BarsInProgress == 0) {
myCalc = Closes[0][0] + Closes[1][0];
}
...will the timestamp associated with the Secondary series (Closes[1][0]), be the same as the Primary at this point in time (inside BarsInProgress == 0), or do I have to wait until the next tick even where BarsInProgress == 1 before the timestamp will be updated?
In other words, suppose it's the finalizing of the 9:50am SPY 1min bar that triggers the OnBarUpdate. Closes[0][0] will be the closing price of SPY at 9:50am. Will Closes[1][0] be the closing price for 9:50am also, or will it still be the 9:49am price and I will not have access to 9:50 until the Secondary makes a call to OnBarUpdate?
3) Now with COBC=false...
if (BarsInProgress == 0) {
myCalc = Closes[0][0] + Closes[1][0];
}
...same question, will Closes[1][0] have access to the most recent tick of the Secondary while being called inside (BarsInProgress == 0), or does the most recent Secondary series tick "not exist" until it makes it's way through the OnBarUpdate routine?
Comment