MetaTrader does not support it natively. It has to be implemented via an EA.
Here is one such example described in an Article: MQL5 Cookbook: ОСО Orders
But there are other implementations in the CodeBase, so run a search there.
Stop using pending orders. There is no need to create pending orders in code.
- The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
- Don't worry about it unless you're scalping M1 or trading news.
- Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
MetaTrader does not support it natively. It has to be implemented via an EA.
Here is one such example described in an Article: MQL5 Cookbook: ОСО Orders
But there are other implementations in the CodeBase, so run a search there.
Wow, okay.
Thank you for your response. I appreciate.
Stop using pending orders. There is no need to create pending orders in code.
- The pending has the slight advantage, A) you are closer to the top of the queue (filled quicker), B) there's no round trip network delay (filled quicker.)
- Don't worry about it unless you're scalping M1 or trading news.
- Humans can't watch the screen 24/7, so they use pending orders; EAs can, so no need for pending orders, have it wait until the market reaches the trigger price and just open an order.
Exactly, you've said it!
I'm trading news that's why I was trying to find out how to use OCO. I prefer market execution to pending orders for my regular trading, but OCO would be beneficial to me for trading news.
Thank you for your response.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use