protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Indicator here."; Name = "AdxSlope"; Calculate = Calculate.OnBarClose; IsOverlay = false; DisplayInDataBox = true; DrawOnPricePanel = true; DrawHorizontalGridLines = true; DrawVerticalGridLines = true; PaintPriceMarkers = true; ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right; //Disable this property if your indicator requires custom values that cumulate with each new market data event. //See Help Guide for additional information. IsSuspendedWhileInactive = true; Period = 14; SlopePeriod = 3; AddLine(Brushes.LightGray, 0, "AdxSlopeZeroLine"); } else if (State == State.Configure) { AddLine(Threshold < 0 ? Brushes.Red : Brushes.Green, Threshold, "AdxSlopeThresholdLine"); AddPlot(Brushes.DarkCyan, "AdxSlope"); adxIndicator = ADX(Period); } }
protected override void OnStateChange() { if (State == State.SetDefaults) { Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionADXR; Name = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameADXR; IsSuspendedWhileInactive = true; Period = 14; Interval = 10; AddPlot(Brushes.DarkCyan, NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameADXR); AddLine(Brushes.SlateBlue, 25, NinjaTrader.Custom.Resource.NinjaScriptIndicatorLower); AddLine(Brushes.Goldenrod, 75, NinjaTrader.Custom.Resource.NinjaScriptIndicatorUpper); } else if (State == State.DataLoaded) { adx = ADX(Period); } }