Download MetaTrader 5

HOW TO ENABLE "ALLOW LIVE TRADING" AS A CODE

To add comments, please log in or register
macpee
498
macpee  
Hi guys, how can I code that my EA should enable "ALLOW LIVE TRADING BUTTON"? Thank you in advance.
Mohamad Zulhairi Baba
7716
Mohamad Zulhairi Baba  
macpee:
Hi guys, how can I code that my EA should enable "ALLOW LIVE TRADING BUTTON"? Thank you in advance.


i believe you can't.
but you can add this code it Oninit to disable the EA if the button is not pressed.

int OnInit()
{   
   if (!IsTradeAllowed())
   {
      Alert("Please Enable Auto Trading to run the EA");
      return INIT_FAILED;
   }

   return(INIT_SUCCEEDED);
}
honest_knave
Moderator
2297
honest_knave  
Mohamad Zulhairi Baba:


i believe you can't.


Correct, there is no way to do it without using dll calls.

To add comments, please log in or register