Overall Statistics
class EMAMomentumUniverse(QCAlgorithm):
    
    def Initialize(self):
        self.SetStartDate(2020, 4, 30)
        self.SetEndDate(2020, 4, 30)
        self.SetCash(100000)
        self.symbol = 'CHK'
        self.StockList = [self.symbol]
        self.SetUniverseSelection(ManualUniverseSelectionModel(self.StockList))
        self.AddEquity(self.symbol, Resolution.Minute)
        
        ema_length = 9
        self.SetWarmUp(ema_length)
        self.ema = self.EMA(self.symbol, ema_length, Resolution.Minute)
        
        self.trade = False
        
        self.Schedule.On(self.DateRules.EveryDay(self.symbol), \
                 self.TimeRules.AfterMarketOpen(self.symbol, -1), \
                 self.EnableTrading)
                 
        self.Schedule.On(self.DateRules.EveryDay(self.symbol), \
                 self.TimeRules.BeforeMarketClose(self.symbol, 1), \
                 self.ClosePositions)
        
        
    def OnData(self, data):
        if not data.ContainsKey(self.symbol):
            return
        
        if not self.trade:
            return
        
        direction = 1 if self.ema.Current.Value > data[self.symbol].Close else -1
        self.SetHoldings(self.symbol, direction)

    def EnableTrading(self):
        self.trade = True
    
    def ClosePositions(self):
        self.Liquidate()
        self.trade = False