Hello,

I think a working example of this could be very helpful for adoption, especially for users looking to implement daily resolution Swing Trading strategies who need up-to-date OHLC (and Volume) data prior to making a trading decision right before Market Close.

This is common functionality in trading scripting languages like: AmiBroker AFL, NinjaTrader NinjaScript, TradingView PineScript, and TradeStation EasyLanguage. 

In these scripting languages it's possible to access the current intraday (prior to market close) values of OHLC data just simply be referencing High[0] or Volume[0], etc and executing the script intraday.

From doing a number of searches on these forums I see that I can get the current equity price by referencing "Price" instead of "Close" however I am still confused on how to get the rest of the current Open, High, Low, and Volume intraday values on a daily resolution prior to market close

Here is a simple example of the algorithm I am using:

class SwingTrade(QCAlgorithm): def Initialize(self): self.SetCash(100000) self.SetStartDate(2021,4,15) self.SetEndDate(2021,4,15) self.symbol = self.AddEquity("SPY", Resolution.Daily).Symbol self.lookback = 200 # Schedule function 16 minutes before every market close self.Schedule.On(self.DateRules.EveryDay(self.symbol), \ self.TimeRules.BeforeMarketClose(self.symbol, 16), \ Action(self.EveryMarketClose)) def EveryMarketClose(self): # get historical data - ends yesterday self.opens = self.History(self.symbol, self.lookback, Resolution.Daily)["open"] self.highs = self.History(self.symbol, self.lookback, Resolution.Daily)["high"] self.lows = self.History(self.symbol, self.lookback, Resolution.Daily)["low"] self.closes = self.History(self.symbol, self.lookback, Resolution.Daily)["close"] self.volume = self.History(self.symbol, self.lookback, Resolution.Daily)["volume"] # now append today's value of the above using data 16 minutes prior to market close # ?????

Thanks