Hello,

I have been working on this alogrithm that using Bollinger Bands and MACD to confirm and place trades. However when I try and backtest it i get an error: 

Runtime Error: AttributeError : 'MethodBinding' object has no attribute 'IsReady'
at OnData in main.py:line 54
AttributeError : 'MethodBinding' object has no attribute 'IsReady'

I ONLY have this error with MACD never with Bolband no matter which order thery are in. This seems to be the last issue I have that is preventing this from running. Alex has been helping me a lot with this and about adding extra stocks to it and not just using a universe to better control the portfolio. He wanted me to add adding several specfric stocks to this forum post as well for other people who are interesated. It was adding AAPL and NVDA to the algorithm to be traded on indeendant of each other. What he said was:Essentially, you need to create a class that will include all the indicators and a dictionary keyed by the security Symbol:

 

 

class SymbolData:

    def __init__(self, symbol, algorithm):
        self.Symbol = symbol
        self.MACD = algorithm.MACD(symbol, 12, 26, 9, MovingAverageType.Exponential, Resolution.Daily)

In Initilialize:
self.aapl = self.AddEquity("AAPL", Resolution.Daily).Symbol
self.nvda = self.AddEquity("NVDA", Resolution.Daily).Symbol
self.cache = {    
    self.aapl: SymbolData(self.aapl, self),
    self.nvda: SymbolData(self.nvda, self)
}

 

 

If anyone has a solution to the Runtime Error I am getting I would very much appreciate it!

Author