Command to check pending orders

AnkitDoshi
Hi,
Went through the API but couldn't figure out the command to check for pending orders

A little help reqd. please!!
  • Matti
    @AnkitDoshi https://kite.trade/docs/connect/v1/#orders seems quite clear about this. Just do a getOrders() call and then check for status on your end. If the status is not cancelled, completed or rejected, it means the order is pending.
  • AnkitDoshi
    @Nikhil.A
    In Python?
    kite.orders() gives me list of all orders. What is command to get pending orders?
  • sujith
    Hi @AnkitDoshi,
    There is no separate API for pending orders. You have to fetch whole orderbook and filter pending orders as mentioned by Nikhil.
  • sr11
    @sujith

    I am trying to code the logic of 1) Cancelling BO orders that never got triggered and 2) Cancelling Partial lot (volume) BO orders that were not triggered i.e. For the remaining volume the order is still not executed.

    I see the status as OPEN and not PENDING. How do i fetch such pending BO orders to cancel

    Thanks
    Srinath
  • Kailash
    @sr11 There is no pending status. It's "OPEN" (0 filled and partially filled). You can look at the product or variety field to check for "BO"s. Second legged orders will have a parent_order_id as well.
  • sr11
    @Kailash

    As i see in my kite orderbook, there are 2 types of BO orders (irrespective of filled or partial). One is BO-BUY-OPEN and the other is BO-SELL-OPEN, I want to cancel the BO-BUY-OPEN which is essentially the pending BO orders. If i filter open orders with BO & OPEN then it can even cancel pending Sell orders right?

    -SR
  • Kailash
    Then you just filter by transaction_type as well, which is either BUY or SELL.
  • sr11
    @Kailash

    I was able to correctly filter out the orders i wanted to cancel. Currently getting an exception

    #1kite.order_cancel("1200000001907812", variety="bo")

    raise(exp(data["message"], code=r.status_code))

    OrderException: MSG_FAILURE

    #2kite.order_cancel("1200000001907812")

    raise(exp(data["message"], code=r.status_code))

    OrderException: The order couldn't be cancelled

    -SR
  • Matti
    @sr11 Can you share your client ID in a private message? I can have this checked.
Sign In or Register to comment.