Do I need to call "DELETE" twice to exit bo?

g0g0l
When entry part of bracket order is executed, there are 2 open orders: a limit and a stoploss order. Both have order_id and parent_order_id. Do I need to call "DELETE" for both of the orders to exit the bo?
  • sujith
    sujith edited May 2017
    Hi,
    Check out example for bracket order exit here.
  • g0g0l
    Yes, in this example the parent_order_id is passed only once. But, when I retrieve all pending orders, 2 open orders will come for every bracket order. Will it create any problem if I place DELETE order twice for these 2 orders?
  • sujith
    Hi,
    Users don't have to cancel the second leg orders. We take care of exit.
    One order is converted to execute at market and another is canceled.
  • g0g0l
    g0g0l edited May 2017
    Ok so I can cancel ANY one of these orders? and other will be taken care of automatically?
  • sujith
    sujith edited May 2017
    Hi,
    Users can't cancel both orders. A user can only exit bracket order. There is no cancel order API for bracket order. All bracket orders are intraday orders. One has to close position by end of the day.
  • g0g0l
    According to the docs, "cancelling" regular order and "exiting" bo are done using same "DELETE" operation. But calling "DELETE" on bo (for both second leg orders) giving me "400" error. My question is two fold. Why is 400 error ?and Do I just call "DELETE" for any one of the second leg orders?
Sign In or Register to comment.