I am trying to create composite indicators and I have seen various iterations of c# code going back to 2015 in the forum but I am having trouble translating these to current code using python. Here is a sample of code but it produces the error 

 

During the algorithm initialization, the following exception has occurred: AttributeError : 'ExponentialMovingAverage' object has no attribute 'Of' at Initialize in main.py:line 21
AttributeError : 'ExponentialMovingAverage' object has no attribute 'Of'

 

class BasicCIeAlgorithm(QCAlgorithm): '''Trying to understand the composite indicator in python''' def Initialize(self): self.SetStartDate(2010, 1, 1) #Set Start Date self.SetEndDate(2011, 1, 1) #Set End Date self.SetCash(1000) #Set Strategy Cash self.SetWarmUp(40) self.warmingUp = True self.symbols = ["SPY"] for symbol in self.symbols: self.AddEquity(symbol, Resolution.Daily) STD14 = self.STD(symbol, 14, Resolution.Daily) EMA3_SD14 = ExponentialMovingAverage(3).Of(STD14) def OnData(self, data): pass

Also I stumpled on the Of() and Over() methods by searching for composite indicator exaples but is there a place/way that I can find reference to all the current methods?

Thanks,

Jim

 

Author