From 94777dfdf5e76cc50b1e63ac729673acca420116 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Mon, 22 Jul 2024 06:10:36 -0700 Subject: [PATCH] Remove brush properties from Know Sure Thing constructor --- indicators/KnowSureThing.cs | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/indicators/KnowSureThing.cs b/indicators/KnowSureThing.cs index 87ec547..664134d 100644 --- a/indicators/KnowSureThing.cs +++ b/indicators/KnowSureThing.cs @@ -196,13 +196,11 @@ namespace NinjaTrader.NinjaScript.Indicators public int W4 { get; set; } - [NinjaScriptProperty] [XmlIgnore] [Display(Name = "Positive Value", Description = "Color of positive values", Order = 1, GroupName = "Visual")] public Brush PositiveValue { get; set; } - [NinjaScriptProperty] [XmlIgnore] [Display(Name = "Negative Value", Description = "Color of negative values", Order = 2, GroupName = "Visual")] public Brush NegativeValue @@ -232,9 +230,7 @@ namespace NinjaTrader.NinjaScript.Strategies Indicators.KnowSureThing.DefaultW1, Indicators.KnowSureThing.DefaultW2, Indicators.KnowSureThing.DefaultW3, - Indicators.KnowSureThing.DefaultW4, - Indicators.KnowSureThing.DefaultPositiveValue, - Indicators.KnowSureThing.DefaultNegativeValue + Indicators.KnowSureThing.DefaultW4 ); } } @@ -247,18 +243,18 @@ namespace NinjaTrader.NinjaScript.Indicators public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase { private KnowSureThing[] cacheKnowSureThing; - public KnowSureThing KnowSureThing(int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4, Brush positiveValue, Brush negativeValue) + public KnowSureThing KnowSureThing(int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4) { - return KnowSureThing(Input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4, positiveValue, negativeValue); + return KnowSureThing(Input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4); } - public KnowSureThing KnowSureThing(ISeries input, int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4, Brush positiveValue, Brush negativeValue) + public KnowSureThing KnowSureThing(ISeries input, int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4) { if (cacheKnowSureThing != null) for (int idx = 0; idx < cacheKnowSureThing.Length; idx++) - if (cacheKnowSureThing[idx] != null && cacheKnowSureThing[idx].RoC1 == roC1 && cacheKnowSureThing[idx].RoC2 == roC2 && cacheKnowSureThing[idx].RoC3 == roC3 && cacheKnowSureThing[idx].RoC4 == roC4 && cacheKnowSureThing[idx].MA1 == mA1 && cacheKnowSureThing[idx].MA2 == mA2 && cacheKnowSureThing[idx].MA3 == mA3 && cacheKnowSureThing[idx].MA4 == mA4 && cacheKnowSureThing[idx].EMAPeriod == eMAPeriod && cacheKnowSureThing[idx].W1 == w1 && cacheKnowSureThing[idx].W2 == w2 && cacheKnowSureThing[idx].W3 == w3 && cacheKnowSureThing[idx].W4 == w4 && cacheKnowSureThing[idx].PositiveValue == positiveValue && cacheKnowSureThing[idx].NegativeValue == negativeValue && cacheKnowSureThing[idx].EqualsInput(input)) + if (cacheKnowSureThing[idx] != null && cacheKnowSureThing[idx].RoC1 == roC1 && cacheKnowSureThing[idx].RoC2 == roC2 && cacheKnowSureThing[idx].RoC3 == roC3 && cacheKnowSureThing[idx].RoC4 == roC4 && cacheKnowSureThing[idx].MA1 == mA1 && cacheKnowSureThing[idx].MA2 == mA2 && cacheKnowSureThing[idx].MA3 == mA3 && cacheKnowSureThing[idx].MA4 == mA4 && cacheKnowSureThing[idx].EMAPeriod == eMAPeriod && cacheKnowSureThing[idx].W1 == w1 && cacheKnowSureThing[idx].W2 == w2 && cacheKnowSureThing[idx].W3 == w3 && cacheKnowSureThing[idx].W4 == w4 && cacheKnowSureThing[idx].EqualsInput(input)) return cacheKnowSureThing[idx]; - return CacheIndicator(new KnowSureThing(){ RoC1 = roC1, RoC2 = roC2, RoC3 = roC3, RoC4 = roC4, MA1 = mA1, MA2 = mA2, MA3 = mA3, MA4 = mA4, EMAPeriod = eMAPeriod, W1 = w1, W2 = w2, W3 = w3, W4 = w4, PositiveValue = positiveValue, NegativeValue = negativeValue }, input, ref cacheKnowSureThing); + return CacheIndicator(new KnowSureThing(){ RoC1 = roC1, RoC2 = roC2, RoC3 = roC3, RoC4 = roC4, MA1 = mA1, MA2 = mA2, MA3 = mA3, MA4 = mA4, EMAPeriod = eMAPeriod, W1 = w1, W2 = w2, W3 = w3, W4 = w4 }, input, ref cacheKnowSureThing); } } } @@ -267,14 +263,14 @@ namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns { public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase { - public Indicators.KnowSureThing KnowSureThing(int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4, Brush positiveValue, Brush negativeValue) + public Indicators.KnowSureThing KnowSureThing(int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4) { - return indicator.KnowSureThing(Input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4, positiveValue, negativeValue); + return indicator.KnowSureThing(Input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4); } - public Indicators.KnowSureThing KnowSureThing(ISeries input , int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4, Brush positiveValue, Brush negativeValue) + public Indicators.KnowSureThing KnowSureThing(ISeries input , int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4) { - return indicator.KnowSureThing(input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4, positiveValue, negativeValue); + return indicator.KnowSureThing(input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4); } } } @@ -283,14 +279,14 @@ namespace NinjaTrader.NinjaScript.Strategies { public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase { - public Indicators.KnowSureThing KnowSureThing(int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4, Brush positiveValue, Brush negativeValue) + public Indicators.KnowSureThing KnowSureThing(int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4) { - return indicator.KnowSureThing(Input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4, positiveValue, negativeValue); + return indicator.KnowSureThing(Input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4); } - public Indicators.KnowSureThing KnowSureThing(ISeries input , int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4, Brush positiveValue, Brush negativeValue) + public Indicators.KnowSureThing KnowSureThing(ISeries input , int roC1, int roC2, int roC3, int roC4, int mA1, int mA2, int mA3, int mA4, int eMAPeriod, int w1, int w2, int w3, int w4) { - return indicator.KnowSureThing(input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4, positiveValue, negativeValue); + return indicator.KnowSureThing(input, roC1, roC2, roC3, roC4, mA1, mA2, mA3, mA4, eMAPeriod, w1, w2, w3, w4); } } }