for (int i=0;i<OrdersTotal();i++) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); if (OrderSymbol() == Symbol()) { if (OrderType() == OP_BUY && (Bid - OrderOpenPrice()) > (buypips * Point)) ...