How to close option position by webhook tradingview

if i enter a position say call option buy ( webhook in tradingview), when i write a json for call sell , it create a sell order, but order get failed due to less margin. means it is considering as fresh order and didnt sequre off position.

Hi @9374229025 Welcome to Dhan community.

The scenario you mentioned is true even without webhook or any order type - if one of legs does not get executed, the other will be triggered as fresh order. Orders & positions placed are in sync with all Dhan platforms - so you can monitor them via app or web too, not just webhooks.

For web orders - both for Buy & Sell legs can be placed via Webhooks. Maybe we will write a detailed post or FAQs on this for more clarity.

Ps: Request you to add a name for your profile on community, at this moment your mobile number is visible publicly. Pl update faster, else the account may get delisted.

1 Like

ok but mobile number is username and i couldnot find to change it, my name is also there as Prakash Wadje.
although thanks for ans, we are being forced to use third party app to close positions, waiting for beeter platform. Also Iam trying in python but i am not a coder.

Maybe you can review this video we put out recently -