diff --git a/strategies/connors-rsi/ConnorsRSIBot.cs b/strategies/connors-rsi/ConnorsRSIBot.cs index 5d32b20..04aa4b4 100644 --- a/strategies/connors-rsi/ConnorsRSIBot.cs +++ b/strategies/connors-rsi/ConnorsRSIBot.cs @@ -26,6 +26,8 @@ namespace NinjaTrader.NinjaScript.Strategies RSIPeriod = 3; StreakRSIPeriod = 2; PercentRankPeriod = 100; + LongEntryThreshold = 15; + ShortEntryThreshold = 85; LongTermTrendPeriod = 200; ShortTermTrendPeriod = 5; } @@ -43,9 +45,9 @@ namespace NinjaTrader.NinjaScript.Strategies if (CurrentBar < Math.Max(LongTermTrendPeriod, PercentRankPeriod)) return; - if (Close[0] > longTermTrend[0] && connorsRSI[0] < 15) + if (Close[0] > longTermTrend[0] && connorsRSI[0] < LongEntryThreshold) EnterLong(); - else if (Close[0] < longTermTrend[0] && connorsRSI[0] > 85) + else if (Close[0] < longTermTrend[0] && connorsRSI[0] > ShortEntryThreshold) EnterShort(); if (Position.MarketPosition == MarketPosition.Long && Close[0] > shortTermTrend[0]) @@ -72,11 +74,19 @@ namespace NinjaTrader.NinjaScript.Strategies public int PercentRankPeriod { get; set; } [NinjaScriptProperty] - [Display(Name = "Long-Term Trend Period", GroupName = "ConnorsRSI Bot", Order = 4)] + [Display(Name = "Long Entry Threshold", GroupName = "ConnorsRSI Bot", Order = 4)] + public double LongEntryThreshold { get; set; } + + [NinjaScriptProperty] + [Display(Name = "Short Entry Threshold", GroupName = "ConnorsRSI Bot", Order = 5)] + public double ShortEntryThreshold { get; set; } + + [NinjaScriptProperty] + [Display(Name = "Long-Term Trend Period", GroupName = "ConnorsRSI Bot", Order = 6)] public int LongTermTrendPeriod { get; set; } [NinjaScriptProperty] - [Display(Name = "Short-Term Trend Period", GroupName = "ConnorsRSI Bot", Order = 5)] + [Display(Name = "Short-Term Trend Period", GroupName = "ConnorsRSI Bot", Order = 7)] public int ShortTermTrendPeriod { get; set; } } }