diff --git a/strategies/rsi-divergence/RSIDivergenceBot.cs b/strategies/rsi-divergence/RSIDivergenceBot.cs index a9c8ac7..00dcb4b 100644 --- a/strategies/rsi-divergence/RSIDivergenceBot.cs +++ b/strategies/rsi-divergence/RSIDivergenceBot.cs @@ -1,6 +1,7 @@ #region Using declarations using NinjaTrader.Cbi; using NinjaTrader.NinjaScript.Indicators; +using System.ComponentModel.DataAnnotations; #endregion namespace NinjaTrader.NinjaScript.Strategies @@ -31,10 +32,13 @@ namespace NinjaTrader.NinjaScript.Strategies StopTargetHandling = StopTargetHandling.PerEntryExecution; BarsRequiredToTrade = 20; IsInstantiatedOnEachOptimizationIteration = true; + + RSIPeriod = 14; + RSISmoothing = 3; } else if (State == State.DataLoaded) { - rsi = RSI(14, 3); + rsi = RSI(RSIPeriod, RSISmoothing); } } @@ -54,5 +58,15 @@ namespace NinjaTrader.NinjaScript.Strategies { get { return Name; } } + + [NinjaScriptProperty] + [Range(1, int.MaxValue)] + [Display(Name = "RSI Period", GroupName = "RSI Divergence Bot", Order = 1)] + public int RSIPeriod { get; set; } + + [NinjaScriptProperty] + [Range(1, int.MaxValue)] + [Display(Name = "RSI Smoothing", GroupName = "RSI Divergence Bot", Order = 2)] + public int RSISmoothing { get; set; } } }