Can I quit MQL4 processing and run a Function imediately

To add comments, please log in or register
Mike Tanton
533
Mike Tanton  

Hi Guys...

Was just wondering if there is a way to "run" a Function immediately.... 

ie. If I 'Click' on a Chart 'Button'.... can I tell Mql4 to 'Stop" processing what it is doing and run the Function that I want it to run.... 

...if that makes any sense....

...is there a Function that just "Stops" the processing....

Biantoro Kunarto
22107
Biantoro Kunarto  
MikeT:

Hi Guys...

Was just wondering if there is a way to "run" a Function immediately.... 

ie. If I 'Click' on a Chart 'Button'.... can I tell Mql4 to 'Stop" processing what it is doing and run the Function that I want it to run.... 

...if that makes any sense....

...is there a Function that just "Stops" the processing....

You can use this :

//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
 {
   if (id == CHARTEVENT_OBJECT_CLICK)
      {
         if (sparam == "Your Button Name" )
            {
                //Your Function 
            }
      }
 }
To add comments, please log in or register