What error do you get?
Replace OrderSelect(i, SELECT_BY_POS, MODE_TRADES) with if(OrderSelect(i, SELECT_BY_POS)) {/* */}
Replace Bid with MarketInfo(OrderSymbol(),MODE_BID)
Replace Ask with MarketInfo(OrderSymbol(),MODE_ASK)
Replace Point with MarketInfo(OrderSymbol(),MODE_POINT)
Replace Bid with MarketInfo(OrderSymbol(),MODE_BID)
Replace Ask with MarketInfo(OrderSymbol(),MODE_ASK)
Replace Point with MarketInfo(OrderSymbol(),MODE_POINT)
Well, it's already solved. Thank you.
Yes, You were using wrong prices in your sample.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I'm trying to write a code to manage all open orders regardless it's pairs. My idea is to attach it on one pair only but will manage orders from other pairs too.
But it seems this code is failed, any idea why?
Thank you