identify Mouse(press or release) on chart objects

 

identify Mouse(press or release) on chart objects

Is it possible with MQL5?

example: identify left mouse click (only press) on object trendline.
 
FinGeR:

identify Mouse(press or release) on chart objects

Is it possible with MQL5?

example: identify left mouse click (only press) on object trendline.

void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   switch(id)
     {
      case CHARTEVENT_CLICK:
         Print(__FUNCTION__,"; CHARTEVENT_CLICK");break;
      case CHARTEVENT_OBJECT_CLICK:
         Print(__FUNCTION__,"; CHARTEVENT_OBJECT_CLICK");break;
     }
  }
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events
  • www.mql5.com
Standard Constants, Enumerations and Structures / Chart Constants / Types of Chart Events - Documentation on MQL5
 

Sorry,  only press:

void OnInit()
  {
   ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,true);
  }
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   switch(id)
     {
      case CHARTEVENT_MOUSE_MOVE:
         Print(__FUNCTION__,"; CHARTEVENT_MOUSE_MOVE; sparam= ",sparam);break;
     }
  }
//+------------------------------------------------------------------+

 sparam=1 - pressing the left key

sparam=2 -  pressing the right key

 
Thanks.
Reason: