Why are tags used when we have Order ID to query status of orders? The only use-case, I can think of is “partially filled” orders—I am assuming that Z will create a new order id with same tag—if the entire quantity is not filled. Can you please confirm?
Also, what are the other important reasons because of which tags are used by developers while placing orders -- I am almost certain that I am missing some very important used cases.
For example, let's say you run 3 different strategies,and then all of them place orders in the same instrument.
When you fetch orderbook to check,you can't know which order was placed by which of the 3 strategies .
But ,what you can do is send specific tags with orders sent.
Like, send 'strategy 1' tag for all orders sent from first strategy.
When you fetch orderbook,filter according to this tag,and you will get all orders sent from the first strategy.
Thanks, can you please confirm that “Z” will create a new order ID in case original order is partially filled(when second or third order are executed to complete the fill) - or is it handled via "filled quantity" ? Also, if multiple orders are placed because the first order was partially filled – will the subsequent orders have same tags?
Furthermore, was going through the forums and looks like tags will need to be used because it's possible that order ID is not returned, but order was placed. Is this still the case?
Only one order is created for each order placed by the user. When there is a partial fill, only a new trade is created. When there is a fill, filled_quantity, pending_quantity fields are updated. You can know more about the trades here.
Regarding order id not being returned,I have personally never faced this issue.
Still,if you want to use tags to overcome this issue if it occurs,you need to send a unique tag with every order as told by Sujith Sir in your mentioned thread.
Tags are sent with orders. The trades don't have tags.
It's not possible that filled quantity equals ordered quantity and status won't be 'COMPLETE'.
You can use filled quantity or status , whatever you like,not that anyone is better, status as 'COMPLETE' means filled quantity equals ordered quantity.
https://kite.trade/docs/connect/v3/orders/#tagging-orders
Tags are used to filter orders.
For example, let's say you run 3 different strategies,and then all of them place orders in the same instrument.
When you fetch orderbook to check,you can't know which order was placed by which of the 3 strategies .
But ,what you can do is send specific tags with orders sent.
Like, send 'strategy 1' tag for all orders sent from first strategy.
When you fetch orderbook,filter according to this tag,and you will get all orders sent from the first strategy.
Furthermore, was going through the forums and looks like tags will need to be used because it's possible that order ID is not returned, but order was placed. Is this still the case?
https://kite.trade/forum/discussion/comment/35814/#Comment_35814
filled_quantity
,pending_quantity
fields are updated.You can know more about the trades here.
Still,if you want to use tags to overcome this issue if it occurs,you need to send a unique tag with every order as told by Sujith Sir in your mentioned thread.
So, query order book for tag, get order id then use "Filled quantity" to know if the order is completely or partially filled.
Have you come across a case, when filled quantity eq ordered quantity but order status is not equal to Complete
I am trying to figure out which field is better to know of the order is completely filled( filled quantity or order status)
Thanks
It's not possible that filled quantity equals ordered quantity and status won't be 'COMPLETE'.
You can use filled quantity or status , whatever you like,not that anyone is better, status as 'COMPLETE' means filled quantity equals ordered quantity.