Overall Statistics
class ResistanceHorizontalCircuit(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2019, 1, 1)  # Set Start Date
        self.SetEndDate(2019, 1, 5)
        self.SetCash(100000)  # Set Strategy Cash
        security = self.AddEquity("SPY", Resolution.Daily)
        
        # set buying power model
        security.MarginModel = BuyingPowerModel(requiredFreeBuyingPowerPercent = 0.05)


    def OnData(self, data):
        if not self.Portfolio.Invested:
           self.SetHoldings("SPY", 1)
    
    def OnOrderEvent(self, orderEvent):
        self.Log(orderEvent)
        self.Log(f'cash reserved: {self.Portfolio.Cash}')