Hi Guys,

I am new to quantconnect and, while doing some tests, I've found a intriguing "issue" that you may help me to find out the reason. In the documentation it says 

"The close of a bar is not known until the start of the next bar, which can sometimes be confusing. For example, a price bar for Friday will include all the ticks from Friday 00:00 to Friday 23:59.99999, but it will actually be emitted to your algorithm on Saturday at midnight. Because of this, any orders you create after analyzing the Friday data will be sent to your brokerage on Saturday, when most markets are closed."

To test it I loaded an equity in the research notebook and logged the same equity during a dummy backtest.

These are OHLC values for EWA from the notebook: 

qb = QuantBook()
spy = qb.AddEquity("EWA")
qb.History(qb.Securities.Keys, datetime(2007,1,1), datetime(2007,1,5), Resolution.Daily)

symboltimeclosehighlowopenvolumeEWA R735QTJ8XC9X2007-01-0412.43156312.63224312.38931512.5583081000300.02007-01-0512.21504112.29953811.99851812.257289836300.0
 


And here is the Log for the same Symbol:

OnData - 2007-01-04 00:00:00 EWA: Close=12.431563452 -Open=12.558308364

OnData - 2007-01-05 00:00:00 EWA: Close=12.215040894 -Open=12.257289198

In my opinion, according to the documentation, the data fed on 2007-01-04 00:00 should correspond to the bar of the previous day (2007-01-03), And normally, the value for the history should correspond to the open and close of day 2007-01-04. Am I doing anything wrong or there is just a "shift" in both data? I also tested the algorithm using AfterMarketOpen, and the values are the same for day 2007-01-04, so according to the time frontier concept, these values are from the day before.. Thanks in advance, and congratulations for the great platform.  Mauricio  

Author