Call OnDeinit when exiting Mt5
Hi,
I've written and EA that dynamically open charts and templates. The EA includes OnDeInit() which closes the open charts. This function works fine if the EA is removed manually, but doesn't get called when exiting MT5 via file->exit or 'x'. If I forget to remove the EA, I get stuck with a number of orphan charts on next startup.
Is there any technique to trigger the system to call OnDeInit() when exiting the system, or some other method?
Thanks
I don't think there is, but you could write some code in the OnInit() so when the EA restarts it repeats the clean-up process you want to invoke.
Don't open charts that already exist.
Hi,
I've written and EA that dynamically open charts and templates. The EA includes OnDeInit() which closes the open charts. This function works fine if the EA is removed manually, but doesn't get called when exiting MT5 via file->exit or 'x'. If I forget to remove the EA, I get stuck with a number of orphan charts on next startup.
Is there any technique to trigger the system to call OnDeInit() when exiting the system, or some other method?
Thanks