Download MetaTrader 5

Removing a EA when the program has an error

To add comments, please log in or register
zerosen
31
zerosen  

is there a code that would allow me to remove the program or deinit the program if there is an error?

 example:

if(GetLastError() != 0)

{  

Alert("error"); 

exit EA, de initialize

 

Also, the error would come from the program trying to put a buystop/sellstop at a point that isnt allowed to put an order. So it could also be if the order fails.  

If there is no other way, is there a way to run the EA with minimal CPU? So that it would not lag the other EA that are running in other symbols

Thanks 

Keith Watford
Moderator
10619
Keith Watford  
Look up ExpertRemove in the documentation
zerosen
31
zerosen  
GumRai:
Look up ExpertRemove in the documentation
Thanks again !!
To add comments, please log in or register