Overall Statistics
import numpy as np

class DualListedArb(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2017,12,19)  
        self.SetEndDate(2017,12,20)    
        self.SetCash(10000)  
        
        self.AddEquity("UAA", Resolution.Minute)
        self.AddEquity("UA", Resolution.Minute)
        
        self.AddEquity("SPY", Resolution.Minute)
        self.Schedule.On(self.DateRules.EveryDay("SPY"),
                self.TimeRules.At(0,0),
                Action(self.SetBenchmark))
        self.SetWarmUp(int(6.5*60))

    def OnData(self, slice):
        if self.IsWarmingUp: return
        
        mainPrice = slice["UA"].Price 
        dualPrice = slice["UAA"].Price
        
    def SetBenchmark(self):
        self.mainHistory = self.History("UA", 390, Resolution.Minute)
        self.dualHistory = self.History("UAA", 390, Resolution.Minute)
        
        # ERROR STARTS HERE
        #self.spread = self.dualHistory - self.mainHistory
        #self.benchmarkSpread = self.spread.mean()