I am trying to place an bracket order but its not working, the order what gets placed is mis and not bracket order(BO). please check and let me know if I am doing something wrong pleace check the parameters below. Below is the url with parameters.
Once the first leg is placed, there will be two second leg orders which will be a LIMIT order and SL-M order. You can modify trigger_price for stop-loss and modify price for the limit order.
You need to fetch orderbook and look for orders with parent_order_id same as the order_id. If it is target LIMIT order then you can modify the price and if it is stop-loss SL-M order then you need to modify trigger_price. This is the only available way to modify second leg orders.
You are placing the order as regular hence it is placed as MIS order.
Your URL should be something like https://api.kite.trade/orders/bo and send params in the body.
You can check out example for sending params here.
You can modify trigger_price for stop-loss and modify price for the limit order.
now I can only see a way where i have to get all orders then scan each order parent id
isnt there a like a custom search order where i can just put condition like
show orders where parent parent_order_id = "XXXXXXXXXXXX"
This is the only available way to modify second leg orders.
You can take a look at example here.