Add ConnorsRSI parameters to Trading New Highs strategy

This commit is contained in:
moshferatu 2025-01-09 08:42:55 -08:00
parent 34e5a701b0
commit 15c7873b2c

View File

@ -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; }
}
}