Arrow not drawn

 

Hi

I have an indicator that should draw arrows on the chart at MA-crossover.

The code that should do the arrow work is at lines 112-131. Indicator is attached.

What should be changed in the code?

Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Drawing Styles
Documentation on MQL5: Constants, Enumerations and Structures / Indicator Constants / Drawing Styles
  • www.mql5.com
When creating a custom indicator, you can specify one of 18 types of graphical plotting (as displayed in the main chart window or a chart subwindow), whose values are specified in the ENUM_DRAW_TYPE enumeration. Depending on the drawing style, you may need one to four value buffers (marked as INDICATOR_DATA). If a style admits dynamic...
 
marketcycle17 :

Hi

I have an indicator that should draw arrows on the chart at MA-crossover.

The code that should do the arrow work is at lines 112-128. Indicator is attached.

What should be changed in the code?

Explore: help - learn how to get data from an indicator (help: iMA )

See sample: Intersection two iMA Text

 
marketcycle17: I have an indicator that should draw arrows on the chart at MA-crossover.
   for(int i=1;i<rates_total;i++)
     {   //Buy-signal arrow
        if ((ma1[0] > ma2[0]) && (ma1[1] < ma2[1]) && (ma1[0] > ma2[1]) && (ma2[0] > ma2[1]))
        {
          ArrowBufferUp[i]=low[i];
You are looking at the current and previous bar and then drawing arrows on all bars.
Reason: