How does NSE prevent self-trade?
NSE prevents self-trade (traders who have multiple orders open for a scrip and are likely to match with each other) using a mechanism. If an active order comes in and is likely to match with any passive unmatched orders in the system, in the same order book belonging to the same client, then either the active or passive order will be cancelled by the exchange.
What this means for you
If you already have an order resting at the best bid/offer, and you place another order in the same scrip that would end up matching with your own earlier order, the exchange will cancel either the new (active) or the existing (passive) order to prevent the self-trade.
Note: This is applicable for all Day and IOC order types; limit, market, stop loss, and stop loss-market.