Download MetaTrader 5

Disable EA from opening new orders but Trail or Close previously opened orders.

To add comments, please log in or register
Mathews Achankunju
246
Mathews Achankunju  
Hello,

Is there anyway to prevent an EA from opening new orders (Daily at time X)  but maintain previously opened orders. 

Edit: I don't have the source code and cannot modify the EA.
Bartlomiej Gorski
9284
Bartlomiej Gorski  

You can make dll call or use this function : ExpertRemove();  and in the indi (separated from your ea) just give a condition that if time > x then call Expert remove function.

In this way you will remove ea from chart, which will prevent from opening trades. Unfortunately if you dont have source code, there is not much you can do.

Bartlomiej Gorski
9284
Bartlomiej Gorski  

Here is the dll function call that you can use instead of ExpertRemove, before that function you must include this:  #include <WinUser32.mqh> 

PostMessageA( WindowHandle( Symbol(), Period()), WM_COMMAND, 33050, 0);  
Mathews Achankunju
246
Mathews Achankunju  
Bartlomiej Gorski:

You can make dll call or use this function : ExpertRemove();  and in the indi (separated from your ea) just give a condition that if time > x then call Expert remove function.

In this way you will remove ea from chart, which will prevent from opening trades. Unfortunately if you dont have source code, there is not much you can do.

But this would remove the expert right. The expert is supposed to maintain already opened orders and decides when to close them.

Bartlomiej Gorski
9284
Bartlomiej Gorski  
You are right, but there is no way to prevent ea from trading and still control other orders if you dont have source code. Either you remove ea and stop it permanently or you need source. You can also programaticaly click "auto trading" button, so ea will stay on chart, but if auto trading is off then it wont be able to modify/close existing orders either. So there is no option that you can do what you want without source.
Kanchana Goodklay
48
Kanchana Goodklay  
Bartlomiej Gorski:

Here is the dll function call that you can use instead of ExpertRemove, before that function you must include this:  #include <WinUser32.mqh> 

PostMessageAWindowHandle( Symbol(), Period()), WM_COMMAND, 33050, 0);  
Mathews Achankunju
246
Mathews Achankunju  
Bartlomiej Gorski:
You are right, but there is no way to prevent ea from trading and still control other orders if you dont have source code. Either you remove ea and stop it permanently or you need source. You can also programaticaly click "auto trading" button, so ea will stay on chart, but if auto trading is off then it wont be able to modify/close existing orders either. So there is no option that you can do what you want without source.

Thank you :)

star23mt4
6
star23mt4  

I have an EA that was coded to manage other EAs which has settings to function within certain hours only. The main function of my Ea is that it allows you to turn on and off Autotrade function from Monday to Sunday within certain hours of the day. Each day has a Start time and a End time. The start time turns on autotrade and End time is the time the Ea will start monitoring for any close orders/close trades. If it detects any close trades it then checks for any remaining open positions and if there are no opened positions the Autotrade function is now disabled. This however should only be used for a single ea on a single chart. The Ea is not free also. 

To add comments, please log in or register