For SL and target you can write order functions with if condition that other should get cancelled if either SL or target hits ( One cancels other ) For trail sl you can use modify regular order function with condition. I would suggest to use Bracket orders.
You should use bracket orders for your requirement.
I would suggest to use Bracket orders.