Remove region color and opacity from indicator input parameters

This commit is contained in:
moshferatu 2024-06-05 08:16:05 -07:00
parent 72cc25ec22
commit b28f81ea2f

View File

@ -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<double> input, int period, Brush regionColor, double regionOpacity)
public SonicRDragon SonicRDragon(ISeries<double> 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<SonicRDragon>(new SonicRDragon(){ Period = period, RegionColor = regionColor, RegionOpacity = regionOpacity }, input, ref cacheSonicRDragon);
return CacheIndicator<SonicRDragon>(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<double> input , int period, Brush regionColor, double regionOpacity)
public Indicators.SonicRDragon SonicRDragon(ISeries<double> 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<double> input , int period, Brush regionColor, double regionOpacity)
public Indicators.SonicRDragon SonicRDragon(ISeries<double> input , int period)
{
return indicator.SonicRDragon(input, period, regionColor, regionOpacity);
return indicator.SonicRDragon(input, period);
}
}
}