i have been trying to create an indicator that would draw an arrow below the low of every bar as long as two moving averages are increasing, and an arrow above the high of the bar if the two moving averages are decreasing. if neither is the case, it shouldn't plot anything.
i'm having trouble getting the indicator to evaluate for multiple conditions and haven't been able to find a command for - no plot - either. if anyone knows how to get this simple idea to work i would greatly appreciate it. thanks.
[INDENT][INDENT]IsOverlay = true; DisplayInDataBox = true; DrawOnPricePanel = true; DrawHorizontalGridLines = true; DrawVerticalGridLines = true; PaintPriceMarkers = true; ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right; [/INDENT][/INDENT]//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; Pesma = 30; Peema = 30; Dtau = 8; Dtad = 8; AddPlot(new Stroke(Brushes.DarkBlue, 2), PlotStyle.TriangleUp, "Iup"); AddPlot(new Stroke(Brushes.DarkRed, 2), PlotStyle.TriangleDown, "Ido"); } else if (State == State.Configure) { } } protected override void OnBarUpdate() { double smav = SMA(Pesma)[0]; double emav = EMA(Peema)[0]; Smas[0] = smav; Emas[0] = emav; Plots[0].Width = 4; Plots[1].Width = 4; if ( (Smas[0]) > (Smas[1]) && (Emas[0]) > (Emas[1]) ) { Draw.ArrowUp(this, "iup", true, 0, Low[1] - (Dtau * TickSize), Brushes.DarkBlue); } else if ( (Smas[0]) < (Smas[1]) && (Emas[0]) < (Emas[1]) ) { Draw.ArrowUp(this, "ido", true, 0, High[1] + (Dttad * TickSize), Brushes.DarkRed); } else { - ¿ No plot ? - }
Comment