Executed Average Price - For Traded order or Trades

kiteapi
Question:

Is there a place where we can get average_price for an executed order (not individual trades in an order), or do we have to calculate the average_price for the executed order from the average_price and quantity of individual trades under that order?

===============================================

Also, I see: trades method does not take order ID as parameter though the documentation says so here https://kite.trade/docs/pykiteconnect/v3/#kiteconnect.KiteConnect.trades:

def trades(self)
Retrieve the list of trades executed (all or ones under a particular order).
An order can be executed in tranches based on market conditions. These trades are individually recorded under an order.
order_id is the ID of the order (optional) whose trades are to be retrieved. If no order_id is specified, all trades for the day are returned.

10. trades = kite.trades(orig_order_id)

Pylint throwing error:
{
"resource": "/orderStatus.py",
"owner": "python",
"code": "too-many-function-args",
"severity": 8,
"message": "Too many positional arguments for method call",
"source": "pylint",
"startLineNumber": 10,
"startColumn": 10,
"endLineNumber": 10,
"endColumn": 10
}

Tagged:
  • rakeshr
    do we have to calculate the average_price for the executed order from the average_price and quantity of individual trades under that order?
    You can know the average price for an open position(all intra-day executed order creates open position) from Position fetch.
    Also, I see: trades method does not take order ID as parameter though the documentation says so here
    No trades() method, doesn't take order_id as optional param. We will edit this. You can look to order_trades(order_id) for all trades of particular order.
  • milli
    Hello,

    As per the documentation, I can use order_history(order_id) to fetch history of order. Howerver, I am trying to get details of an order in the past (executed on Friday 20th Nov 2020) and it returns an error.

    Similarly, kite.order_trades(order_id), returns nothing.

    Even curl "https://api.kite.trade/orders/<order_id>" \
    -H "Authorization: token api_key:access_token"


    returns
    {"status":"error","message":"Couldn't find that `order_id`.","data":null,"error_type":"GeneralException"}
    Please advise.

    Thanks
  • rakeshr
    Howerver, I am trying to get details of an order in the past (executed on Friday 20th Nov 2020) and it returns an error
    You can only fetch current day order details.
Sign In or Register to comment.