Overall Statistics
Total Trades
2
Average Win
0%
Average Loss
0%
Compounding Annual Return
206.170%
Drawdown
0.300%
Expectancy
0
Net Profit
1.545%
Sharpe Ratio
9.917
Loss Rate
0%
Win Rate
0%
Profit-Loss Ratio
0
Alpha
0
Beta
56.211
Annual Standard Deviation
0.065
Annual Variance
0.004
Information Ratio
9.757
Tracking Error
0.065
Treynor Ratio
0.011
Total Fees
$8.78
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)