I've been doing pair trading with python on MT5. Sometimes when I close the position in a pair, one symbol was executed successfully while the other failed. Usually I wait a few minutes and run the same code again, and it would be closed successfully. But this often led to undesirable closing price. Have you encountered similar problem? How would you deal with it?
- Please check my code, I am starting to learn MQL
- How to close 14 pairs simultaneously?
- How to close Pending orders in Mt5 with python
Add: Right now my solution is to keeping trying until the closing request is executed successfully. If it exceeds 30 seconds, it is ignored and will try again in the next loop.

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