Hi All,

I am new to QC, but not to the trading world. My colleagues and I are attempting to migrate our strategies to QC but are running into road blocks when trying to create/use very simple indicators and stock properties, such as RSI, Volume, Last days closing price, and Spread. QC seems to make using these fundamental and extremely simple properties incredibly difficult. 

For example, I am trying to re-create a simple RSI buy and sell strategy in QC but to no avail.

The strategy is simple, buy an equity when the RSI is between 50 and 20 on the 5 minute, and ≤ 35 on the 2 minute (see following code). However, this apparently simple concept seems incredibly difficult to implement, and the backtest fails. The API documentation and BootCamp were not helpful at all really, and there seems to be scant amount on tutorial information on implementing simple things such as volume, spread, etc.

My colleagues and I have an entire portfolio of strategies that we would like to migrate to the QC platform, but these issues when implementing simple concepts are preventing us from doing so.

Any help that anyone could give would be extremely appreciated. 


class TradeStrategyTest(QCAlgorithm):
   
   openingBar = None
   currentBar = None
   
  
   def Initialize(self):
       self.SetStartDate(2017,1, 1)  #Set Start Date
       self.SetEndDate(2017,7,31)    #Set End Date
       self.SetCash(100000)           #Set Strategy Cash
       self.AddEquity("SPY", Resolution.Minute)
       RSI1 = self.RSI("SPY", 5)
       RSI2 = self.RSI("SPY", 2)
       self.SetWarmUp(14)
       
   def OnData(self, data):
       
       if self.IsWarmingUp:
           return
   
   
       if not self.Portfolio["SPY"].Invested:
           
           if ((self.RSI1.Current.Value <=50 and self.RSI1.Current.Value >=20) and self.RSI2.Current.Value <=35):
               self.MarketOrder("SPY", 100)
       else:
           
           if RSI1.Current.Value > 50:
               self.Liquidate()