Add SuperSmoother period property to SuperBot strategy

This commit is contained in:
moshferatu 2025-01-03 08:57:12 -08:00
parent f3d422af79
commit 947cfead17

View File

@ -1,6 +1,7 @@
#region Using declarations
using NinjaTrader.Cbi;
using NinjaTrader.NinjaScript.Indicators;
using System.ComponentModel.DataAnnotations;
#endregion
namespace NinjaTrader.NinjaScript.Strategies
@ -17,10 +18,12 @@ namespace NinjaTrader.NinjaScript.Strategies
Description = @"Strategy based on John F. Ehlers' SuperSmoother";
Calculate = Calculate.OnBarClose;
EntriesPerDirection = 1;
SuperSmootherPeriod = 10;
}
else if (State == State.Configure)
{
superSmoother = SuperSmoother(10);
superSmoother = SuperSmoother(SuperSmootherPeriod);
}
}
@ -45,5 +48,9 @@ namespace NinjaTrader.NinjaScript.Strategies
{
get { return Name; }
}
[NinjaScriptProperty]
[Display(Name = "SuperSmoother Period", GroupName = "SuperBot", Order = 1)]
public int SuperSmootherPeriod { get; set; }
}
}