Happy New Year to everyone!
I want to turn off auto-trading from within my mql4 ea when a target equity is reached. I know there is a mql4 function to do this but I can not find it. I tried searching with no success.
I would appreciate if someone can tell me where I find some documentation or example.
Thanks.
Not my knowledge. You can find out if AutoTrading is enabled:
TerminalInfoInteger(TERMINAL_TRADE_ALLOWED);
You can also remove an EA from your chart:
ExpertRemove();
Even more extreme, you can also force your terminal to close:
TerminalClose(1);
But it may be better to code your EA so that it doesn't trade if your equity is above a certain level using
AccountEquity();
Depending on what your EA is doing, you can run this check before a trade is placed, or at the start of OnTick().
Hope that helps.
Not my knowledge. You can find out if AutoTrading is enabled:
You can also remove an EA from your chart:
Even more extreme, you can also force your terminal to close:
But it may be better to code your EA so that it doesn't trade if your equity is above a certain level using
Depending on what your EA is doing, you can run this check before a trade is placed, or at the start of OnTick().
Hope that helps.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Happy New Year to everyone!
I want to turn off auto-trading from within my mql4 ea when a target equity is reached. I know there is a mql4 function to do this but I can not find it. I tried searching with no success.
I would appreciate if someone can tell me where I find some documentation or example.
Thanks.