Pine Script, Tradingview correction needed in trailing stop loss in put option

Job ID: 33674747

Budget: ₹600 – ₹1,500 INR

I do have a script running in pinescript, which has trailing stop loss.

Im trading in options where it works perfectly in Call Option since im buying the call option, but when i try to buy the put option it fails

The rose dot indicates the trailing stop loss, though it is too far from the current market price, it closes suddenly in the next candle

Im missing something.. You need to correct that for me
Related categories: JavaScript Metatrader Charts Pine Script MetaTrader 4