Hi all,
is possible to disable all active expert advisor in MT4 (the same of shortcut CTRL-E) from a call by an expert advisor or from a call by a script ?
I need to disable all EA's in my MT4 when a condition is reached.
Many thanks.
Netmastro
Hi all,
is possible to disable all active expert advisor in MT4 (the same of shortcut CTRL-E) from a call by an expert advisor or from a call by a script ?
I need to disable all EA's in my MT4 when a condition is reached.
Many thanks.
Netmastro
Why would you disable EA's, just set a stoptrading=true parameter included to your if statement (example ordersend function), combined with a SL reached, basket win or loss, starting and ending time and so on.
example, if you basket loss is hit, ea stops trading (no new orders) leaving the open orders open, if you recover from basket loss with the remaining open orders, stoptrading is now false and new orders can be executed.
IX
Hi Ixbone,
thanks for your quick answer.
The EA that I want to use to disable all EA's is not the same EA that open positions.
Infact the first EA works on a matched equity to close all positions, and the others work on all the the graphs opening positions.
BB
Netmastro
To make the EA become SAD Face.
You need this :
#include <WinUser32.mqh>
extern bool DisableAllEAs = TRUE;
void DisableEA() {
keybd_event(17, 0, 0, 0);
keybd_event(69, 0, 0, 0);
keybd_event(69, 0, 2, 0);
keybd_event(17, 0, 2, 0);
}
int start() {
if (DisableAllEAs == TRUE) {
DisableEA();
return (0);
}
.
.
.
.
}
![]()