How to close and EA immediately from a function that is out of my EA?

 

I know there is the function OnDeInit(int) on my EA.

But I have an important security control in a MQH file.

I'd like to close my EA immediately, but, when I'm processing a function that is outside of my EA. It is in a .mqh file.

In this context, I can not call OnDeInit. Is there an option for it? 

 Regards 

 
humbertobrandao:

I know there is the function OnDeInit(int) on my EA.

But I have an important security control in a MQH file.

I'd like to close my EA immediately, but, when I'm processing a function that is outside of my EA. It is in a .mqh file.

In this context, I can not call OnDeInit. Is there an option for it? 

 Regards 

ExpertRemove(). Plus you can call OnDeinit() from any part of your code also.
Reason: