What is NSE's self-trade prevention mechanism?
NSE in 2015 introduced this mechanism to prevent self-trade for a client who has multiple orders open for a certain scrip which are likely to match with each other.
If an active order (orders that come in to match the existing orders) is likely to match with a passive order (Orders lying unmatched in the system) in the same order book belonging to the same client, either the active or passive order resulting in self- trade will be canceled by the exchange.
This essentially means if there is a scenario where one of your order is in the best bid/offer and you place an order in the same scrip and this order is about to match your own earlier passive order, then this new order will be cancelled by the exchange.
This is applicable for all Day and IOC order types; limit, market, stop loss, stop loss-market.
Check out the FAQ from NSE on Self-trade mechanism here.