people with nt,
regards. i hope everything is going good.
i have created a very simple indicator that would calculate and plot the average of the close minus the open for n periods. i really want two indicators that will use this structure as a starting point to report this average in terms of ticks and monetary value. that last part is extremely easy if one uses Instrument.MasterInstrument.TickSize and Instrument.MasterInstrument.PointValue, however this indicator below will compile without problem but then will not plot or calculate everything.
public class simpleaverage : Indicator { private Series<double> clmiop; private SMA siavrasma; protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"simple average."; Name = "simpleaverage"; 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; AddLine(Brushes.Blue, 3, "Simpleaveragerangel"); } else if (State == State.Configure) { } else if (State == State.DataLoaded) { himilo = new Series<double>(this); siavrasma = SMA(clmiop, Period); } } protected override void OnBarUpdate() { if (CurrentBar < ( Period + 2 ) ) return; clmiop[0] = ( ( Close[0] - Open[0] ) ); double siavrava = siavrasma[0]; Value[0] = siavrava; }
i have tried several different things i have thought of to fix this but nothing has worked so far. ¿could the people with nt support help me with this indicator? thanks.
Comment