Overall Statistics
Total Trades
88
Average Win
0.50%
Average Loss
-0.72%
Compounding Annual Return
59180.818%
Drawdown
3.600%
Expectancy
0.390
Net Profit
13.025%
Sharpe Ratio
607.441
Probabilistic Sharpe Ratio
100%
Loss Rate
18%
Win Rate
82%
Profit-Loss Ratio
0.70
Alpha
81.822
Beta
0.135
Annual Standard Deviation
0.135
Annual Variance
0.018
Information Ratio
468.407
Tracking Error
0.17
Treynor Ratio
610.121
Total Fees
$0.00
Estimated Strategy Capacity
$350000.00
Lowest Capacity Asset
BTCUSD XJ
# Crypto RSI

class CryptoRSI(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2021, 10, 10)  
        self.SetEndDate(2021, 10, 16)
        self.SetCash(1000000) 
        self.crypto = self.AddCrypto("BTCUSD", Resolution.Minute).Symbol
        RSI_period = 14
        self.rsi = self.RSI(self.crypto, RSI_period, Resolution.Minute) 
        self.SetWarmUp(RSI_period + 1)


    def OnData(self, data):
        if self.IsWarmingUp: return
        if not self.rsi.IsReady: return
        
        if self.rsi.Current.Value < 30 and self.Portfolio[self.crypto].Quantity <= 0:
            quantity = self.CalculateOrderQuantity(self.crypto, 0.95)
            self.MarketOrder(self.crypto, quantity)
            # self.Debug("RSI < 30, Buying")

        elif self.rsi.Current.Value > 70 and self.Portfolio[self.crypto].Quantity > 0:
            self.Liquidate()
            # self.Debug("RSI > 70, Selling")
            
        self.Plot("Indicators","RSI", self.rsi.Current.Value)