Hello, 

So after a few days of testing, we found that the RSI 2 and RSI 14 did not match the data on the TradingView servers, by a good amount each time. The types of RSI data seem to be very consistent within themselves, but inconsistent with the data on TradingView. We are using the SPY indicator, warming up and calling different types of RSI each time (Wilders, Linear Moving Average, Exponential, etc.) but nothing seems to quite work. Note that they all give very different results on the actual trading bot.

class RetrospectiveBlackBear(QCAlgorithm):

    def Initialize(self):
        
        self.SetStartDate(2019,4, 1)
        self.SetEndDate(2021, 7 ,15)
        self.SetCash(100000)
        
        
        self.UniverseSettings.Resolution = Resolution.Daily
        
        ##Adds possible equities
        self.symbols =  [
                        self.AddEquity("SPY", Resolution.Daily).Symbol,
                        #self.AddEquity("AGC", Resolution.Daily, fillDataForward == False).Symbol,
                        #self.AddEquity("APPS", Resolution.Daily, fillDataForward == False).Symbol,
                        self.AddEquity("BIB", Resolution.Daily).Symbol,
                        self.AddEquity("BOIL", Resolution.Daily).Symbol,
                        self.AddEquity("BRZU", Resolution.Daily).Symbol,
                        self.AddEquity("CURE", Resolution.Daily).Symbol,
                        self.AddEquity("CWEB", Resolution.Daily).Symbol,
                        self.AddEquity("DRN", Resolution.Daily).Symbol,
                        self.AddEquity("EDC", Resolution.Daily).Symbol,
                        ]
        
        #Creates RSI2 list
        self.rsiTwo = [self.RSI(x, 2, MovingAverageType.Exponential , Resolution.Daily) for x in self.symbols]
        
        #Creates RSI14 list
        self.rsiFourteen = [self.RSI(x, 14, MovingAverageType.Exponential, Resolution.Daily) for x in self.symbols]

        
        #SetWarmUp 200 days in minute
        self.SetWarmUp(250, Resolution.Daily)
        
        """
        #Calculate Indicators Daily  
        for x in self.symbols:
            self.Schedule.On(self.DateRules.EveryDay(x), self.TimeRules.BeforeMarketClose(x,15), self.UpdateIndicators())
        """
    
    
    def OnData(self, data):
        
        #self.Debug(str(self.Time) + "- RSI2 SPY: " + str(self.rsiTwo[0].Current.Value))
        self.Debug(str(self.Time) + "- RSI14 SPY: " + str(self.rsiFourteen[0].Current.Value))
        #self.Debug(str(self.Time) + "- SMA 5: " + str(self.smaFive[0].Current.Value))

        #Checks if the variables were warmed up
        if self.IsWarmingUp:
            #self.Debug("IT IS NOT Warm enough")
            return
        for z in range(len(self.symbols)):
            if not self.rsiTwo[z].IsReady:
                return
        
        #self.Debug("RSI2 list is " + str(self.rsiTwo))
  
   
  

This is the code that creates the list of RSI's based on the symbol list with all the stocks.

Thank you very much, hope you have a good day

Author