Closing position with "Async mode"? Can you give a example code?

sanane sanane1  
Closing position with "Async mode"? Can you give a example code?
Fernando Carreiro  
@Nedim Hallovic #: As far as I can see there are only examples for buy and sell orders, but not for closing them? or am I blind?

On MT5, closing a position is accomplished by placing an order in the opposite direction with the same volume and a reference to the open position.

So it is essentially the same thing except for the reference to the position ticket.

Also see Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Trade Operation Types

Reason: