Hello is there any direct endpoint to fetch live PNL for all the open positions ?
I tried creating by using position api but that has lot of things to do like summing up the unrealized profit and all other stuff also since it is not based on websocket fetching live data continuously is not working properly as I have used loop function
Hello @Hardik I am creating a script that fetches overall live pnl and if it reaches my loss limit it will close all the open position and activate kill switch.
For closing the position I just get the order details from open position using position api and placing the sell order. However, for live pnl I have used loop function that is creating a mess.
Is there any other way to fetch live pnl ? without using loop function.
Currently, to calculate live PnL using the API, you can either compare the LTP (Last Traded Price) with the Buy Price, or calculate it based on your Unrealized Profit. Please note that performing this calculation might requires the use of a loop.
@Hardik@fisek209281 I have read the V2 API doc and there are many things that needs to be corrected - the url for kill switch is also incorrect. Please check…