| Overall Statistics |
|
Total Trades 1 Average Win 0% Average Loss 0% Compounding Annual Return 13.901% Drawdown 23.300% Expectancy 0 Net Profit 92.525% Sharpe Ratio 0.858 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0.034 Beta 1.161 Annual Standard Deviation 0.168 Annual Variance 0.028 Information Ratio 0.731 Tracking Error 0.068 Treynor Ratio 0.124 Total Fees $5.97 |
import numpy as np
class betaExample(QCAlgorithm):
'''Basic template algorithm simply initializes the date range and cash'''
def Initialize(self):
'''Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.'''
self.SetStartDate(2014,1, 1) #Set Start Date
self.SetEndDate(2019,1,11) #Set End Date
self.SetCash(100000) #Set Strategy Cash
# Find more symbols here: http://quantconnect.com/data
self.tickers = ["QQQ","SPY"]
for symbol in self.tickers:
self.AddEquity(symbol, Resolution.Daily)
self.SetBenchmark("SPY")
#self.Debug("numpy test >>> print numpy.pi: " + str(np.pi))
def OnData(self, data):
#if self.Time.Hour==15 and self.Time.Minute ==59:
if not self.Portfolio.Invested:
self.SetHoldings("QQQ", 1)