How to get pnl for closed positions via API?

khannavivek
Is there a way to fetch pnl for closed positions using zerodha api?
Tagged:
  • rakeshr
    @khannavivek
    Yes, you need to iterate through net position and check for closed position i.e condition of quantity field to be Zero.
  • khannavivek
    @rakeshr
    I am not able to get data for old closed trades, like previous week or previous month, is there a way to fetch those?

    Or is there a way to get PNL report for the account from a desired period?
  • rakeshr
    I am not able to get data for old closed trades, like previous week or previous month, is there a way to fetch those?
    No, currently we don't have these APIs.
    Or is there a way to get PNL report for the account from a desired period?
    No. You can only fetch current holdings/positions detail not historical.
Sign In or Register to comment.