I'm looking to get this function;

Say that I have an open Buy order and it not picks the takeprofit level, when price bounces back x pips then a Sell order will be open and the buy order should still open.
If this Sell order closes buy takeprofit or trailing stop then all orders should be closed. The same should happen if the start order is a Sell.