Overall Statistics
class ResistanceNadionCoreWave(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2009,1,1)  # Set Start Date
        self.SetEndDate(2018,12,31)  # Set Start Date
        self.SetCash(100000)  # Set Strategy Cash
        self.SetBenchmark('SPY')
        self.SetWarmUp(200)
        
        self.risk_on = 'SPY'
        self.risk_off = 'IEF'
        all_eq = [self.risk_on,self.risk_off]
        for eq in all_eq:
            self.AddEquity(eq,Resolution.Hour)
        
        self.risk_sma = self.SMA(self.risk_on,200,Resolution.Daily)

    def OnData(self, data):
        # Trade at specific time
        if self.Time.hour==10 and self.Time.minute==0:
            if self.Securities[self.risk_on].Price>self.risk_sma.Current.Value:
                self.Liquidate(self.risk_off)
                self.SetHoldings(self.risk_on,1)
            else:
                self.Liquidate(self.risk_on)
                self.SetHoldings(self.risk_off,1)