I used to work for NEC. The topic was Telephone Central Offices -- and the required software/firmware to run such a beast
that might service up to 100,000 subscriber lines, interconnect with other local or long distance offices, maybe implement
Signalling System #7 and ISDN protocols.
One lesson I learned there was:
'Software is never complete. You just tell the Customer it is"
the start() function is called at each tick.
now I can "stop" the EA by simply exiting start() before it got a chance to do anything else. however, this is not very safe. some condition (e.g. closing and re-opening mt4) might re-initialize the ea and it might "start" running again.
hence, there are situations where programmatically removing the ea might be a good idea. as far as i know, if this can be done at all, then only at the level of indows calls (winuser32.mqh & more).
That's why all experts need a persistence layer. If done properly then expert will resume exact previous state - remain 'disabled'.
p.s. removal via WinAPI call -> https://www.mql5.com/en/forum/120736.
As I needed this information, I put the one I found.
To exit from an EA by programming in MT4, we can use the function :
if (my_Exit_EA_Condition == true ) ExpertRemove();
After that if the OnDeinit () function exists, it is executed and the EA stops
-------------- En Français ---------------------------
Comme j'ai eu besoin de cette information, je mets celle que j'ai trouvée.
Pour sortir d'un EA en programmant dans MT4, on peut utiliser la fonction:
if (my_Exit_EA_Condition == true) ExpertRemove ();
Après cela, si la fonction OnDeinit () existe, elle est exécutée et l' EA s’arrête
Please enable the necessary setting in your browser, otherwise you will not be able to log in.