Hapu Arachchilage Tharindu Lakmal:
I want to check whether the pending orders are for the current symbol or not (both buy and sell pending orders,
but the code does not work. I'm still learning MQL5, so I appreciate your help.
bool NoSellStopOrders() { int count=0; for (int i = 0; i < OrdersTotal(); i++) { ulong ticket=OrderGetTicket(i); if (OrderSelect(ticket))// Select order by ticked number { if (OrderGetString(ORDER_SYMBOL) == Symbol() && OrderGetInteger(ORDER_TYPE) == ORDER_TYPE_SELL_STOP) { ++count; } } } return (count == 0); }

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 want to check whether the pending orders are for the current symbol or not (both buy and sell pending orders,
but the code does not work. I'm still learning MQL5, so I appreciate your help.