Hello, I am a fairly new programmer and would appreciate some guidance on debugging a project I'm working on. I am getting an error that I can't seem to fix. It looks like I have the logic correct as far as what I want my Algo to show me, can someone assist me in getting this back testable? Code is python, Thanks for your time !  

class SmoothApricotCaribou(QCAlgorithm):

   def Initialize(self):
       self.SetStartDate(2021, 8, 28)  # Set Start Date
       self.SetEndDate(2022,2,1)
       self.SetCash(50000)  # Set Strategy Cash
       # self.AddEquity("SPY", Resolution.Minute)
       crudeoiwti = self.AddFuture(Futures.Energies.CrudeOilWTI)
       
       self.slowema = self.EMA("CrudeOilWTI", 21, Resolution.Daily)
       self.fastema = self.EMA("CrudeOilWTI", 21, Resolution.Hourly)
       self.rsi = self.RSI(14)
       self.RegisterIndicator("CrudeOilWTI", self.sma, timedelta(minutes=10))
       
       self.Schedule.On(self.DateRules.EveryDay("CrudeOilWTI"), self.TimeRules.At(1, 00), self.ClosePositions)
       
       self.SetBenchmark("CrudeOilWTI")
       
       self.SetWarmUp(timedelta(21))
       


   def OnData(self, data):
       if not self.Portfolio.Invested:
           if self.Securities["CrudeOilWTI"].Close > self.slowema.Current.Value:
               if self.Securities["CrudeOilWTI"].Close > self.fastema.Current.Value:
                   if self.rsi <= 30:
                       self.MarketOrder("CrudeOilWTI", 1)
           if self.Securities["CrudeOilWTI"].Close < self.slowema.Current.Value:
               if self.Securities["CrudeOilWTI"].Close < self.fastema.Current.Value:
                   if self.rsi >= 70:
                       self.MarketOrder("CrudeOilWTI", -1)
       if self.Portfolio.Invested.IsLong:
           if self.Securities["CrudeOilWTI"].Close < self.fastema.Current.Value:
               self.Liquidate("CrudeOilWTI")
       if self.Portfolio.Invested.IsShort:
           if self.Securities["CrudeOilWTI"].Close > self.fastema.Current.Value:
               self.Liquidate("CrudeOilWTI")
       
       
   def ClosePositions(self):
       
       self.Liquidate("CrudeOilWTI")