Overall Statistics
Total Trades
10851
Average Win
0.00%
Average Loss
-0.01%
Compounding Annual Return
-21.233%
Drawdown
13.000%
Expectancy
-0.430
Net Profit
-13.000%
Sharpe Ratio
-17.877
Probabilistic Sharpe Ratio
0.000%
Loss Rate
67%
Win Rate
33%
Profit-Loss Ratio
0.73
Alpha
-0.24
Beta
0.126
Annual Standard Deviation
0.012
Annual Variance
0
Information Ratio
-6.933
Tracking Error
0.061
Treynor Ratio
-1.694
Total Fees
$10851.00
Estimated Strategy Capacity
$4200000.00
Lowest Capacity Asset
SPY R735QTJ8XC9X
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)
       self.RSI1 = self.RSI("SPY", 5)
       self.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 self.RSI1.Current.Value > 50:
               self.Liquidate()