Arrow does not display

bodojan468
58
bodojan468  

Hi everybody,

I'm learning MQL5 coding and now I'm trying to add arrows to an indicator. I used this code

#property indicator_chart_window

#property indicator_buffers 4
#property indicator_plots   3

//--- Line
#property indicator_label1  "MA"
#property indicator_type1   DRAW_COLOR_LINE
#property indicator_color1  clrLimeGreen,clrOrange
#property indicator_style1  STYLE_SOLID
#property indicator_width1  2

//--- Arrows
#property indicator_label2  "Sell Signal (2)"
#property indicator_type2   DRAW_ARROW
#property indicator_color2  clrGold
#property indicator_width2  2

#property indicator_label3 "Buy Signal (3)"
#property indicator_type3   DRAW_ARROW
#property indicator_color3  clrMagenta
#property indicator_width3  2


double MaBuffer[], ColorBuffer[];double CrossUp[],CrossDn[];
int OnInit()
  {
    SetIndexBuffer(0,MaBuffer,INDICATOR_DATA);   
    SetIndexBuffer(1,ColorBuffer,INDICATOR_COLOR_INDEX);
    SetIndexBuffer(2,crossDn,INDICATOR_DATA);  
    SetIndexBuffer(3,crossUp,INDICATOR_DATA);  
   
    PlotIndexSetInteger(2,PLOT_ARROW,241);
    PlotIndexSetInteger(2,PLOT_ARROW_SHIFT,5);
    PlotIndexSetInteger(3,PLOT_ARROW,242);
    PlotIndexSetInteger(3,PLOT_ARROW_SHIFT,5);

   return(INIT_SUCCEEDED);
  }
// .....

I tried to figure out why the second arrow does not display.Instead,  I have a dot  as you can see on the picture

Someone can tell what I'm doing wrong  please?

Files:
arrow_bug.JPG 192 kb