Automatic Option treading from treading view to dhan by webhook connect... sell problem

I make a stratgy on treading view for buy and exit in options, its connect by webhook successfully. i add scrip in nifty for buy an option, it’s wroking ok for buy only. now problem in exit, so what i have to do same option for exit.
Every alert from the stratgy dhan buy the option premium only, how to exit the same strike price.
Please anybuddy can help me in this matter… please reply

Hi @Er_akash ,

For exiting the same option position through the TradingView webhook, you need to generate a SELL order JSON for the same instrument, strike price, option type, and expiry that was used for the BUY order.

For example, if the BUY alert was for a specific NIFTY Call/Put with a particular strike and expiry, the EXIT alert should use the same contract details with the transaction type as SELL.

Please ensure that the expiry and strike price match the option position you wish to exit.

Feel free to write us back at apihelp@dhan.co