what is the benefit of OrderCloseBy() ,compare to Order Close ?

 

what is the benefit of OrderCloseBy() ,compare to Order Close ?

 
kelly:

what is the benefit of OrderCloseBy() ,compare to Order Close ?

If you have 2 trades open both on EURUSD one a Buy one a Sell.  If you OrderClose() the Buy the Sell is still open,  if you use OrderCloseBy() the Buy offsets the Sell,  the Buy will be closed and the Sell will also be closed unless it is a larger position size,  then I assume the remaining part of the Sell will remain as an open Order.  The advantage ?  one transaction, so it should be faster to execute . . .  but I have never used it so have no direct experience.  
 
RaptorUK:
If you have 2 trades open both on EURUSD one a Buy one a Sell.  If you OrderClose() the Buy the Sell is still open,  if you use OrderCloseBy() the Buy offsets the Sell,  the Buy will be closed and the Sell will also be closed unless it is a larger position size,  then I assume the remaining part of the Sell will remain as an open Order.  The advantage ?  one transaction, so it should be faster to execute . . .  but I have never used it so have no direct experience.  

  • Yes but it get another ticket number, so technically it's another trade.
  • The main advantage is on the spread, as you only pay it once.
Reason: