Overall Statistics
import numpy as np

class BasicTemplateAlgorithm(QCAlgorithm):

    def Initialize(self):

        self.SetStartDate(2012,10, 1)  #Set Start Date
        self.SetEndDate(2012,10,5)    #Set End Date
        self.SetCash(100000)           #Set Strategy Cash
        self.AddEquity("WMT", Resolution.Daily)
        self.Securities["WMT"].SetLeverage(2)

    def OnData(self, data):
        self.Log('Cash: ' + str(self.Portfolio.Cash))
        self.Log('GetBuyingPower: ' + str(self.Portfolio.GetBuyingPower("WMT", OrderDirection.Buy)))
        self.Log('AveragePrice: ' + str(self.Portfolio["WMT"].AveragePrice))
        self.Log('TotalFees: ' + str(self.Portfolio.TotalFees))
        self.Log('CalculateOrderQuantity: ' + str(self.CalculateOrderQuantity("WMT", 1)))

        self.SetHoldings("WMT", 1)