From 13441079734941a3f0079935d513458db4896bde Mon Sep 17 00:00:00 2001 From: moshferatu Date: Thu, 9 Jan 2025 08:02:24 -0800 Subject: [PATCH] Remove hard-coded long-term trend period value from ConnorsRSI strategy --- strategies/connors-rsi/ConnorsRSIBot.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/strategies/connors-rsi/ConnorsRSIBot.cs b/strategies/connors-rsi/ConnorsRSIBot.cs index 154f1a6..5d32b20 100644 --- a/strategies/connors-rsi/ConnorsRSIBot.cs +++ b/strategies/connors-rsi/ConnorsRSIBot.cs @@ -1,6 +1,7 @@ #region Using declarations using NinjaTrader.Cbi; using NinjaTrader.NinjaScript.Indicators; +using System; using System.ComponentModel.DataAnnotations; #endregion @@ -39,7 +40,7 @@ namespace NinjaTrader.NinjaScript.Strategies protected override void OnBarUpdate() { - if (CurrentBar < 200) + if (CurrentBar < Math.Max(LongTermTrendPeriod, PercentRankPeriod)) return; if (Close[0] > longTermTrend[0] && connorsRSI[0] < 15)