Why CHARTEVENT_OBJECT_CLICK returns x2

 

Hi, I want to know why within the following code when I press the button CHARTEVENT_OBJECT_CLICK returns 11 instead of just 1?

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
  
   int chart_ID= 0;
   string button = "button";

   //+------------------------------------------------------------------+
   // Button
   //+------------------------------------------------------------------+
      ObjectCreate(0,button,OBJ_BUTTON,0,0,0);
      
   //--- set button coordinates 
      ObjectSetInteger(chart_ID,button,OBJPROP_XDISTANCE,150); // If 
      ObjectSetInteger(chart_ID,button,OBJPROP_YDISTANCE,50);
   //--- set button size 
      ObjectSetInteger(chart_ID,button,OBJPROP_XSIZE,100);
      ObjectSetInteger(chart_ID,button,OBJPROP_YSIZE,100);
   //--- set the chart's corner, relative to which point coordinates are defined 
      ObjectSetInteger(chart_ID,button,OBJPROP_CORNER,1);
   //--- set the text 
      ObjectSetString(chart_ID,button,OBJPROP_TEXT,"Info");
   //--- set text font 
      ObjectSetString(chart_ID,button,OBJPROP_FONT,"Arial");
   //--- set font size 
      ObjectSetInteger(chart_ID,button,OBJPROP_FONTSIZE,20);
   //--- set text color 
      ObjectSetInteger(chart_ID,button,OBJPROP_COLOR,clrGreen);
   //--- set background color 
      ObjectSetInteger(chart_ID,button,OBJPROP_BGCOLOR,clrWhite);
   //--- set border color 
      ObjectSetInteger(chart_ID,button,OBJPROP_BORDER_COLOR,clrBlack);
   //--- display in the foreground (false) or background (true) 
   //   ObjectSetInteger(chart_ID,button,OBJPROP_BACK,false);
   //--- set button state 
      ObjectSetInteger(chart_ID,button,OBJPROP_STATE,true);
   //--- enable (true) or disable (false) the mode of moving the button by mouse 
      ObjectSetInteger(chart_ID,button,OBJPROP_SELECTABLE,false);  // OBJPROP_SELECTABLE if true means i can move the button around after double clicked   
      ObjectSetInteger(chart_ID,button,OBJPROP_SELECTED,false);
   //--- hide (true) or display (false) graphical object button in the object list   // MEANING : If true it will be hidden so we have to select list   if false it will show all the time
      ObjectSetInteger(chart_ID,button,OBJPROP_HIDDEN,false);
   //--- set the priority for receiving the event of a mouse click in the chart 
      ObjectSetInteger(chart_ID,button,OBJPROP_ZORDER,0);
      
      return(INIT_SUCCEEDED);
  }

void OnChartEvent(const int id,// Recognises what event happened EG CHARTEVENT_OBJECT_CLICK
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {

   Print(CHARTEVENT_OBJECT_CLICK);
    
  }                    
 
Stephen Reynolds: I press the button CHARTEVENT_OBJECT_CLICK returns 11 instead of just 1?

Object click is apparently defined as 11. Other chart events have other numbers. Your print statement is Print(11); Why do you expect otherwise?