if(OrderOpenPrice()>= Bid - TrailingStop || OrderStopLoss () == 0 ) { if(OrderStopLoss() != (OrderOpenPrice() + NormalizeDouble(Bid - TrailingStop*Point,Digits ))) if( OrderStopLoss() > Bid - OrderStopLoss() + TrailingStep*Point) { SL = Bid - TrailingStop*_Point; { for(int i = OrdersTotal()-1; i>=0; i--) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) { if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic && OrderType() == otype) if(OrderModify(OrderTicket(), OrderOpenPrice(), SL, 0, 0, Yellow)) Print(" OrderModify Ok!"); else Print(" OrderModify Error!"); } } } } }