How to get pending orders ?

Vishnuvardhan
Vishnuvardhan edited September 2022 in Python client
Dear Zerodha ,

May I know is there any direct function to get pending orders ? except the way to get all orders from kite.orders() and then filter ?
  • SRIJAN
    SRIJAN edited September 2022
    No,you have to fetch orderbook and then filter by checking status of every order.

    If status is not one of COMPLETE, CANCELLED,or REJECTED,that means it is a pending order.
  • Vishnuvardhan
    Vishnuvardhan edited September 2022
    ok thanks @SRIJAN

    Also, one more question . How to get only open positions ?
  • sujith
    You need to fetch positions and check the quantity field. If it is negative then it is short position, if value is 0 then it is a squared off position, if quantity is positive then it is a long position.
  • sujith
    Use net positions list form the positions response.
This discussion has been closed.