Stop loss to trail to some percentage of current price of a leg

When a CE call hit the stop loss,I want to trail stop loss for other leg i.e PE to 20% to the price of PE when CE stop loss of CE was hit and vice versa
Also when CE stop loss hit,for every 10 points movement in PE I want to trail stop loss by 20% and vice versa
example:
When CE stop loss is hit at that time the PE price is 100,place stop loss of 20% to PE…i.e 100*1.20.
since then when for every 10 points movement by PE trail stop loss to 20% of PE price at that point.