class SmoothBlueGuanaco(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2020, 1, 1) # Set Start Date
self.SetEndDate(2021,1,1)
self.SetCash(100000) # Set Strategy Cash
self.spy = self.AddEquity("SPY", Resolution.Daily).Symbol
self.data = {}
self.closingPrices = {}
self.symbols = ["SPY", "IGV", "XLE", "VNQ", "XLF", "XME", "XHB", "TBT", "KWEB", "OIH","XBI"]
for symbol in self.symbols:
self.AddEquity(symbol, Resolution.Daily)
self.data[symbol] = self.MOM(symbol, 30, Resolution.Daily)
self.closingPrices[symbol] = self.History(symbol, 30, Resolution.Daily)["close"]
self.sma = self.SMA(self.spy, 30, Resolution.Daily)
def OnData(self, data: Slice):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
Arguments:
data: Slice object keyed by symbol containing the stock data
'''
pass