Expert Advisers

 
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?
 

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;
   }
 
Biantoro Kunarto:

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

Is that simple? Thank you!
 
You're welcome
Reason: