Current location - Loan Platform Complete Network - Foreign exchange account opening - In MT4, how to close the position in EA is not directly using Orderclose, but using orderslect, orderticket, but my orderticket
In MT4, how to close the position in EA is not directly using Orderclose, but using orderslect, orderticket, but my orderticket
Print(i== "order number", orderticket ());

I don't think this is right,

You can write it like this, Print("i= ",I," order number = ",orderticket ());

//You can use this to close your position.

if(order type()= = OP _ BUY)order close(order ticket(),OrderLots(),Bid,3,Blue);

if(order type()= = OP _ SELL)order close(order ticket(),OrderLots(),Ask,3,Red);