How to i get order id for the square of and target-order for BO order

Jignesh
Jignesh edited July 2018 in Python client
I need to place cancel_order() and exit_order() for all open order in python.
  • rakeshr
    @Jignesh
    To exit all quantities for BO, you can cancel any one order either limit or stop loss order.
    If you exit limit order then limit is executed at market and corresponding stop loss order is cancelled.
    Your childOrders list can be populated by filtering orderbook with two conditions,
    1. get orders with parentOrderId param, same as parent order id.
    2. get all limit orders or get all stop loss orders and place cancel request for these orders.
  • Jignesh
    Thanks @rakeshr .
    I am able to exit limit order in a loop for all order where status is "OPEN".
    The difference between cancel order and exit order is not clear, and whether to cancel or exit a order with status as OPEN or TRIGGER PENDING.




Sign In or Register to comment.