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 |
from datetime import datetime, timedelta class WhoItsWhatsIts(QCAlgorithm): def Initialize(self): # set cash, dates, and brokerage fees self.SetCash(100000) self.SetStartDate(2017,3,1) self.SetEndDate(2017,5,1) self.SetBrokerageModel(BrokerageName.OandaBrokerage) # holds symbol data self.Data = {} self.SymbolData = {} # resolution designations self.PR = Resolution.Hour self.IR = Resolution.Hour # initialize forex pairs self.pairs =["USDJPY", "AUDUSD", "NZDUSD", "USDCAD", "EURUSD", "EURJPY"] for symbol in self.pairs: if symbol not in self.Data: fx = self.AddForex(symbol, self.PR, Market.Oanda) self.Data[symbol]= fx else: break # initialize indicators for all pairs for symbol in self.Data.items(): macd = self.MACD(fx.Symbol, 11, 25, 8, self.IR) sma = self.SMA(fx.Symbol, 18, self.IR) rsi = self.RSI(fx.Symbol, 14, self.IR) self.SymbolData[symbol] = SymbolData(symbol,macd,sma,rsi) def OnEndOfDay(self): # plot indicators #for fx in self.Data: # self.PlotIndicator("MACD", self.macd) # self.PlotIndicator("SMA", self.sma) # self.PlotIndicator("RSI", self.rsi) for fx in self.SymbolData: self.Debug(self.SymbolData[fx].Symbol) self.Debug(self.SymbolData[fx].MACD.Current.Value) self.Debug(self.SymbolData[fx].SMA.Current.Value) self.Debug(self.SymbolData[fx].RSI.Current.Value) class SymbolData(object): def __init__(self, symbol, macd, sma, rsi): self.Symbol = symbol self.MACD = macd self.SMA = sma self.RSI = rsi