Overall Statistics
Total Trades
0
Average Win
0%
Average Loss
0%
Compounding Annual Return
0%
Drawdown
0%
Expectancy
0
Net Profit
0%
Sharpe Ratio
0
Probabilistic Sharpe Ratio
0%
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
0
Annual Standard Deviation
0
Annual Variance
0
Information Ratio
-0.768
Tracking Error
0.22
Treynor Ratio
0
Total Fees
$0.00
Estimated Strategy Capacity
$0
Lowest Capacity Asset
# Plot SMA, SMA of the SMA and RSI on hl2 data
 
# -----------------------------------------------------------------------
CRYPTOS = ["ETHUSD", "BTCUSD", "LINKUSD"]; MA_1 = 20; MA_2 = 5; RSI = 14; 
# -----------------------------------------------------------------------

class MuscularGreenAlbatross(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2020, 1, 1)  
        self.SetEndDate(2021, 10, 7)
        self.cryptos = [self.AddCrypto(ticker, Resolution.Daily).Symbol for ticker in CRYPTOS]
        self.SetWarmUp(max(MA_1 + MA_2, RSI), Resolution.Daily)
        self.high = {}; self.low = {}; self.hl2 = {}; self.sma = {}; self.sma_sma = {}; self.rsi = {};
        
        for sec in self.cryptos:
            self.high[sec] = self.SMA(sec, 1, Resolution.Daily, Field.High)
            self.low[sec] = self.SMA(sec, 1, Resolution.Daily, Field.Low)
            self.hl2[sec] = IndicatorExtensions.Over(IndicatorExtensions.Plus(self.high[sec], self.low[sec]), 2)
            self.sma[sec] = IndicatorExtensions.SMA(self.hl2[sec], MA_1)
            self.sma_sma[sec] = IndicatorExtensions.SMA(self.sma[sec], MA_2)
            self.rsi[sec] = self.RSI(sec, RSI, MovingAverageType.Simple, Resolution.Daily, Field.Close)

        
    def OnData(self, data):
        if self.IsWarmingUp: return
        
        for sec in self.cryptos:
            if not self.sma[sec].IsReady or not self.sma_sma[sec].IsReady or not self.rsi[sec].IsReady: continue
            price = self.Securities[sec].Price
            sma = self.sma[sec].Current.Value
            sma_sma = self.sma_sma[sec].Current.Value
            rsi = self.rsi[sec].Current.Value
            
            self.Plot("SMA", sec, sma)
            self.Plot("SMA_SMA", sec,  sma_sma)
            self.Plot("RSI", sec, rsi)