Is there a way to cancel Pending Limit Order / SL Order

HI Team,
Is there a way, to cancel the pending Limit Order or SL-Order based on some time elapse or based on current positions?-
Selva

pending SL orders will get cancelled if the Set gets exited.