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.
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