I logged some data on the SPY wanting to see when the OHLC prices were emitted to the algo.

The first entry in the logging results:

2020-01-01 00:00:00 2020-01-01 00:00:00: Open 320.5 , High 322.125 , Low 320.15, Close 321.86

Am I interpreting this correctly? Midnight 00:00 of 1-1-2020, the algo is aware of its EOD Closing price?

Or is there another time variable to access associated with data["SPY"].Close?  

I'd like to exactly when any data is emitted to the algo.  Thank you very much for the help!

Per the Docs: 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.

class Milk(QCAlgorithm):
    
    O = None
    H = None
    L = None
    C = None

    def Initialize(self):
        self.SetStartDate(2020,1,1)  
        self.SetEndDate(2021,1,1)
        self.SetCash(100000)  
        
        self.spy = self.AddEquity("SPY", Resolution.Daily)
        self.spy.SetDataNormalizationMode(DataNormalizationMode.Raw)


    def OnData(self, data):
        if data["SPY"] is not None:
            self.Plot("SPY", "SPY", self.Securities["SPY"].Close)
            self.O = data["SPY"].Open
            self.H = data["SPY"].High
            self.L = data["SPY"].Low
            self.C = data['SPY'].Close
            self.Log(f"{self.Time}: Open {self.O} , High {self.H} , Low {self.L}, Close {self.C}")

Author