working with bracket order

itsram90
Hi Team,

for example if i want to buy 1000 shares of x tradingsymbol using bracket order and it gets executed in many parts suppose 100 parts. then it will create 100 sl and target orders.

if i want to modify SL orders and target orders, is there a way to modify all SL/target orders (generated by that main 1000order) in one shot or i have to go one by one to each and every order and modify it.

also when we are going to have limit cover order in zerodha?

Thanks
Ram
  • sujith
    Hi @itsram90,
    You will get an order id after the bracket order is placed. After first leg order is executed, you will have second leg target and stoploss orders, these children orders will have a parent order id.
    You need to fetch orderbook and loop through all orders for parent order id same as first leg order id.

    The limit cover order is on our list. We will provide it soon.As of now, we can't guarantee any timeline as we are working on revamp of core APIs.
  • itsram90
    Thanks sujith
  • itsram90
    biggest challenge is that for any big position if i use BO for cash and my child orders are 50+ then it will be very problematic to update all of them as i will be hitting 3 hit/sec limit easily.
    bracket orders are really useful as they keep target and stoploss together,, with CO it only generates two orders doesn't matter in how many pieces my parent order is executed.

    i think it will be useful if OMS allows us to update all child target orders in one hit and SL orders in another, i guess by using order type and parent order id as key fields it can be done.

    this looks like OMS feature, not sure how much changes can be done here, anyway thanks for your support
  • rahulchitale
    @itsram90 its pretty trivial to iterate through all the square off child orders and amend prices on them programmatically. The modify_order is a bit of a pain because it needs almost all parameters to be repeated but works well with BO as well. You should be able to rig up your own wrapper to update all child orders given a parent_order_id fairly easily. Of course, it does necessitate multiple calls which might present a timing issue.
  • itsram90
    one doubt, in this scenario charges like brokerage,stt etc will be calculated based on one parent order or multiple child orders ?

    for ex if i buy 10000 shares and it got executed into two parts then do i need to pay 40+40 rs brokerage or just 40?
  • sujith
    Hi Ram,
    Brokerage is charged on executed order.
    In this scenario, you will be paying brokerage Rs40 or 0.01%
  • itsram90
    thanks @sujith , i was going through zerodha q&a articles about this topic and found that its tricky. please correct me if i am wrong.

    Suppose i placed 100 qty for buy using BO and my order got separated into 2 parts. now while opening position i will only be charged 20rs

    after this there are two ways of closing position,
    1st. if your target hits for both target orders and
    2nd. if you choose to exit position using exit button.

    in 2nd method my complete position will get squaredoff at market and i will again paying 20rs so by total 40 rs of complete buy and sell
    whereas in first method i will be charged 20 and 20 for two target orders and my total charge will be 20Buy+20sell+20sell=60rs.
    This is what i understood from that thread, that thread was very old so not sure if anything got change but please clerify if above is correct or in all possible scenario my charges will be 20Buy+20Sell=40 rs.

    Thanks
    Ram
  • sujith
    Hi @itsram90,
    After you place a bracket order, for the first leg you will be paying Rs20 or 0.01% whichever is low. If it executes in two trades then there will be two pairs of exit orders. When the target is hit for both pairs, you will be paying Rs 20+Rs 20 or 0.01% of brokerage. So total brokerage you will be paying is Rs 60 or 0.01% whichever is low.
This discussion has been closed.