It looks like you're new here. If you want to get involved, click one of these buttons!
Node JS client
.Net API client
.Net / VBA / Excel (3rd party)
Algorithms and Strategies
Mobile and Desktop apps
Market data (WebSockets)
In this Discussion
Chronological order of states
When i use kite.order_history , i get a list of different states through which order went. I have 2 questions:
Are the list items (order states) chronological ? I recall updates received over WS can be out of order.
Is the list exhaustive ? Does it cover all the state transitions ?
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.
Thanks Sujith for confirming.
What is the downside of relying only on WS updates (given that i have uninterrupted broadband connection/aws setup) ?
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.
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.
Websockets API order updates are async in nature, I would suggest using that as an event to pull orderbook and check the order details.
Ok. I have an efficient order state management which can handle async updates. will u still recommend using api ?
edited July 2023
If you have covered all the cases handling at your end then it is fine you can go ahead.
And what is the final state of an order that is partially filled and then cancelled ? Is it cancelled/update/complete ?
If an order is cancelled then it will be cancelled status, it doesn't matter if it is not filled or partially filled.