Download MetaTrader 5

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

To add comments, please log in or register
(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




Keith Watford
Keith Watford  
   if(sparam=="Reset Button" && ObjectGetInteger(0,"Reset Button",OBJPROP_STATE)==true)
      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