It looks like you're new here. If you want to get involved, click one of these buttons!
Node JS client
.Net API client
.Net / VBA / Excel (3rd party)
Algorithms and Strategies
Mobile and Desktop apps
Market data (WebSockets)
In this Discussion
How to fetch realized and unrealized profit separately using kite connect API
I need to fetch the realized and unrealized profit separately. Right now I used below formula, but it returns the P&L. I want to fetch the realized and unrealized separately. Kindly help me to solve this issue.
pnl = (sellValue - buyValue) + (netQuantity * lastPrice * multiplier);
The formula remains the same for both, just for realized p&l you need to replace lastPrice with the sold price/sell price.