Unload an EA through code

 

Greetings,


How would I code an EA to shut down (or simply "stop") when a criteria is met?

TerminalClose() is not suitable since it shuts down MT - divide by zero is not to nice either..


Blessings,

Martin 

 
Sven Martin Zeke Persson: How would I code an EA to shut down (or simply "stop") when a criteria is met? TerminalClose() is not suitable since it shuts down MT - divide by zero is not to nice either..

ExpertRemove

The function stops an Expert Advisor and unloads it from a chart.

void  ExpertRemove();

Please folow the link and read the documentation for more details!
Documentation on MQL5: Common Functions / ExpertRemove
Documentation on MQL5: Common Functions / ExpertRemove
  • www.mql5.com
ExpertRemove - Common Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Fernando Carreiro:

ExpertRemove

The function stops an Expert Advisor and unloads it from a chart.


Please folow the link and read the documentation for more details!

Much appreciated.