Hello,

I'm trying to figure out why the RSI is vastly different from trading view on the 5 minute timeframe. I understand there may be differences in data but this wildly different, ranging from 5, 10, even 20 points different. From what I can see I'm registering the indicator correctly with automatic updates. But when I log the values below, they are completely off.

Eg: July 18 14:00:00 (EST)

TradingView: 70.98

Log: 62.18

For reference, the RSI only became wildly different when I started to consolidate bars to 5 minutes. The 1 minute timeframe matched nearly perfectly with TradingView.

from AlgorithmImports import *
from datetime import datetime, date

class AlertLightBrownHyena(QCAlgorithm):

    def Initialize(self):
	self.ticker = 'SPY'
        self.startingCash = 100000
        self.startDate = '2023-06-01'
        self.endDate = '-'

        # Equities
        self.resolution = Resolution.Minute
        self.equity = self.AddEquity(self.ticker, self.resolution)
        self.equity.SetDataNormalizationMode(DataNormalizationMode.Raw)

        # Backtesting
        self.SetStartDate(datetime.fromisoformat(self.startDate))
        self.SetEndDate(datetime.fromisoformat(self.endDate)) if self.endDate != '-' else self.SetEndDate(datetime.now())
        self.SetCash(self.startingCash)
        self.SetTimeZone("America/New_York")
        self.SetBenchmark(self.equity.Symbol)
        self.SetWarmUp(100)

        # Consolidators
        self.consolidator = self.Consolidate(self.equity.Symbol, timedelta(minutes=5), self.OnFiveMinData)

        # Indicators
        self.rsi = RelativeStrengthIndex(14, MovingAverageType.Simple)
        self.RegisterIndicator(self.equity.Symbol, self.rsi, self.consolidator)
        self.rsiSMA = IndicatorExtensions.SMA(self.rsi, 14)

    def OnFiveMinData(self, data):
        self.Log(f"Close: {round(data.Close, 2)}, RSI: {round(self.rsi.Current.Value, 2)}, RSI SMA: {round(self.rsiSMA.Current.Value, 2)}")