Please excuse the bad English via Google Translate.
EA that disables active EA based on date? 1 reply
Alarm when Bar closes above a level 3 replies
How to Determine when Current bar closes? 4 replies
Three Consecutive Higher/Lower Closes 1 reply
The Forex Market NEVER actually closes 3 replies
DislikedDoes anyone have an EA that turns off the "Auto Trading" button at, for example, 23:45 and turns it back on, for example, 75 minutes later? It would be ideal if it were possible to configure closing of both open and pending orders when the button is disabled.Ignored
DislikedYou can try this. I haven't checked anything regarding closing trades, you should test it on a demo a/c to satisfy yourself it works as expected. Regards. {file}Ignored
Disliked{quote} My joy was premature. That is an EA that I also found on the internet. It is not as described and does not work.Ignored
2025.01.21 10:40:06.384 Automated trading disabled 2025.01.21 10:40:06.381 CloseOnTimesv1.1 GBPUSD,H1: OrderCloseReliable v5.0: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 2025.01.21 10:40:06.381 CloseOnTimesv1.1 GBPUSD,H1: OrderCloseReliable v5.0: Successful close of Ticket #223922326 [ Last error: 0 :: no error ] 2025.01.21 10:40:06.381 CloseOnTimesv1.1 GBPUSD,H1: close #223922326 sell 0.05 AUDUSD at 0.62452 at price 0.62476 2025.01.21 10:40:05.962 CloseOnTimesv1.1 GBPUSD,H1: OrderCloseReliable v5.0: Attempted close of #223922326 price: 0.62476 lots: 0.05 slippage: 80 2025.01.21 10:40:05.962 CloseOnTimesv1.1 GBPUSD,H1: OrderCloseReliable v5.0: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 2025.01.21 10:40:05.962 CloseOnTimesv1.1 GBPUSD,H1: OrderCloseReliable v5.0: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 2025.01.21 10:40:05.962 CloseOnTimesv1.1 GBPUSD,H1: OrderCloseReliable v5.0: Successful close of Ticket #223922329 [ Last error: 0 :: no error ] 2025.01.21 10:40:05.962 CloseOnTimesv1.1 GBPUSD,H1: close #223922329 sell 0.05 GBPUSD at 1.22888 at price 1.22918 2025.01.21 10:40:05.543 CloseOnTimesv1.1 GBPUSD,H1: OrderCloseReliable v5.0: Attempted close of #223922329 price: 1.22918 lots: 0.05 slippage: 80 2025.01.21 10:40:05.543 CloseOnTimesv1.1 GBPUSD,H1: OrderCloseReliable v5.0: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 2025.01.21 10:39:10.472 CloseOnTimesv1.1 GBPUSD,H1: initialized 2025.01.21 10:39:10.472 CloseOnTimesv1.1 GBPUSD,H1 inputs: StartHour=1; StartMins=0; StopHour=4; StopMins=40; UseLocalTime=false; CloseOpenTrades=true; ClosePendingTrades=true; MagicNumberToClose=-1;
Disliked{quote} Well that's odd because I adapted it from the file you uploaded called CloseOnNewsEAv2.1.mq4. It will also require the file OrderReliable.mqh to be saved in your MQL Include folder which deals with closing of trades. I assumed you had this because it came in the zip file you posted. You don't say why it doesn't work or if you see any error messages etc. I'll need a bit more to go on. Regards. Edit. I just tried it and it seems to work, see below event log & my Auto Trading button was disabled... 2025.01.21 10:40:06.384 Automated trading...Ignored
DislikedDoes anyone have an EA that turns off the "Auto Trading" button at, for example, 23:45 and turns it back on, for example, 75 minutes later? It would be ideal if it were possible to configure closing of both open and pending orders when the button is disabled.Ignored
Disliked{quote} Try this, works perfect! https://www.earnforex.com/metatrader...ing-Scheduler/ Welcome.Ignored
DislikedYou can try this. I haven't checked anything regarding closing trades, you should test it on a demo a/c to satisfy yourself it works as expected. Regards. {file}Ignored
Disliked{quote} The problem is that some positions will remain open. One coder found an instruction that can switch the profile. I am no longer in contact with him. Using this MQL instruction it is possible to create an EA that switches the profile at a set time. On this profile the EA will have "Close all open and pending orders" and a second timer to switch back to the original profile. The "AutoTrading" button would always be green. That would be the definitive solution. I am attaching an indicator that contains such an MQL instruction, but it does not...Ignored
QuoteDislikedIt would be ideal if it were possible to configure closing of both open and pending orders when the button is disabled.
Disliked{quote} A more reliable solution would be if you are able to specify which trades must be left open (magic number, order type, in profit/loss, etc) and the criteria could be added to the CloseOnTime EA. I had a look at the profile switch and I can see why it would be unreliable. When you are dealing with such a situation I would say having a robust solution is essential. You also said originally, {quote} Well, have a think through what you actually need and specify it exactly. Regards.Ignored
Disliked{quote} I would really like to know why profile switching is unreliable. It would be a very perfect solution. I need to close all open and pending orders perfectly. Including orders that may be opened by another EA that is active at the time of closing.Ignored
Disliked{quote} The profile switching is achieved by sending mock keystroke combinations and can be fragile depending on whether there is any other keyboard use or connectivity issues, OS status, etc. The one I sent you relies on sending a targeted windows message to MT4 to simulate a mouse click on the Auto Trading button. I feel it's slightly less prone to intermittent adverse conditions. The CloseOnTimes I sent you in the first place will close all trades no matter how they were placed if you set MagicNumberToClose = -1. This means close all trades regardless...Ignored
Disliked{quote} In the Include folder I have the file OrderReliable.mqh. I placed the EA on 4x MT4. Only on one of them about 10 trades remained open. I closed them manually when the button was red. For today I added one more EA to close all positions. By minus 3 minutes.Ignored
QuoteDislikedBy minus 3 minutes.
Disliked{quote} Do you mean 4 different sessions of MT4 connecting to 4 different MT4 servers. If so, that should work fine. You say that one of them left 10 trades open but when you manually closed them the button was red. If the EA disabled the button (which happens just after closing the trades ) it should have written some information to the Experts tab at the bottom of the terminal window. This might show if any errors are occurring. Also make sure your start stop times are set up correctly. I've tried it myself with a mixture of open and pending trades,...Ignored
Disliked{quote} Each MT4 has a different account number. One of them is with a different broker. I check everything and look at the Experts tab. At 23:37, everything is closed by Universal Manager. CloseOnTimesv1.1 is set to 23:40.Ignored
Disliked{quote} If Universal Manager is closing everything at 23:37, what was left over that needed closing by the CloseOnTimes (at 23:40) but wasn't? I'm confused by your explanations, sorry about that but I'm not fully understanding what's happening.Ignored