exiting the positions with fyers.exit_positions(data=data)

while exiting the positions with fyers.exit_positions(data=data), does it check for open positions for a particular symbol or just places trade?

I guess, it places market order to exit the positions based on contract id or side or segment.

besides placing new reverse order, Is there any way to exit the positions by providing limit price?

Hi @yogendrayadav08-6j8

yes it check for the particular symbol you have active position or not. Both cases I explained below.
Yes it is obvious it will place market order when you are exiting instantly. Otherwise if you want limit order based on some trigger point you can place SL-L order for script.

fyers = fyersModel.FyersModel(client_id=client_id, token=access_token,is_async=False, log_path="")

data = {
    "id":"NSE:IDEA-EQ-INTRADAY"
}

response = fyers.exit_positions(data=data)
print(response)

You can use this. In above case if you have Idea position then it will exit and you will get response like this
{‘code’: 200, ‘message’: ‘Position NSE:IDEA-EQ-INTRADAY is closed.’, ‘s’: ‘ok’}

and now you have exited the position and you don’t have active position for the idea. if you will run again same code means fyers.exit_positions with same data then you will get response like this
{‘code’: -352, ‘message’: ‘Looks like you have no open positions.’, ‘s’: ‘error’}

Try it , hope it will help to you and this is what you want.
Thank you