Position API

sutolani@gmail.com
The PNL in API is getting refreshed once in 15 Minutes....In worst case this should be 15 seconds.
My porfolio exists are based on this PNL and action gets taken when it is too late. By when can this be fixed?
  • sutolani@gmail.com
    This is get Positions API
  • sujith
    Hi,
    You can check out this thread for solution.
  • sutolani@gmail.com
    Sujith,
    The Postion API gives a lot more data in terms of PNL, M2M, realized, Unrealized, Overnight quantity etc. My question is specific. Why is the delay 15 minutes intead of a few seconds, and whether there is any intent to correct it. If refresh interval is 15 minutes, you may as well as deprecate the API or CLEARLY Highlight in Red that delay will be 15 minutes on API document!
  • sujith
    P&L can change arbitrarily and the GET positions API is not meant for polling. It is thus not possible to provide accurate, real-time P&L with an HTTP response and the recommended way is to use WebSockets and consume real-time data and compute P&L.
  • Jigpylab
    @sujith, I am also facing same issues, we have developed many algo where we are stoploss are based on get.position(). clearly by keeping 15 min frequency is not fair when we are paying for API, at least you can keep 10-15 second update.
  • sujith
    sujith edited January 2021
    @Jigpylab,
    You can calculate the P&L at your end using the getQuote API or Websockets data. GetPostions API is to know the m2m direction and not the P&L.
    You can check out the formula in the above-mentioned thread.
  • Jigpylab
    @sujith
    Thank you for your reply.
    I understand that for m2m we should not look for get.postions().

    Can you please mention at what interval you have set your server to update my trades in get.positions().
    e.g. if i buy any script, after what time interval it will appear in get.positions().

    Please understand that i am need to know this interval for my algos, you answer would be highly appreciated.
  • sujith
    @Jigpylab,
    It should appear instantly if you couldn't find it in positions immediately after placing an order then try adding 500ms or 1s delay.
  • Jigpylab
    @sujith
    Thanks a lot for this clarification.
This discussion has been closed.