How to close an existing order?

 

If I have placed a BUY/SELL order and set takeprofit/stoploss  for that order, but I want to close that order before either condition meets, how do I close it programmatically?

Thank you in advance.

 
which platform?
 
Marco vd Heijden:
which platform?

meta trader 5

meta editor

 
 
Marco vd Heijden:

OrderSend

Hey,

Order Send is used to place an order.

How can I use OrderSend to close an existing order? Can you give an example.

Thank you

 

no its not.

if you want to close a position you open order in opposite direction. 

go read it. 

 
Marco vd Heijden:

no its not.

if you want to close a position you open order in opposite direction. 

go read it. 

Okay.Got it. Thank you for your time and help.
Reason: