Hi every one
I would appreciate help in this, currently, i am working on a frame algorithm using the stochastic indicator, and when I call the indicator in

OnSecuritiesChanged(self, algorithm, changes) i have to manually update the indicator through this for tuple in history.loc[ticker].itertuples():                    self.sto.Update(tuple.Index, tuple.close) but I encounter this error throw new NotSupportedException($"{GetType().Name} does not support Update(DateTime, decimal) method overload. Use Update({typeof(T).Name}) instead."); How can this be implemented in the above code: Thanks in advanceEssam Saied def OnSecuritiesChanged(self, algorithm, changes): # clean up data for removed securities symbols = [ x.Symbol for x in changes.RemovedSecurities ] if len(symbols) > 0: for subscription in algorithm.SubscriptionManager.Subscriptions: if subscription.Symbol in symbols: self.symbolDataBySymbol.pop(subscription.Symbol, None) subscription.Consolidators.Clear() # initialize data for added securities addedSymbols = [ x.Symbol for x in changes.AddedSecurities if x.Symbol not in self.symbolDataBySymbol] if len(addedSymbols) == 0: return history = algorithm.History(addedSymbols, self.period, self.resolution) for symbol in addedSymbols: self.sto = algorithm.STO(symbol, self.period, self.resolution) self.sto.Updated += self.STO_Updated self.STO_Window = RollingWindow[IndicatorDataPoint](6) if not history.empty: ticker = SymbolCache.GetTicker(symbol) """ if ticker not in history.index.levels[0]: algorithm.Log.Trace(f'RsiAlphaModel.OnSecuritiesChanged: {ticker} not found in history data frame.') continue """ for tuple in history.loc[ticker].itertuples(): self.sto.Update(tuple.Index, tuple.close) self.symbolDataBySymbol[symbol] = SymbolData(symbol, self.STO_Window)

 

  

Author