Overall Statistics
class UncoupledHorizontalCompensator(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019, 11, 6)  # Set Start Date
        self.SetEndDate(2019, 11, 9)
        self.SetCash(100000)  # Set Strategy Cash
        self.AddEquity("SPY", Resolution.Minute)

        self.Schedule.On(self.DateRules.EveryDay("SPY"), self.TimeRules.BeforeMarketClose("SPY", 30), self.ClosePositions)
        
        
        
    def OnData(self, data):
        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
            Arguments:
                data: Slice object keyed by symbol containing the stock data
        '''
        
        stop_time = self.Time.replace(hour=15, minute=29)
        
        if self.Time > stop_time:
            return
        
        
        
        if not self.Portfolio.Invested:
            self.Debug(f"Trading - {self.Time}")
            self.SetHoldings("SPY", 1)
            
    def ClosePositions(self):
        self.Liquidate()