close with a limit order

 

i want to use a limit order to close my trade but am stuck at the following point.

if the limit order fails because price has moved beyond my limit order by more than 3 pips i would like it to delete the limit order and place a trailing stop instead.

any thoughts here would greatly be appreciated. i wouldnt want the ts to initialize unless price is greater than my limit order so i would want slippage set to 0 or 1 i think.