Overall Statistics
from datetime import timedelta

class RsiAlert(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019,1,10)  #Set Start Date
        self.SetEndDate(2019,2,1)    #Set End Date
        self.SetCash(100000)           #Set Strategy Cash
        self.AddCrypto("BTCUSD", Resolution.Minute, Market.GDAX)
        
        #10-period RSI indicators
        self.rsi5 = RelativeStrengthIndex(10, MovingAverageType.Simple)
        self.rsi15 = RelativeStrengthIndex(10, MovingAverageType.Simple)
        
        #Consolidators
        FiveMinuteConsolidator = TradeBarConsolidator(timedelta(minutes=5))
        FifteenMinuteConsolidator = TradeBarConsolidator(timedelta(minutes=15))
        
        self.SubscriptionManager.AddConsolidator("BTCUSD", FiveMinuteConsolidator)
        self.SubscriptionManager.AddConsolidator("BTCUSD", FifteenMinuteConsolidator)
        
        self.RegisterIndicator("BTCUSD", self.rsi5, FiveMinuteConsolidator)
        self.RegisterIndicator("BTCUSD", self.rsi15, FifteenMinuteConsolidator)
        

    def OnData(self, data):
        if self.rsi5.IsReady:
            rsi5_value = self.rsi5.Current.Value
            if rsi5_value > 70:
                self.Notify.Sms("+1999999999", str(data.Time) + "BTCUSD 5 min RSI high: " + str(rsi5_value))
            if rsi5_value < 30:
                self.Notify.Sms("+1999999999", str(data.Time) + "BTCUSD 5 min RSI low: " + str(rsi5_value))
        if self.rsi15.IsReady:
            rsi15_value = self.rsi15.Current.Value
            if rsi15_value > 70:
                self.Notify.Sms("+1999999999", str(data.Time) + "BTCUSD 15 min RSI high: " + str(rsi15_value))
            if rsi15_value < 30:
                self.Notify.Sms("+1999999999", str(data.Time) + "BTCUSD 15 min RSI low: " + str(rsi15_value))