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 -12.711 Tracking Error 0.022 Treynor Ratio 0 Total Fees $0.00 |
class DynamicUncoupledPrism(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 7, 20) # Set Start Date self.SetEndDate(2020, 7, 21) self.SetCash(1500) # Set Strategy Cash self.symbol = "EURUSD" # Add forex and set brokerage model self.AddForex(self.symbol, Resolution.Minute, Market.Oanda, True, 50) # self.SetBrokerageModel(BrokerageName.OandaBrokerage) # Setup indicators self.rsi = RelativeStrengthIndex(6, MovingAverageType.Simple) # Setup bar consolidator thirtyMinuteConsolidator = QuoteBarConsolidator(timedelta(minutes=30)) self.SubscriptionManager.AddConsolidator(self.symbol, thirtyMinuteConsolidator) self.RegisterIndicator(self.symbol, self.rsi, thirtyMinuteConsolidator) # Setup window self.rsiWindow = RollingWindow[float](5) def OnData(self, data): self.rsiWindow.Add(self.rsi.Current.Value) # Wait for rsi if not self.rsi.IsReady: return self.Debug(data.Bars[self.symbol].EndTime) self.Debug("RSI: " + str(self.rsi.Current.Value)) self.Debug("OPEN: " + str(data.Bars[self.symbol].Open)) self.Debug("HIGH: " + str(data.Bars[self.symbol].High)) self.Debug("LOW: " + str(data.Bars[self.symbol].Low)) self.Debug("CLOSE: " + str(data.Bars[self.symbol].Close)) # self.Debug("IS_INVESTED: " + str(is_invested)) # self.Debug("IS_LONG: " + str(is_long)) # self.Debug("IS_SHORT: " + str(is_short)) # self.Debug("SHOULD LONG: " + str(should_buy)) # self.Debug("SHOULD EXIT LONG: " + str(should_exit_buy)) # self.Debug("SHOULD SHORT: " + str(should_sell)) # self.Debug("SHOULD EXIT SHORT: " + str(should_exit_sell)) # self.Debug(data.Bars[self.symbol].EndTime) # self.Debug("OPEN: " + str(data.Bars[self.symbol].Open)) # self.Debug("HIGH: " + str(data.Bars[self.symbol].High)) # self.Debug("LOW: " + str(data.Bars[self.symbol].Low)) # self.Debug("CLOSE: " + str(data.Bars[self.symbol].Close))