Are there other ways to refer to previous bars without using rolling windows?

 


def Initialize(self):

self.AddEquity("SPY", Resolution.Daily)
self.window = RollingWindow[TradeBar](10)

def OnData(self, data):

self.window.Add(data["SPY"])

past= 3
pastBar = self.window[past]

# previous 3 bar Close-------------------------------
pastBar.Close