Chronological order of states

ksh
Hi
When i use kite.order_history , i get a list of different states through which order went. I have 2 questions:
  1. Are the list items (order states) chronological ? I recall updates received over WS can be out of order.
  2. Is the list exhaustive ? Does it cover all the state transitions ?
  • sujith
    The order history data is synchronous. Only the websocket event is async in nature.
    There can be many entries. It does cover all state transitions.
    If you just need the latest status of an order, an orderbook API call is enough though. You may use order update as an event to fetch orderbook.
  • ksh
    Thanks Sujith for confirming. :)

    What is the downside of relying only on WS updates (given that i have uninterrupted broadband connection/aws setup) ?
  • sujith
    For postbacks, you will only get order updates for orders that are only placed from your app and not from Kite web or app. Whereas on websocket API you will receive order updates for all the orders. Websockets order updates are better than postbacks for individual users.
  • ksh
    Ok .I was trying to compare relying on WS updates vs kite.orders(). What do u think ? i feel ws update will be faster and api call will be an overhead.
  • sujith
    Websockets API order updates are async in nature, I would suggest using that as an event to pull orderbook and check the order details.
  • ksh
    Ok. I have an efficient order state management which can handle async updates. will u still recommend using api ?
  • sujith
    sujith edited July 2023
    If you have covered all the cases handling at your end then it is fine you can go ahead.
  • ksh
    And what is the final state of an order that is partially filled and then cancelled ? Is it cancelled/update/complete ?
  • sujith
    If an order is cancelled then it will be cancelled status, it doesn't matter if it is not filled or partially filled.
Sign In or Register to comment.