Trailing Stoploss Coding/Condition Builder

Is there a way to trail the positions based on Nifty Futures movement…say I entered with credit spread at Nifty Futures 16300 and SL is 0.5% away(based on Nifty Futures price)…Now I want to trail my exit criteria with each 2-3 point move of Nifty Futures in favorable direction…how this can be done/