If you’re trading at Zerodha, it will be considered as 2 different positions. The sell trade will not negate the buy trade.