Hello everyone

For some reason, the DateTimes I receive from historical data requests seems to be one day ahead of the real dates.  In the included algorithm, I request historical data for the three trading days prior to the start date of the algorithm (4th of August) and receive data for the 31st of July, 1st of August (a Sunday) and 4th of August (current start date of the algorithm), while data for the 3rd of August (a Monday) is missing. According to the algorithm logs, the price of AAPL was in the $93 to $96 range the 31st of July, however, according to other price sources, it should have been above $100 that day. Doing a historical data request in daily resolution by specifying DateTimes yields the same results.

There doesn't seem to be any mistake when looking at the data from Quantconnect Data Explorer (https://www.quantconnect.com/data/file/equity/usa/daily/a*/aapl.zip/aapl.csv#p=56), which correctly lists no price data for the 1st and 2nd of August (weekend).

I'm wondering if this could be a bug caused by the daily bars being formed right after midnight, causing the date for that bar to be the following day rather than the day where the price data was from. Requesting minute data using specified DateTimes gives data with the correct and matching DateTimes. While it is easy to work around this in an algorithm, any help or suggestions for fixing this or finding the cause will be appreciated. Thank you.

Mads