Partial Quantity Exit From BO Order

Hey there, Dhan is one n only aggressive innovative broker in the industry, they always listen from their customers and always pay attention to then and work to make those instruments that can help a scalper to Investor,
They brought back BO order in options that is blocked by exchange, but there is a inheritant problem in BO order that is we can’t exit partial quantity in This nor in CO order. we choose BO/CO because it set SL n TL by default and if any one gets triggered the other one gets cancelled automatically.
But imagine i took a trade in Futures or in cash in BO/CO Order, and i feel that the stock or the futures (including NIFTY OR BANK NIFTY) is to looses its momentum but i can’t sure about it because my Target is higher from the LTP so i can do one thing, i may book profit in half quantity and trail the sl of Remaining quantities above cost price, it only not remove the fear of running out of profits and also i will be in game if the stock or index goes in my direction i will book profit in the remaining half quantity or if it tries to reverse it will hit my TSL which i trailed above my cost price, also i had already booked some penny by booking the profit already. i mailed so many brokers to add this feature but no one did this as they are only in the business of making money by doing least work.
so let’s see how Dhan took the step
thanks you

1 Like

Hey @Bigbull, thanks for the note. Bracket orders are hard to execute, specially in these volatile times and on expiry days. We have seen 2-3 odd instances where both legs get executed as markets moved rapidly. You may recollect we removed BO and brought to back again just to ensure that the order execution stays flawless.

For managing part position better, we have some thoughts - but all that is in early stages as we are continuing to monitor the performance of bracket orders and evaluating if we have to keep them or skip them. Traders love bracket orders on Dhan.

For users you have your specific use-case, we have seen them using draft orders as they would like to make these decisions in advance, and take them when timing is right., just as you mentioned where you saw an opportunity.

That aside, if you are taking these trades based on the underlying and tracking the underlying spot on TradingView charts, we will introduce something interesting soon.

Hello team
I’m using your DHANHQ python now I’m facing a problem for a logical thinking

For example if my target is achieved then how can I exit my half quantity only

Now I’m placing a robo order jo ki mere target and stoploss pr meri puri quantity ko exit kr de rha hai so mai abhi ye chahta hu ki apke DHANHQ ko target and stoploss price de du and jab stoploss achieved ho tab meri full position exit ho Jaye ya fir target achive ho to meri sirf half position hi exit ho

And I’m using your historical api so that I’m getting live data jo ki me yaha se manually order target point pr nikal saku

And also Mai FOREVER apka use Kiya hu jo ki sirf carryforward position ke liye work kr rha hai abhi iska kya solution hai pls reply

So sorry for long query …

Hello @mahesh0842

If you want to build a system in Python, which makes this logic work for you, then it is easily attainable.

Here’s my approach to this (might miss a couple scenarios so anyone who can correct me, will really appreciate that)

  1. Place a normal order for your entry (not a BO order as the exit orders, both Target & SL quantities would be hard to modify)
  2. Add two orders for Stop Loss and Target (SL with entire order quantity and target with half quantity)
  3. Build an OCO check - using webhooks or polling Trades of Order API, to keep a check on order filling status (at defined intervals depending on segment traded and volumes present). EG - lower gaps in Target and Stop loss will require you to frequently poll API to get order status and vice versa.
    a. If SL is executed, cancel target order
    b. If Target is executed, place another Target order for remaining quantity and modify SL order Quantity and Price (depending on your strategy)
  4. Monitor these two orders and repeat step 3, depending on your strategy.

Hope this helps! Would love if someone from community can pitch in if they have built similar system,