Exit from an EA

 

Is there an equivalent to the C exit command in mql5?

the nearest thing I have found is the  ExpertRemove command but when I try to use that I get a compiler error saying the function doesn't have a type.

could anyone enlighten me please?

 

 

 

Steve. 

 
It's the correct function so can you show how you use it ?
 

ExpertRemove() is working fine in MT5. You can use it only in Expert Advisors.

If you are coding a Script, you just have to use return; inside OnStart() function.

And if you are coding a Custom Indicator you can use ChartIndicatorDelete() function.

Regards.

Documentation on MQL5: Common Functions / ExpertRemove
Documentation on MQL5: Common Functions / ExpertRemove
  • www.mql5.com
Common Functions / ExpertRemove - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: