| 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 Probabilistic 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 -1.941 Tracking Error 0.115 Treynor Ratio 0 Total Fees $0.00 |
class EURUSDForexAlgo(QCAlgorithm):
SYMBOL = "EURUSD"
def Initialize(self):
self.SetStartDate(2019, 1, 1) # Set Start Date
self.SetEndDate(2019, 6, 1)
self.SetCash(500) # Set Strategy Cash
self.AddForex(self.SYMBOL, Resolution.Hour, Market.FXCM, leverage = 50)
# self.SetTimeZone("Europe/London")
self.SetBrokerageModel(BrokerageName.OandaBrokerage, AccountType.Margin)
self.lotSize = self.Securities[self.SYMBOL].SymbolProperties.LotSize
self.SetWarmup(10)
# consolidating data
self.dailywindow = RollingWindow[QuoteBar](10)
self.Consolidate("EURUSD", Resolution.Daily, lambda x: self.dailywindow.Add(x))
def OnData(self, data):
# QUANDO ARRIVA IL NUOVO GIORNO, CALCOLARE TUTTE LE METRICHE PER IL TIMEFRAME DAILY:
if self.dailywindow.IsReady and self.dailywindow[0].Time != self.dailywindow[1].Time:
self.Debug(" daily OHLC {0},{1},{2},{3}, ".format(self.dailywindow[0].Open,self.dailywindow[0].High,self.dailywindow[0].Low,self.dailywindow[0].Close))
self.Debug(" daily OHLC {0} ".format(self.dailywindow[0].Time))