Hi, i am attempting to add custom period indicator to my algorithm class Symbol Data, so that i can reference them later on for multiple securities, unfortunately i keep getting this:

'SymbolData' object has no attribute 'RegisterIndicator' I would appreciate if someone can point out my error and offer a solution,Here is the algorithmi was working on.from datetime import timedelta, datetime class SwimmingYellowGreenAntelope(QCAlgorithm): def Initialize(self): self.SetStartDate(2015, 12, 1) # Set Start Date self.SetEndDate(2020, 12, 1) self.SetCash(100000) # Set Strategy Cash #EURUSD", "USDJPY", "GBPUSD", "AUDUSD" "USDCAD", #"GBPJPY", "EURUSD", "AUDUSD", "EURJPY", "EURGBP" self.Data = {} for ticker in ["EURUSD","NZDUSD","USDJPY"]: symbol = self.AddForex(ticker, Resolution.Hour, Market.FXCM).Symbol self.Data[symbol] = SymbolData(self, symbol) self.stopLossLevel = -0.05 # stop loss percentage self.stopProfitLevel = 0.01# stop profit percentage self.SetWarmUp(200, Resolution.Hour) def OnData(self, data): if self.IsWarmingUp: return for symbol, symbolData in self.Data.items(): if not (data.ContainsKey(symbol) and data[symbol] is not None and symbolData.IsReady): continue RSI = symbolData.rsi.Current.Value current_price = data[symbol].Close if self.Portfolio[symbol].Invested: if self.isLong: condStopProfit = (current_price - self.buyInPrice)/self.buyInPrice > self.stopProfitLevel condStopLoss = (current_price - self.buyInPrice)/self.buyInPrice < self.stopLossLevel if condStopProfit: self.Liquidate(symbol) self.Log(f"{self.Time} Long Position Stop Profit at {current_price}") if condStopLoss: self.Liquidate(symbol) self.Log(f"{self.Time} Long Position Stop Loss at {current_price}") else: condStopProfit = (self.sellInPrice - current_price)/self.sellInPrice > self.stopProfitLevel condStopLoss = (self.sellInPrice - current_price)/self.sellInPrice < self.stopLossLevel if condStopProfit: self.Liquidate(symbol) self.Log(f"{self.Time} Short Position Stop Profit at {current_price}") if condStopLoss: self.Liquidate(symbol) self.Log(f"{self.Time} Short Position Stop Loss at {current_price}") if not self.Portfolio[symbol].Invested: lbbclose = symbolData.closeWindow[20] # self.closeWindow[20] lbsclose = symbolData.closeWindow[10] # self.closeWindow[10] if RSI < 50 and current_price < lbbclose and current_price > lbsclose: self.SetHoldings(symbol, 0) # get buy-in price for trailing stop loss/profit self.buyInPrice = current_price # entered long position self.isLong = True self.Log(f"{self.Time} Entered Long Position at {current_price}") if RSI > 50 and current_price > lbbclose and current_price < lbsclose: self.SetHoldings(symbol, -1) # get sell-in price for trailing stop loss/profit self.sellInPrice = current_price # entered short position self.isLong = False self.Log(f"{self.Time} Entered Short Position at {current_price}") class SymbolData: def __init__(self, algorithm, symbol): self.rsi = RelativeStrengthIndex(14, MovingAverageType.Simple) self.rsiWindow = RollingWindow[IndicatorDataPoint](2) #Generating 14-period RSI values of 4 hours Resolution. self.RegisterIndicator(symbol, self.rsi, timedelta(hours=4)) self.rsi.Updated += self.RsiUpdated self.closeWindow = RollingWindow[float](21) # Add consolidator to track rolling close prices self.consolidator = QuoteBarConsolidator(4) self.consolidator.DataConsolidated += self.CloseUpdated algorithm.SubscriptionManager.AddConsolidator(symbol, self.consolidator) def RsiUpdated(self, sender, updated): '''Event holder to update the RSI Rolling Window values''' if self.rsi.IsReady: self.rsiWindow.Add(updated) def CloseUpdated(self, sender, bar): '''Event holder to update the close Rolling Window values''' self.closeWindow.Add(bar.Close) @property def IsReady(self): return self.closeWindow.IsReady and self.rsi.IsReady  

Author