Skip to main content
Question
FYERS API
Asked a question 2 years ago

Exit Position - By Id not working? Details here... https://community.fyers.in/post/exit-position---by-id-not-working-60d98e65b90dbc384b029321

Join FYERS Community to pick others' brains on Trading/Investing

Hi Algo Trader, sorry for the trouble you faced and for the late reply.
Please note that we have migrated to api v2.
The key the user is using is incorrect. "id" here is an optional field, all the positions will be exited if it is not mentioned.
However user can close a specific position in this way by specifying the id.
data  = {
     "id":"NSE:SBIN-EQ-BO"
   }
fyers.exit_positions(data) 
In api v2 there is a option to exit position by id, for more detailed you can checkout this link22