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

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

Look at the documentation - there is a detailed example there

https://www.mql5.com/en/docs/trading/ordersendasync

Documentation on MQL5: Trade Functions / OrderSendAsync
Documentation on MQL5: Trade Functions / OrderSendAsync
  • www.mql5.com
OrderSendAsync - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
R4tna C #:

Look at the documentation - there is a detailed example there

https://www.mql5.com/en/docs/trading/ordersendasync

As far as I can see there are only examples for buy and sell orders, but not for closing them? or am I blind?
 
@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