Easy, talk to the people that wrote and own the EAs and ask them to do the modifications.
And if they are not willing to do the modifications?
sothirsty:
You might be able to write or get written an EA that closes particular charts and then closes any relevant Orders, closing the orders is the easy bit . . .
And if they are not willing to do the modifications?
sothirsty:
I would like to be able to enable/disable the EA's based on the angle of a moving average.
I would also need to be able to close any open or pending orders automatically when the EA is disabled.
- Then You must remove the EA or close the chart window, either manually or programmatically. REF
#define MT4_WMCMD_REMOVE_EXPERT 33050 /* Remove expert advisor from chart */ #define MT4_WMCMD_CLOSE_CHART 57602 /* close the current chart */ #include <WinUser32.mqh> : int hwnd = WindowHandle(Symbol(), Period()); if (hwnd == 0){ Alert("No such window ", Symbol(), " ", Period()); else if (!IsDllsAllowed()) { //DLL calls must be allowed Alert("Dll calls must be allowed"); else if (PostMessageA(hwnd, WM_COMMAND, MT4_WMCMD_REMOVE_EXPERT, 0) == 0) Alert("PostMessage failed");
- You know the EAs magic number so you can close them.
for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() // and my pair. ){ if (OrderType() > OP_SELL){ if (!OrderDelete(OrderTicket()) Alert... } else if (!OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 30) Alert... }
- You must manually reattach the EA when desired.
So there is no way to turn live trading of an EA on/off based on an indicator?
of course there is (but not easy, involving WINAPI)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
My problem is that I have some EA's that I do not have the mq4 file for. They work very well when the market is trending but VERY bad when it is not. I would like to be able to enable/disable the EA's based on the angle of a moving average. I would also need to be able to close any open or pending orders automatically when the EA is disabled. Is there any way to do this?
Thanks.