MTM calculator

Zen8_ith
can you please explain how to calculate Total MTM like realised MTM and unrelised MTM using API? i AM USING p&l of the psotions but it is showng wrong MTM.
  • Arockiya_r
    Closed position:
    Realised MTM for long = sell price - Previous close
    Realised MTM for short = Previous close - buy price

    Open position:
    Unrealised MTM for long = LTP - Previous close
    Unrealised MTM for short = Previous close - LTP
  • Zen8_ith
    No it is not working . Like initially i have a position then its stoploss hits then i take a reverse position for the same strike (Buy to Sell) . So in this case i am using kite.position(), last_price and buy_price or sell price but it not giving correct results.
Sign In or Register to comment.