From b28f81ea2fbb00817a9bb839bda90e18b5d91fdc Mon Sep 17 00:00:00 2001 From: moshferatu Date: Wed, 5 Jun 2024 08:16:05 -0700 Subject: [PATCH] Remove region color and opacity from indicator input parameters --- indicators/SonicRDragon.cs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/indicators/SonicRDragon.cs b/indicators/SonicRDragon.cs index d87709e..6778829 100644 --- a/indicators/SonicRDragon.cs +++ b/indicators/SonicRDragon.cs @@ -306,7 +306,6 @@ namespace NinjaTrader.NinjaScript.Indicators [Display(Name = "Period", Description = "Period for the EMA", Order = 1, GroupName = "Sonic R Dragon")] public int Period { get; set; } - [NinjaScriptProperty] [XmlIgnore] [Display(Name = "Region Color", Description = "Color of the region between the EMAs of highs and lows", Order = 2, GroupName = "Sonic R Dragon")] public Brush RegionColor { get; set; } @@ -318,7 +317,6 @@ namespace NinjaTrader.NinjaScript.Indicators set { RegionColor = Serialize.StringToBrush(value); } } - [NinjaScriptProperty] [Range(0, 1)] [Display(Name = "Region Opacity", Description = "Opacity of the region", Order = 3, GroupName = "Sonic R Dragon")] public double RegionOpacity { get; set; } @@ -333,18 +331,18 @@ namespace NinjaTrader.NinjaScript.Indicators public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase { private SonicRDragon[] cacheSonicRDragon; - public SonicRDragon SonicRDragon(int period, Brush regionColor, double regionOpacity) + public SonicRDragon SonicRDragon(int period) { - return SonicRDragon(Input, period, regionColor, regionOpacity); + return SonicRDragon(Input, period); } - public SonicRDragon SonicRDragon(ISeries input, int period, Brush regionColor, double regionOpacity) + public SonicRDragon SonicRDragon(ISeries input, int period) { if (cacheSonicRDragon != null) for (int idx = 0; idx < cacheSonicRDragon.Length; idx++) - if (cacheSonicRDragon[idx] != null && cacheSonicRDragon[idx].Period == period && cacheSonicRDragon[idx].RegionColor == regionColor && cacheSonicRDragon[idx].RegionOpacity == regionOpacity && cacheSonicRDragon[idx].EqualsInput(input)) + if (cacheSonicRDragon[idx] != null && cacheSonicRDragon[idx].Period == period && cacheSonicRDragon[idx].EqualsInput(input)) return cacheSonicRDragon[idx]; - return CacheIndicator(new SonicRDragon(){ Period = period, RegionColor = regionColor, RegionOpacity = regionOpacity }, input, ref cacheSonicRDragon); + return CacheIndicator(new SonicRDragon(){ Period = period }, input, ref cacheSonicRDragon); } } } @@ -353,14 +351,14 @@ namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns { public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase { - public Indicators.SonicRDragon SonicRDragon(int period, Brush regionColor, double regionOpacity) + public Indicators.SonicRDragon SonicRDragon(int period) { - return indicator.SonicRDragon(Input, period, regionColor, regionOpacity); + return indicator.SonicRDragon(Input, period); } - public Indicators.SonicRDragon SonicRDragon(ISeries input , int period, Brush regionColor, double regionOpacity) + public Indicators.SonicRDragon SonicRDragon(ISeries input , int period) { - return indicator.SonicRDragon(input, period, regionColor, regionOpacity); + return indicator.SonicRDragon(input, period); } } } @@ -369,14 +367,14 @@ namespace NinjaTrader.NinjaScript.Strategies { public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase { - public Indicators.SonicRDragon SonicRDragon(int period, Brush regionColor, double regionOpacity) + public Indicators.SonicRDragon SonicRDragon(int period) { - return indicator.SonicRDragon(Input, period, regionColor, regionOpacity); + return indicator.SonicRDragon(Input, period); } - public Indicators.SonicRDragon SonicRDragon(ISeries input , int period, Brush regionColor, double regionOpacity) + public Indicators.SonicRDragon SonicRDragon(ISeries input , int period) { - return indicator.SonicRDragon(input, period, regionColor, regionOpacity); + return indicator.SonicRDragon(input, period); } } }