Download MetaTrader 5

Expert Advisers

To add comments, please log in or register
Do you know that MQL5 can create custom graphical tools?
Duilopeia
15
Duilopeia 2016.09.20 23:52 
How to write a program code for a EA, to uncheck an ' Allow Live Trading ' box on the EA Common Settings window ( but not on the Platform Trade Permissions), whenever the Net Balance falls to a level, that you want it to disable opening trades. But checks the box back again, whenever the Net Balance has recovered, so that it can resume to opening trades?
Biantoro Kunarto
14896
Biantoro Kunarto 2016.09.21 05:24  

Instead of do check or uncheck, you can use this code in the EA

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
   {
      double MinimumLevel  = 1000;
      if ( AccountBalance() < Minimum Level ) 
         return;
   }
Duilopeia
15
Duilopeia 2016.09.21 17:29  
Biantoro Kunarto:

Instead of do check or uncheck, you can use this code in the EA

Is that simple? Thank you!
Biantoro Kunarto
14896
Biantoro Kunarto 2016.10.04 04:56  
You're welcome
To add comments, please log in or register