I have a custom indicator, that doesn't seem to display certain parameters when I call it in the Strategy Builder.
Forgive me since I'm not a C# developer, I only code HTML and CSS.
When a Pivot Low(pivoth), or High (pivotl), is printed on the indicator, a triangle is drawn with text, I would like to be able to use that in a strategy, so that if a Pivot Low/High is printed, then do this (Go long, for example).
I was able to get the "length" as an integer (range) to display in Strategy Builder, but not Pivot.... I'm guessing this would be a boolean? So, in Strat Builder I could use it as, if pivoth = true, then do this.
I have highlighted the areas I think are important in bold for your convenience.
I've been banging my head against the wall for a few days, because I'm not a C# coder.
Hope someone can help!
Thanks in advance!
namespace NinjaTrader.NinjaScript.Indicators { public class RSIPlus: Indicator { private Series<double> max; private Series<double> max_rsi; private Series<double> min; private Series<double> min_rsi; private Series<double> src; private Series<double> rsiplus; private Series<bool> divbear; private Series<bool> divbull; [B]private Series<bool> pivoth; private Series<bool> pivotl;[/B] protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"RSIPlus"; Name = "RSIPlus"; Calculate = Calculate.OnBarClose; IsSuspendedWhileInactive = true; DrawOnPricePanel = false; IsOverlay = false; length = 14; [B]piv = true;[/B] [B]PivotColor = Brushes.Blue;[/B] BullColor = Brushes.Green; BearColor = Brushes.Red; // CODE REDACTED [B]pivoth[0] = false; pivotl[0] = false;[/B] divbear[0] = false; divbull[0] = false; // CODE REDACTED pivoth[0] = (Math.Abs(max_rsi[0] - max_rsi[2]) < 0.000001) && (Math.Abs(max_rsi[2] - max_rsi[3]) > 0.00001) && CurrentBar > barsBegin; pivotl[0] = (Math.Abs(min_rsi[0] - min_rsi[2]) < 0.000001) && (Math.Abs(min_rsi[2] - min_rsi[3]) > 0.00001) && CurrentBar > barsBegin; // CODE REDACTED [B]if (piv) {[/B] [B]if (pivoth[0]) { Draw.Text(this, "tag" + tagCounter++, true, "Pivot", 2, max_rsi[0] + 1, offset, PivotColor, new SimpleFont("Time new roman", 10), TextAlignment.Center, nullColor, PivotColor, 0); //Draw.Triangle(this, "tag" + tagCounter++, true,3, max_rsi[0] - 3, 2, max_rsi[0] - 1, 1, max_rsi[0] - 3, PivotColor, PivotColor, 1000); Draw.TriangleDown(this, "tag" + tagCounter++, true, 2, max_rsi[0] + 1, PivotColor); } if (pivotl[0]) { Draw.Text(this, "tag" + tagCounter++, true, "Pivot", 2, min_rsi[0] - 1, -offset, PivotColor, new SimpleFont("Time new roman", 10), TextAlignment.Center, nullColor, PivotColor, 0); //Draw.Triangle(this, "tag" + tagCounter++, true,3, min_rsi[0] + 3, 2, min_rsi[0] + 1, 1, min_rsi[0] + 3, PivotColor, PivotColor, 100); Draw.TriangleUp(this, "tag" + tagCounter++, true, 2, min_rsi[0] - 1, PivotColor);[/B] } // CODE REDACTED #region Properties [Browsable(false)] [XmlIgnore()] public Series<double> Default { get { return Values[0]; } } [Range(1, int.MaxValue), NinjaScriptProperty] [Display(ResourceType = typeof(Custom.Resource), Name = "length", GroupName = "NinjaScriptParameters", Order = 0)] public int length { get; set; } [B][Display(Name = "piv", GroupName = "NinjaScriptParameters", Order = 4)] public bool piv { get; set; }[/B]
Comment