As the title suggests, I've been working on a strategy using longer EMAs. Unfortunately, no matter what I've done, I haven't been able to get the data on both platforms to line up. In the case of the 30-minute (1500, Close), there is a ~0.4% difference in most cases. Is there anyone here who has experienced a similar issue? If so, how did you fix it?

 

Here is the code related to the EMAs.

Thank you in advance for the help!

from AlgorithmImports import *

class Example(QCAlgorithm):

    def Initialize(self):
        # Set parameters
        self.SetStartDate(2024, 1, 1)
        self.SetEndDate(2025, 1, 1)
        self.set_time_zone(TimeZones.NEW_YORK)
        self.set_account_currency('USD')
        self.SetCash(100000)
        # self.set_warm_up(timedelta(days=365*50))

        # Add SPY data
        spy = self.AddEquity("SPY", Resolution.Minute)
        spy.set_fee_model(ConstantFeeModel(0))
        self.symbol = spy.Symbol
        self.set_benchmark(self.symbol)

        # Define EMAs for various resolutions
        #...
        self.ema1500_30min = ExponentialMovingAverage(1500)

        # Consolidators for higher resolutions
        #...
        self.Consolidate(self.symbol, timedelta(minutes=30), self.UpdateEMA_30min)

        # State variables
        #...
        self.prev_ema1500_30min = RollingWindow[float](2)
        self.backtest_start = True
        #...

    def UpdateEMA_30min(self, bar):
        #...
        self.ema1500_30min.Update(bar.EndTime, bar.Close)

    def OnData(self, data):
        if self.is_warming_up: 
            return
            
        # Ensure all indicators are ready
        if not self.AllEMAsReady():
            return

        #...

    def AllEMAsReady(self):
        """Check if all EMAs are ready."""
        return all([self.ema1500_30min.IsReady, self.prev_ema1500_30min.IsReady,])