Download MetaTrader 5
To add comments, please log in or register
Use the Pocket to paste your content. It is convenient!
maindoor
120
maindoor 2014.05.29 06:34 

Hi,

Lets say we have something like this: 

void OnChartEvent(const int id,         // Event identifier  
                  const long& lparam,   // Event parameter of long type
                  const double& dparam, // Event parameter of double type
                  const string& sparam) // Event parameter of string type
  {
//--- the left mouse button has been pressed on the chart
   if(id==CHARTEVENT_CLICK)
     {
      Print("The coordinates of the mouse click on the chart are: x = ",lparam,"  y = ",dparam);
     }
//--- the mouse has been clicked on the graphic object
   if(id==CHARTEVENT_OBJECT_CLICK)
     {
      Print("The mouse has been clicked on the object with name '"+sparam+"'");
     } 

   

 How do I convert sparam to a variable of type MQLrates when I click on a candle ?

Alain Verleyen
Moderator
28701
Alain Verleyen 2014.05.29 16:17  
maindoor:

Hi,

Lets say we have something like this: 

   

 How do I convert sparam to a variable of type MQLrates when I click on a candle ?

A candle is not an object. You can do that this way.
/
To add comments, please log in or register