Question: (a) If we use (GET /orders)—where will I get the price at which order is partially filled? The documentation says that retrieve order will populate average_price when order status = "COMPLETE" which will not be the case for partially filled orders.
Question (b) If we use "GET /orders/:order_id" then we are provided the entire history of an order, is this history is chronological order(i.e. in a sequence with last one being the most recent) ? If not, how should we read these records to identify the most recent update on the order.
Quick follow up, order history is in chronological order. Hence, if an order is at first partially filled & subsequently fully-filled then we will get both these entries via "GET /orders/:order_id"(along with other statues the order has travelled via OMS) & if we read the last record, we will know the average_price & filled quantity.
So, why do we need a separate trades API? Is it normally only used with GET /orders and why not only use "GET /orders/:order_id"?
https://kite.trade/docs/connect/v3/orders/#retrieving-an-orders-trades
b. Yes, order history of an order is in chronological order.
Quick follow up, order history is in chronological order. Hence, if an order is at first partially filled & subsequently fully-filled then we will get both these entries via "GET /orders/:order_id"(along with other statues the order has travelled via OMS) & if we read the last record, we will know the average_price & filled quantity.
So, why do we need a separate trades API? Is it normally only used with GET /orders and why not only use "GET /orders/:order_id"?
There is only a new entry in order history when the status of the order changes.
Until the order is fully filled,it will remain in 'OPEN' state.
So,to get all the trades spawned by an order, you have to use trades API .