From 15c7873b2c25b5c7659176c4bd2258aac53725d3 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Thu, 9 Jan 2025 08:42:55 -0800 Subject: [PATCH] Add ConnorsRSI parameters to Trading New Highs strategy --- .../trading-new-highs/TradingNewHighs.cs | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/strategies/trading-new-highs/TradingNewHighs.cs b/strategies/trading-new-highs/TradingNewHighs.cs index 67ff55c..d020185 100644 --- a/strategies/trading-new-highs/TradingNewHighs.cs +++ b/strategies/trading-new-highs/TradingNewHighs.cs @@ -21,12 +21,15 @@ namespace NinjaTrader.NinjaScript.Strategies EntriesPerDirection = 1; MaxDaysSinceHigh = 20; + RSIPeriod = 3; + StreakRSIPeriod = 2; + PercentRankPeriod = 100; EntryThreshold = 15; ExitThreshold = 70; } else if (State == State.DataLoaded) { - connorsRSI = ConnorsRSI(3, 2, 100); + connorsRSI = ConnorsRSI(RSIPeriod, StreakRSIPeriod, PercentRankPeriod); } } @@ -52,11 +55,23 @@ namespace NinjaTrader.NinjaScript.Strategies public double MaxDaysSinceHigh { get; set; } [NinjaScriptProperty] - [Display(Name = "ConnorsRSI Entry Threshold", GroupName = "Trading New Highs", Order = 2)] + [Display(Name = "RSI Period", GroupName = "Trading New Highs", Order = 2)] + public int RSIPeriod { get; set; } + + [NinjaScriptProperty] + [Display(Name = "Streak RSI Period", GroupName = "Trading New Highs", Order = 3)] + public int StreakRSIPeriod { get; set; } + + [NinjaScriptProperty] + [Display(Name = "Percent Rank Period", GroupName = "Trading New Highs", Order = 4)] + public int PercentRankPeriod { get; set; } + + [NinjaScriptProperty] + [Display(Name = "ConnorsRSI Entry Threshold", GroupName = "Trading New Highs", Order = 5)] public double EntryThreshold { get; set; } [NinjaScriptProperty] - [Display(Name = "ConnorsRSI Exit Threshold", GroupName = "Trading New Highs", Order = 3)] + [Display(Name = "ConnorsRSI Exit Threshold", GroupName = "Trading New Highs", Order = 6)] public double ExitThreshold { get; set; } } }