Re-organize configuration properties

This commit is contained in:
moshferatu 2023-11-13 05:58:56 -08:00
parent c4b4868a7f
commit 7a8df23acd

View File

@ -262,31 +262,31 @@ namespace NinjaTrader.NinjaScript.Indicators
[NinjaScriptProperty] [NinjaScriptProperty]
[XmlIgnore] [XmlIgnore]
[Display(Name = "RSI Values", GroupName = "RSI Dashboard", Order = 10)] [Display(Name = "RSI Values Text", GroupName = "RSI Dashboard", Order = 10)]
public Brush RSIValuesTextColor { get; set; } public Brush RSIValuesTextColor { get; set; }
[NinjaScriptProperty]
[Display(Name = "Header Font", GroupName = "RSI Dashboard", Order = 11)]
public SimpleFont HeaderFont { get; set; }
[NinjaScriptProperty]
[Display(Name = "RSI Values Font", GroupName = "RSI Dashboard", Order = 12)]
public SimpleFont RSIValuesFont { get; set; }
[NinjaScriptProperty] [NinjaScriptProperty]
[Range(0, int.MaxValue)] [Range(0, int.MaxValue)]
[Display(Name = "Horizontal Padding", GroupName = "RSI Dashboard", Order = 13)] [Display(Name = "Horizontal Padding", GroupName = "RSI Dashboard", Order = 11)]
public int HorizontalPadding { get; set; } public int HorizontalPadding { get; set; }
[NinjaScriptProperty] [NinjaScriptProperty]
[Range(0, int.MaxValue)] [Range(0, int.MaxValue)]
[Display(Name = "Vertical Padding", GroupName = "RSI Dashboard", Order = 14)] [Display(Name = "Vertical Padding", GroupName = "RSI Dashboard", Order = 12)]
public int VerticalPadding { get; set; } public int VerticalPadding { get; set; }
[NinjaScriptProperty] [NinjaScriptProperty]
[Range(0, int.MaxValue)] [Range(0, int.MaxValue)]
[Display(Name = "Y-Offset", GroupName = "RSI Dashboard", Order = 17)] [Display(Name = "Y-Offset", GroupName = "RSI Dashboard", Order = 13)]
public int YOffset { get; set; } public int YOffset { get; set; }
[NinjaScriptProperty]
[Display(Name = "Header Font", GroupName = "RSI Dashboard", Order = 14)]
public SimpleFont HeaderFont { get; set; }
[NinjaScriptProperty]
[Display(Name = "RSI Values Font", GroupName = "RSI Dashboard", Order = 15)]
public SimpleFont RSIValuesFont { get; set; }
#endregion #endregion
} }
} }
@ -298,18 +298,18 @@ namespace NinjaTrader.NinjaScript.Indicators
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{ {
private RSIDashboard[] cacheRSIDashboard; private RSIDashboard[] cacheRSIDashboard;
public RSIDashboard RSIDashboard(int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, SimpleFont headerFont, SimpleFont rSIValuesFont, int horizontalPadding, int verticalPadding, int yOffset) public RSIDashboard RSIDashboard(int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, int horizontalPadding, int verticalPadding, int yOffset, SimpleFont headerFont, SimpleFont rSIValuesFont)
{ {
return RSIDashboard(Input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, headerFont, rSIValuesFont, horizontalPadding, verticalPadding, yOffset); return RSIDashboard(Input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, horizontalPadding, verticalPadding, yOffset, headerFont, rSIValuesFont);
} }
public RSIDashboard RSIDashboard(ISeries<double> input, int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, SimpleFont headerFont, SimpleFont rSIValuesFont, int horizontalPadding, int verticalPadding, int yOffset) public RSIDashboard RSIDashboard(ISeries<double> input, int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, int horizontalPadding, int verticalPadding, int yOffset, SimpleFont headerFont, SimpleFont rSIValuesFont)
{ {
if (cacheRSIDashboard != null) if (cacheRSIDashboard != null)
for (int idx = 0; idx < cacheRSIDashboard.Length; idx++) for (int idx = 0; idx < cacheRSIDashboard.Length; idx++)
if (cacheRSIDashboard[idx] != null && cacheRSIDashboard[idx].RSIPeriod == rSIPeriod && cacheRSIDashboard[idx].RSISmoothing == rSISmoothing && cacheRSIDashboard[idx].UpperThreshold == upperThreshold && cacheRSIDashboard[idx].LowerThreshold == lowerThreshold && cacheRSIDashboard[idx].AboveThresholdColor == aboveThresholdColor && cacheRSIDashboard[idx].BelowThresholdColor == belowThresholdColor && cacheRSIDashboard[idx].BetweenThresholdsColor == betweenThresholdsColor && cacheRSIDashboard[idx].HeaderColor == headerColor && cacheRSIDashboard[idx].HeaderTextColor == headerTextColor && cacheRSIDashboard[idx].RSIValuesTextColor == rSIValuesTextColor && cacheRSIDashboard[idx].HeaderFont == headerFont && cacheRSIDashboard[idx].RSIValuesFont == rSIValuesFont && cacheRSIDashboard[idx].HorizontalPadding == horizontalPadding && cacheRSIDashboard[idx].VerticalPadding == verticalPadding && cacheRSIDashboard[idx].YOffset == yOffset && cacheRSIDashboard[idx].EqualsInput(input)) if (cacheRSIDashboard[idx] != null && cacheRSIDashboard[idx].RSIPeriod == rSIPeriod && cacheRSIDashboard[idx].RSISmoothing == rSISmoothing && cacheRSIDashboard[idx].UpperThreshold == upperThreshold && cacheRSIDashboard[idx].LowerThreshold == lowerThreshold && cacheRSIDashboard[idx].AboveThresholdColor == aboveThresholdColor && cacheRSIDashboard[idx].BelowThresholdColor == belowThresholdColor && cacheRSIDashboard[idx].BetweenThresholdsColor == betweenThresholdsColor && cacheRSIDashboard[idx].HeaderColor == headerColor && cacheRSIDashboard[idx].HeaderTextColor == headerTextColor && cacheRSIDashboard[idx].RSIValuesTextColor == rSIValuesTextColor && cacheRSIDashboard[idx].HorizontalPadding == horizontalPadding && cacheRSIDashboard[idx].VerticalPadding == verticalPadding && cacheRSIDashboard[idx].YOffset == yOffset && cacheRSIDashboard[idx].HeaderFont == headerFont && cacheRSIDashboard[idx].RSIValuesFont == rSIValuesFont && cacheRSIDashboard[idx].EqualsInput(input))
return cacheRSIDashboard[idx]; return cacheRSIDashboard[idx];
return CacheIndicator<RSIDashboard>(new RSIDashboard(){ RSIPeriod = rSIPeriod, RSISmoothing = rSISmoothing, UpperThreshold = upperThreshold, LowerThreshold = lowerThreshold, AboveThresholdColor = aboveThresholdColor, BelowThresholdColor = belowThresholdColor, BetweenThresholdsColor = betweenThresholdsColor, HeaderColor = headerColor, HeaderTextColor = headerTextColor, RSIValuesTextColor = rSIValuesTextColor, HeaderFont = headerFont, RSIValuesFont = rSIValuesFont, HorizontalPadding = horizontalPadding, VerticalPadding = verticalPadding, YOffset = yOffset }, input, ref cacheRSIDashboard); return CacheIndicator<RSIDashboard>(new RSIDashboard(){ RSIPeriod = rSIPeriod, RSISmoothing = rSISmoothing, UpperThreshold = upperThreshold, LowerThreshold = lowerThreshold, AboveThresholdColor = aboveThresholdColor, BelowThresholdColor = belowThresholdColor, BetweenThresholdsColor = betweenThresholdsColor, HeaderColor = headerColor, HeaderTextColor = headerTextColor, RSIValuesTextColor = rSIValuesTextColor, HorizontalPadding = horizontalPadding, VerticalPadding = verticalPadding, YOffset = yOffset, HeaderFont = headerFont, RSIValuesFont = rSIValuesFont }, input, ref cacheRSIDashboard);
} }
} }
} }
@ -318,14 +318,14 @@ namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{ {
public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
{ {
public Indicators.RSIDashboard RSIDashboard(int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, SimpleFont headerFont, SimpleFont rSIValuesFont, int horizontalPadding, int verticalPadding, int yOffset) public Indicators.RSIDashboard RSIDashboard(int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, int horizontalPadding, int verticalPadding, int yOffset, SimpleFont headerFont, SimpleFont rSIValuesFont)
{ {
return indicator.RSIDashboard(Input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, headerFont, rSIValuesFont, horizontalPadding, verticalPadding, yOffset); return indicator.RSIDashboard(Input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, horizontalPadding, verticalPadding, yOffset, headerFont, rSIValuesFont);
} }
public Indicators.RSIDashboard RSIDashboard(ISeries<double> input , int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, SimpleFont headerFont, SimpleFont rSIValuesFont, int horizontalPadding, int verticalPadding, int yOffset) public Indicators.RSIDashboard RSIDashboard(ISeries<double> input , int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, int horizontalPadding, int verticalPadding, int yOffset, SimpleFont headerFont, SimpleFont rSIValuesFont)
{ {
return indicator.RSIDashboard(input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, headerFont, rSIValuesFont, horizontalPadding, verticalPadding, yOffset); return indicator.RSIDashboard(input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, horizontalPadding, verticalPadding, yOffset, headerFont, rSIValuesFont);
} }
} }
} }
@ -334,14 +334,14 @@ namespace NinjaTrader.NinjaScript.Strategies
{ {
public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{ {
public Indicators.RSIDashboard RSIDashboard(int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, SimpleFont headerFont, SimpleFont rSIValuesFont, int horizontalPadding, int verticalPadding, int yOffset) public Indicators.RSIDashboard RSIDashboard(int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, int horizontalPadding, int verticalPadding, int yOffset, SimpleFont headerFont, SimpleFont rSIValuesFont)
{ {
return indicator.RSIDashboard(Input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, headerFont, rSIValuesFont, horizontalPadding, verticalPadding, yOffset); return indicator.RSIDashboard(Input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, horizontalPadding, verticalPadding, yOffset, headerFont, rSIValuesFont);
} }
public Indicators.RSIDashboard RSIDashboard(ISeries<double> input , int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, SimpleFont headerFont, SimpleFont rSIValuesFont, int horizontalPadding, int verticalPadding, int yOffset) public Indicators.RSIDashboard RSIDashboard(ISeries<double> input , int rSIPeriod, int rSISmoothing, double upperThreshold, double lowerThreshold, Brush aboveThresholdColor, Brush belowThresholdColor, Brush betweenThresholdsColor, Brush headerColor, Brush headerTextColor, Brush rSIValuesTextColor, int horizontalPadding, int verticalPadding, int yOffset, SimpleFont headerFont, SimpleFont rSIValuesFont)
{ {
return indicator.RSIDashboard(input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, headerFont, rSIValuesFont, horizontalPadding, verticalPadding, yOffset); return indicator.RSIDashboard(input, rSIPeriod, rSISmoothing, upperThreshold, lowerThreshold, aboveThresholdColor, belowThresholdColor, betweenThresholdsColor, headerColor, headerTextColor, rSIValuesTextColor, horizontalPadding, verticalPadding, yOffset, headerFont, rSIValuesFont);
} }
} }
} }