bool tradeOn=false;
for (int pos=0; pos<OrdersTotal();pos++){
if (!OrderSelect(pos, SELECT_BY_POS)) continue;
if (OrderType()<2) {tradeOn=true;break;} elsecontinue;
}
if (tradeOn){
for (int pos=0; pos<OrdersTotal();pos++){
if (!OrderSelect(pos, SELECT_BY_POS)) continue;
if (OrderType()>1) if (OrderDelete(OrderTicket())==true)
Print("Delete"," Ordertype:",OrderType());
}
}