How to fetch realized and unrealized profit separately using kite connect API

KN5981
Hi @admin
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);
  • rakeshr
    The formula remains the same for both, just for realized p&l you need to replace lastPrice with the sold price/sell price. This article explains more.
Sign In or Register to comment.