Say I do kite.place_order with validity set to IOC to buy 100 shares of a stock. I get order_id as response, right?
Say, 30 shares got filled. The remaining 70 got cancelled. What do I get in the postback?
(asking because I can't test it myself as I'm still in development stage and have not yet registered an api_key and there is no sandbox either) Thanks!
@codezed Thanks. Yes, I am looking for websocket response. Polling order book is inefficient, on 2 counts - 1) program's response to order execution gets delayed until the next poll iteration, 2) polling increases load on Zerodha's servers because of HTTP requests which could be avoided.
In case of regular orders, when there is a fill you will receive an order update with status UPDATE. In case of IOC (Immediate or cancel) there is no interim status, once order hits exchange order will be executed(can be partial fill also) or it will just be canceled. You will receive only one order update for an IOC order.
Please answer the following: Say I place an order for 100 shares with validity=IOC. What will be the postback status (CANCEL / UPDATE / COMPLETE / REJECTED) in the following 3 cases?
Case 1: 40 got filled, remaining 60 got cancelled. Case 2: All 100 got filled. Case 3: 0 filled, all cancelled.
For case 1 you will receive 3 order updates with status OPEN, UPDATE and CANCELLED. For case 2 you will receive 3 order updates with status OPEN, UPDATE and COMPLETE. For case 3 you will receive 2 order updates with status OPEN and CANCELLED.
Mentions these - OPEN, COMPLETE, CANCELLED, and REJECTED
The same documentation carries another list of statuses that seems to be non-exhaustive with arbitrarily-chosen items (screenshot below)
Could you please mention ALL the statuses in the documentation along with what they mean and what triggers them?
Without proper documentation on order status postback, how do you hope people to not resort to polling of order book (which adds avoidable load on your servers)?
By the way, if you can informally share a quick list of order statuses sent via postback, I will be able to continue my development. It's a humble request Thanks. On [email protected] please.
@sujith Your answer on June 20 was incorrect. Please take DUE CARE with your replies.
I am referring to your below answer. For case 1 you will receive 3 order updates with status OPEN, UPDATE and CANCELLED. For case 2 you will receive 3 order updates with status OPEN, UPDATE and COMPLETE. For case 3 you will receive 2 order updates with status OPEN and CANCELLED.
Case 2 is incorrect. In Case 2, I received only OPEN and COMPLETE.
I think it also depends on number trades also. If it executes in multiple trades then you will receive UPDATE status also since there will be a partial fill of the order.
you need to query the trades or positions to know if the order was in fact executed.
[Edit: I guess you already know this .. read your other posts, seems like you are looking for
response in websocket..]
In case of IOC (Immediate or cancel) there is no interim status, once order hits exchange order will be executed(can be partial fill also) or it will just be canceled.
You will receive only one order update for an IOC order.
Please answer the following:
Say I place an order for 100 shares with validity=IOC. What will be the postback status (CANCEL / UPDATE / COMPLETE / REJECTED) in the following 3 cases?
Case 1: 40 got filled, remaining 60 got cancelled.
Case 2: All 100 got filled.
Case 3: 0 filled, all cancelled.
Thanks!
For case 2 you will receive 3 order updates with status OPEN, UPDATE and COMPLETE.
For case 3 you will receive 2 order updates with status OPEN and CANCELLED.
.... and so there is an OPEN status too. I wish I knew about it earlier. I will have to rework. Sigh!
Documentation on postbacks (https://kite.trade/docs/connect/v3/postbacks/) -
Could you please mention ALL the statuses in the documentation along with what they mean and what triggers them?
Without proper documentation on order status postback, how do you hope people to not resort to polling of order book (which adds avoidable load on your servers)?
Thanks again for your efforts.
On [email protected] please.
Your answer on June 20 was incorrect. Please take DUE CARE with your replies.
I am referring to your below answer.
For case 1 you will receive 3 order updates with status OPEN, UPDATE and CANCELLED.
For case 2 you will receive 3 order updates with status OPEN, UPDATE and COMPLETE.
For case 3 you will receive 2 order updates with status OPEN and CANCELLED.
Case 2 is incorrect. In Case 2, I received only OPEN and COMPLETE.
Thank you for your effort nonetheless.
You were wrong in Case 1 also.
In case 1, the only updates are OPEN and CANCELLED.