@harry Potter.....if you the intraday chart with 10 min candle sticks.
Your buying was around 17145 with RSI of 58-59.....
The stock moved to 17584 with RSI going upwards of 80.. which is fine in a bullish scenario, but the macd crossover happened at around 10.05 am with RSI of 60 which indicates weakness on intraday basis.
As the market started losing its gains, panic selling happened. Hence you lost your gains. The stock closed in a bearish zone., Thereby hitting your stop loss. I have marked key moments in the image below.
If something like this ever happens sell at crossover point and short the stock. Double whammy! Hope this explanation helps.