How to close an opposite order when the other takes the profit

 

Hi RaptorUK,

Could you show a way to close an order if the opposite gets the takeprofit ?

With that once one of the pending orders gets  the profit (now is a market order) the EA starts again around the current price 

Thanks in advance for any help you could provide

Luis

 

Why would you want two open orders of opposite? One or the other is a looser.

If a pending gets opened, close the other one.

 
Opening a second order larger than the last take much more free margin and is exactly equivalent to closing the first and open a new with lotsize=difference.
Reason: