You should report this to your broker and MetaQuotes as a bug. Is that happening on a demo or real account ?
Asynchronous order would avoid the freeze I suppose, but I suppose you would still have the same delay to get the answer.
You could also avoid changing a pending order when the order price is too close to the market price.
Gosh, OK! It seems more serious than I initially thought, then! How can I report it to MetaQuotes? I couldn't find any link for that purpose in the Terminal, nor in their website.
Real account.
Asynchronous order would avoid the freeze I suppose, but I suppose you would still have the same delay to get the answer.
Hmm then I've the impression that I could end up making a huge change in my code only to still end up with problems, just a little minimized instead. It doesn't seem cost-benefit worth it.
You could also avoid changing a pending order when the order price is too close to the market price.
That sounds like a good and practical idea, specially worth it giving that cases like this are rare. Thanks!
Gosh, OK! It seems more serious than I initially thought, then! How can I report it to MetaQuotes? I couldn't find any link for that purpose in the Terminal, nor in their website.
Real account.
Hmm then I've the impression that I could end up making a huge change in my code only to still end up with problems, just a little minimized instead. It doesn't seem cost-benefit worth it.
That sounds like a good and practical idea, specially worth it giving that cases like this are rare. Thanks!
You can report it here, but it needs more details, including the log with current market price, the error message, timeout...

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi!
Today I experienced a freeze in my EA when updating a pending order's stop loss and I'd like to know what can I do to avoid this situation in the future.
So, by what I noticed, when we send an order to update the stop loss of a pending order, the MT5-broker system sends 4 messages like this:
Notice the last message, when the system returns a "done" and the duration it took for the change to be made.
So what happened was that I had a pending order in a certain price and I gave an order to update the stop loss to a different place:
And the OrderSend function was called and the process to update the stop loss started, but before it finished, the pending order was executed and the EA froze:
And after that, that last, 4th message with the time didn't reached. Fearing loosing the proper management of the position, I closed the Terminal and reopened it again (so the next line, at 10:10:03.719, is about my EAs and Indicators being closed). The impression that I have is that, if I had waited (in my experience, around 3 minutes and half), the EA would have unfrozen with an error TRADE_RETCODE_TIMEOUT .
So, how can I avoid such freeze in the futures? The only thing that come to my mind is to use Asyncronous orders, but while that may have avoided the EA's freeze, I'm not sure how should I've processed it. So, any ideas that could help in such scenarios? Regarding the code, is normal OrderSend request, tested and used for years without problems until now.