Overall Statistics
Total Trades
43
Average Win
0.28%
Average Loss
-0.11%
Compounding Annual Return
-25.741%
Drawdown
1.200%
Expectancy
-0.464
Net Profit
-1.027%
Sharpe Ratio
-4.685
Probabilistic Sharpe Ratio
18.515%
Loss Rate
85%
Win Rate
15%
Profit-Loss Ratio
2.58
Alpha
-0.355
Beta
-0.265
Annual Standard Deviation
0.055
Annual Variance
0.003
Information Ratio
1.052
Tracking Error
0.099
Treynor Ratio
0.978
Total Fees
$43.00
class TachyonResistanceProcessor(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019, 9, 15)  # Set Start Date
        self.SetEndDate(2019, 9, 27)
        self.SetCash(100000)  # Set Strategy Cash
        tickers = ["SPY", "GOOG", "AAPL", "FB"]
        
        self.rsi = {}
        
        for ticker in tickers:
            symbol = self.AddEquity(ticker, Resolution.Hour).Symbol
            self.rsi[symbol] = self.RSI(symbol, 14, MovingAverageType.Simple, Resolution.Hour)
        
        self.Schedule.On(self.DateRules.EveryDay("SPY"), self.TimeRules.BeforeMarketClose("SPY", 1), self.ClosePositions)

    def OnData(self, data):
      
        for symbol, rsi in self.rsi.items():
            
            if not rsi.IsReady:
                continue
            
            if rsi.Current.Value < 30:
                self.SetHoldings(symbol, -0.25)
            elif rsi.Current.Value > 70:
                self.SetHoldings(symbol, 0.25)
            
            
    
    def ClosePositions(self):
        
        if self.Portfolio.Invested:
            self.Liquidate()