Overall Statistics
class ParticleVerticalAtmosphericScrubbers(QCAlgorithm):

    def Initialize(self):
        
        self.tickerOne = "AMD"
        self.tickerTwo = "SPY"
        
        self.SetStartDate(2017, 1, 16)  # Set Start Date
        self.SetEndDate(2017, 2, 2)  # Set End Date
        self.SetCash(1000)  # Set Strategy Cash
        self.AddEquity("AMD", Resolution.Minute, Market.USA, True, 1, True)
        self.Securities[self.tickerOne].FeeModel = ConstantFeeModel(0)
        #self.SetDataNormalizationMode(DataNormalizationMode.Raw)
        
        self.Schedule.On(self.DateRules.EveryDay(), self.TimeRules.At(15, 59), Action(self.purchase))

        
    def OnData(self, data):
        
        if self.Portfolio.Invested and self.Securities[self.tickerOne].Price <= self.sellPrice:
            self.LimitOrder(self.tickerOne, -self.Portfolio[self.tickerOne].Quantity, self.Securities[self.tickerOne].Price*.5)

    def purchase(self):
        self.sellPrice = self.Securities[self.tickerOne].Price * 0.991
        self.dailyClose = self.Securities[self.tickerOne].Price
        self.Debug("Portfolio Quantity: " + str(self.Portfolio[self.tickerOne].Quantity))
        if not self.Portfolio.Invested:
            self.SetHoldings(self.tickerOne, 1)

    def OnOrderEvent(self, fill):
        if fill.Status == 3:
            if fill.Direction == 0:
                direction = "Buy"
                self.Debug(str(direction) + " " + str(fill.FillQuantity) + " @ " + str(fill.FillPrice))
            else:
                direction = "Sell"
                self.Debug(str(direction) + " " + str(fill.FillQuantity) + " @ " +str(fill.FillPrice) + " Loss: " + 
                str( (fill.FillPrice-self.dailyClose)/self.dailyClose ))