Overall Statistics
import numpy as np

class BasicTemplateAlgorithm(QCAlgorithm):

    def Initialize(self):

        self.SetStartDate(2013,10, 7)  #Set Start Date
        self.SetEndDate(2013,10,11)    #Set End Date
        self.SetCash(100000)           #Set Strategy Cash
        
        ## Daily resolution for security you want to work with
        self.AddEquity("SPY", Resolution.Daily)
        
        ## Example indicator
        self.sma = self.SMA('SPY', 10)
        self.SetWarmUp(10)

        ## Dummy security data subscription (can be any resolution finer that Daily)
        self.AddEquity("IBM", Resolution.Hour)
        

    def OnData(self, data):
        if not self.sma.IsReady: return
        if not data.ContainsKey('SPY'):
            return
        
        ## This will log the daily TradeBar Close for SPY
        ## and the SMA for SPY, both of which update at Market Close
        self.Log('Price: ' + str(data['SPY'].Close))
        self.Log('SMA: ' + str(self.sma.Current.Value))