Any API call to exit from positions?

Using Dhan API I am able to place orders in FNO and it’s really great. But when it comes to selling/exiting positions I am unable to find any API call. As it is an existing order we can’t sell. It will create a new order. It would be very helpful to know how to exit from Positions with API.

1 Like

Hi , I
I also have a similar problem

Need a bit of Help regarding JSON
My bot places say 5 to 10 Buy orders of CE or PE as and when the conditions are met. Now when condition is met to take TP or SL all these orders need to close, now lets say 5 CE Buy orders are placed with each having qty of 10 lots, Now when the exit condition is met it needs to close the entire qty, i.e 50 Lots, how to create JSON for qty which can be variable or the entire qty needs to be squared off
Regards

Hello @dibyaprakashdash

On APIs, exiting a position is simply placing a new order with reverse transaction type. For example, if you have a long position of 5 quantity, then you simply need to place a sell order via API for 5 quantity to close your position.

Position is nothing but net of your buy/sell orders of a day for an instrument.

@asijavk
I am guessing your query is regarding Dhan Webhooks for TradingView, have answered it on a different thread.