How to check if a market order is present?

 

Using OrdersTotal() returns the total number of orders including any pending orders - how do I test if I have any open market order in progress rather than pending orders?

 

OrdersTotal() then check each order's type (BUY,SELL, Buylimit....)

int total=OrdersTotal();

for(int pos=0;pos<total;pos++)
{
if(OrderSelect(pos,SELECT_BY_POS)==false) continue;
if (OrderType()==OP_BUY )

......................................

}

Reason: