I’m developing with Dhan API. Currently, I’m calling DELETE /v2/positions to exit all positions. Does it also cancels associated Super Orders? Or I need to call DELETE /super/orders/{order-id}/{order-leg} again for each positions?
DELETE /v2/positions will exit all active positions and cancel open orders. For safety purposes, please cancel the Super Order and all its legs separately using DELETE /v2/super/orders/{order-id}/{order-leg}.
So, if you have active/pending Super Orders, check them and cancel them separately using DELETE /v2/super/orders/{order-id}/{order-leg}.
Using the DELETE /v2/positions endpoint, all your open positions will be exited, regardless of whether they were created through a normal order or a Super Order.
However, any pending Target or Stop Loss legs placed as part of a Super Order that are still awaiting execution will not be cancelled through the Exit All Positions API.
These pending Super Order legs need to be cancelled separately using the Super Order Cancel API.
So, in case of active Super Orders, we recommend checking and cancelling the pending Target/Stop Loss legs separately after exiting all positions.