Hi all,

I'm attempting to compare a donchian channel breakout to the 100 day EMA. When adding this indicator in, my code breaks and I get Error: Cannot Get Managed Object. Does anyone know how to fix this issue? Blow is the changed code, with a previous backtest.

class Donchian6(AlphaModel):
   
   def __init__(self, lowerBand = 55, upperBand = 55, emaPeriod = 100, resolution = Resolution.Daily):
       self.lowerBand = lowerBand
       self.upperBand = upperBand
       self.resolution = resolution
       self.emaPeriod = emaPeriod
       
       self.insightPeriod = Time.Multiply(Extensions.ToTimeSpan(resolution), upperBand)
       self.symbolData = {}

       resolutionString = Extensions.GetEnumString(resolution, Resolution)
       self.Name = '{}({},{},{})'.format(self.__class__.__name__, lowerBand, upperBand, resolutionString)
       

   def Update(self, algorithm, data):
       
       insights = []
       for key, sd in self.symbolData.items():
           if sd.donchian.IsReady and sd.donchianWindow.IsReady and sd._donchian["UpperBand"].IsReady and sd._donchian["LowerBand"].IsReady:
               if sd._donchian["UpperBand"][1] < sd.Security.Close and sd.Security.Close > sd.ema:
                   insights.append(Insight.Price(sd.Security.Symbol, self.insightPeriod, InsightDirection.Up))
               
               if sd._donchian["LowerBand"][1] > sd.Security.Close and sd.Security.Close < sd.ema:
                   insights.append(Insight.Price(sd.Security.Symbol, self.insightPeriod, InsightDirection.Down))    
           
       return insights
       
   def OnSecuritiesChanged(self, algorithm, changes):
       for added in changes.AddedSecurities:
           self.symbolData[added.Symbol] = SymbolData(algorithm, added, self.upperBand, self.lowerBand, self.emaPeriod, self.resolution)
       
       for removed in changes.RemovedSecurities:
           data = self.symbolData.pop(removed.Symbol, None)
           if data is not None:
               algorithm.SubscriptionManager.RemoveConsolidator(removed.Symbol, data.Consolidator)
               
class SymbolData:
   def __init__(self, algorithm, security, lowerBand, upperBand, emaPeriod, resolution):
       self.Security = security
       self.donchian = DonchianChannel(upperBand, lowerBand)
       self._donchian = {}
       
       self.Consolidator = algorithm.ResolveConsolidator(security.Symbol, resolution)
       algorithm.RegisterIndicator(security.Symbol, self.donchian, self.Consolidator)
       
       self.donchian.Updated += self.DonchianUpdated
       
       self.donchianWindow = RollingWindow[IndicatorDataPoint](2)
       self._donchian["UpperBand"] = RollingWindow[float](2)
       self._donchian["LowerBand"] = RollingWindow[float](2)
       
       self.ema = ExponentialMovingAverage(emaPeriod)
       self.ConsolidatorEMA = algorithm.ResolveConsolidator(security.Symbol, resolution)
       algorithm.RegisterIndicator(security.Symbol, self.ema, self.ConsolidatorEMA)
       
   def DonchianUpdated(self, sender, updated):
       self.donchianWindow.Add(updated)
       
       self._donchian["UpperBand"].Add(self.donchian.UpperBand.Current.Value)
       self._donchian["LowerBand"].Add(self.donchian.LowerBand.Current.Value)