kite.positions() never return the latest value

saurabhkhoria
Hi Zerodha team,

kite.positions() never return the latest value. Request you to please fix this.

Thanks
Saurabh
  • Vivek
    Can you elaborate the issue? After taking or exiting position if you are making positions api call its not updated? or is it about PNL and M2M calculation?
  • saurabhkhoria
    After taking the positions, then when i do kite.positions(), the 'last_price' field of the response doesn't contain the latest value.
  • ZI4453
    @saurabhkhoria , please post the response ...
  • rishiswethan
    positions() will not have the last price updated as frequently, use quote() instead for that
  • rakeshr
    rakeshr edited September 2019
    @saurabhkhoria
    Depending on the interval of your requirement for fetching last_price. For shorter period instead of continuous polling quote call for LTP, you may use Websocket Socket streaming.
  • SANDEEPSHARMA
    I am facing same issue. I want to fetch latest pnl value and want to square off my positions based on that after computing the pnl value of all my positions. But delay in fetching latest pnl is causing the algo to return different results.
  • sujith
    @SANDEEPSHARMA,
    We don't recommend polling positions API just to get the P&L. You need to calculate P&L at your end.
    You can know more here.
This discussion has been closed.