Hello, I am new to QuantConnect, and I am developing my first algorithm. I am trying to use SMA in my execution model to block trading under certain cases. I researched our document for a long time and finally made this version of the execution model. I am so confused and don't think this implementation is ideal, and the prices are different from what I see from other data sources. The code and screenshots are attached. Looking forward to getting some guidance. Thanks!
 

class MyExecutionModel(ImmediateExecutionModel):

    def __init__(self):
        self.spy = None
        self.spy_sma = None
        super().__init__()

    def Execute(self, algorithm, targets):       
        if len(targets) == 0:
            return 
        if self.spy_sma is None and self.spy is None:
            self.spy = algorithm.AddEquity("SPY", Resolution.Daily)
            self.spy_sma = algorithm.SMA(self.spy.Symbol, 90)
            algorithm.WarmUpIndicator(self.spy.Symbol, self.spy_sma)
        # Only buy stocks if the 90-day SMA of SPY is upwards
        if self.spy_sma.IsReady and self.spy_sma.Current.Value < self.spy.Price:
            super().Execute(algorithm, targets)
        else:
            algorithm.Liquidate()
233455_1691121969.jpg