Overall Statistics |
Total Trades 0 Average Win 0% Average Loss 0% Compounding Annual Return 0% Drawdown 0% Expectancy 0 Net Profit 0% Sharpe Ratio 0 Loss Rate 0% Win Rate 0% Profit-Loss Ratio 0 Alpha 0 Beta 0 Annual Standard Deviation 0 Annual Variance 0 Information Ratio 0 Tracking Error 0 Treynor Ratio 0 Total Fees $0.00 |
import numpy as np import datetime from scipy import stats class Algorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2012,1,1) #Set Start Date self.SetEndDate(2012,2,5) #Set End Date self.SetCash(100000) #Set Strategy Cash # Find more symbols here: http://quantconnect.com/data self.atr_window = 20 self.symbols = ['ABT', 'ACN', 'ACE', 'ADBE','SPY'] self.atrDict = {} for symbol in self.symbols: self.AddEquity(symbol, Resolution.Daily) self.atrDict[symbol]=self.ATR(symbol, self.atr_window ) self.Schedule.On(self.DateRules.MonthStart("SPY"), self.TimeRules.AfterMarketOpen("SPY", 60), Action(self.Rebalance)) def Rebalance(self): if not self.atrDict['ABT'].IsReady: self.Debug("not IsReady") return self.Debug("Ready") for symbol in self.symbols: averageTrueRange = self.atrDict[symbol].Current.Value self.Log(averageTrueRange)