How to make a reversal in one trade ?

 
Hello, my name is Wilson, and I would like to know how to make only one order to cover and to buy on one symbol ?
Here is my actual EA, but is there a solution to reverse in one order ?
//_____________________________
OrderSelect ( i, SELECT_BY_POS, MODE_TRADES ) ) {
         if ( OrderSymbol() == Symbol() ) {
            if (OrderType() == OP_SELL ) {
               cmd = OP_BUY; // buy         
               // Close sell order 
               OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, Blue);             
               }
            }
         }
      
   if(cmd==OP_BUY) {
      // buy  
      if ( OrderSend( Symbol(), OP_BUY, lots, Ask, Slippage, 0, 0, "Opened Buy Order", 0, 0, Orange ) > 0 )
         Print ( "Opened Buy Order at ", Ask );
//_______________

Thank you very much =D
 
you cant in Mt4 ! you have to close and open a new one
 
lyes :
you cant in Mt4 ! you have to close and open a new one

mmm ok thank you.

I have an error message #130 and I don't understand what is it...

I trade on the EUR/USD forex.


if (OrderType()==OP_BUY && OrderSymbol()==Symbol()&& OrdersTotal()==1)

{

OrderClose(OrderTicket(),OrderLots(),Bid,0,Green);

}

ticket=OrderSend(Symbol(),OP_SELL,lots,Bid,3,1.40,1.30,"Ordre Court",0,0,Red);

This mistake comes from the stopprofit and stoploss, but I don't see what. I tries mpany values...


Thanks