Remove RSI smoothing parameters from ConnorsRSI indicator in Trading New Highs strategy

This commit is contained in:
moshferatu 2025-01-09 08:37:44 -08:00
parent 4e20777d93
commit 26e05c6ec2

View File

@ -5,16 +5,16 @@ using System.ComponentModel.DataAnnotations;
namespace NinjaTrader.NinjaScript.Strategies namespace NinjaTrader.NinjaScript.Strategies
{ {
public class TradingNewHighs : Strategy public class TradingNewHighs : Strategy
{ {
private const int FiftyTwoWeeksInDays = 252; private const int FiftyTwoWeeksInDays = 252;
private ConnorsRSI connorsRSI; private ConnorsRSI connorsRSI;
protected override void OnStateChange() protected override void OnStateChange()
{ {
if (State == State.SetDefaults) if (State == State.SetDefaults)
{ {
Name = "Trading New Highs"; Name = "Trading New Highs";
Description = @"Taken from chapter 7 of Buy the Fear, Sell the Greed (2018) by Larry Connors"; Description = @"Taken from chapter 7 of Buy the Fear, Sell the Greed (2018) by Larry Connors";
Calculate = Calculate.OnBarClose; Calculate = Calculate.OnBarClose;
@ -24,14 +24,14 @@ namespace NinjaTrader.NinjaScript.Strategies
EntryThreshold = 15; EntryThreshold = 15;
ExitThreshold = 70; ExitThreshold = 70;
} }
else if (State == State.DataLoaded) else if (State == State.DataLoaded)
{ {
connorsRSI = ConnorsRSI(3, 1, 2, 1, 100); connorsRSI = ConnorsRSI(3, 2, 100);
} }
} }
protected override void OnBarUpdate() protected override void OnBarUpdate()
{ {
if (CurrentBar < FiftyTwoWeeksInDays) if (CurrentBar < FiftyTwoWeeksInDays)
return; return;