Realised Field Update

subha
Hi Sujith/Rakesh,
Can you please let me know when does the realized field get updated for Orders? Even when the position is closed, this field is not getting updated. Only the unrealised field has the value. At any point of point if I need to know the realised PnL, not able to get the details from this field instead I am manually calculating it.
  • sujith
    sujith edited January 4
    Realised param in the positions API is a legacy field. You can use this formula,
    pnl = (sellValue - buyValue) + (netQuantity * lastPrice * multiplier);
  • subha
    This would be the PnL which we get from the pnl field right.
    For calculating the realized and unrealised profits should be go for manual calculations.
  • sujith
    The pnl value from upstream is cached. You will have to use this formula with lastPrice from Websocket API or Quote API.
  • subha
    Thanks Sujith. Going with manual calculation as said.
Sign In or Register to comment.