Could'nt find order_id using order_history. Can I get orders / trades executed yesterday using this?

sriramshankar
Hi,

I am using the Python SDK to get orders and trades. I placed some orders yesterday. I am trying to execute the following commands:
kiteConnect.order_history(order_id=oid)
I get the following message: kiteconnect.exceptions.GeneralException: Couldn't find that `order_id`.

Is there a time limit to retrieving orders and trades executed yesterday ? If so, how does one get orders executed yesterday?
  • sujith
    Kite Connect only has trading capabilities. It doesn't contain backoffice APIs, hence it is not possible to fetch orders you placed yesterday.
    Everyday after BOD process, orderbook is cleared. You will have to store orderbook if you want to use it next day or use it in future as well.

    You may checkout order history API here to know more about what it does.
  • rakeshr
    Is there a time limit to retrieving orders and trades executed yesterday ?
    Yes, you can fetch orderbook only for the current day, not for the historical orderbook.
    If so, how does one get orders executed yesterday?
    Currently, this is not available in APIs out of the box. You will need to store or dump the complete order book of the day, possibly by the end of the day, and retrieve it later based on your requirements. This open-source project explains the concept in detail.
  • sriramshankar
    Thank you sujith and rakeshr. This was helpful. I will checkout the links you provided.
This discussion has been closed.