I want delete all orders pending only a symbol()
Try this:
//+------------------------------------------------------------------+ int ordersTotal = OrdersTotal(); //--- search in all open positions for (int i = ordersTotal - 1; i >= 0; i--) { //--- if an error occurs at selecting of this position then go to the next one... if (!OrderSelect(i, SELECT_BY_POS,MODE_TRADES)) continue; //--- if the position was opened not for the current symbol, skip it... if (OrderSymbol() != Symbol()) continue; if (Order_Type() == OP_BUY || Order_Type() == OP_SELL) continue; if(!OrderDelete(OrderTicket())) { Print("fail deleting pending order"); } } } //+------------------------------------------------------------------+
I want delete all orders pending only a symbol()
Thank you