What is the wrong with this functions ?.
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); }
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.