Download MetaTrader 5

lanch a script by click-event (or other user-actions)

To add comments, please log in or register
Read the Forum and improve your rating!
Francis
23
Francis 2015.10.26 01:14 
(Please, some patience because I just started in MQL.)
On the chart I put an OBJ_BITMAP_LABEL, which has two states: on and off. When I click the image changes (img1 in img2 or img2 in img1), and so on.
But the key-thing for me is: how to launch a script when I click?
I searched the internet but I found nothing.
Thank Guys

Francis

 

 

Keith Watford
Moderator
9604
Keith Watford 2015.10.26 03:27  
   if(sparam=="Reset Button" && ObjectGetInteger(0,"Reset Button",OBJPROP_STATE)==true)
     {
      if(ReSet())
      ObjectSetInteger(0,"Reset Button",OBJPROP_STATE,false);
     }

Here's an example of what I do in OnChartEvent (Object Clicked) with a button object.

The function ReSet()  returns a bool when complete and so the button is un-clicked automatically. 

To add comments, please log in or register