Order placement - Error

@Dhan_Help @PravinJ @Naman

I had a basket order set to be triggered via tradingview webhook. The TV alert fired and basket got triggered for execution. But the sell order for 18400 put failed.

As you see the 17700 put short leg was exited first. Therefore no hedge break risk for 18400 exists at that point and order for 18400 put should have gone through but it didn’t.

Now I have to hold 18400 put overnight which I did not intend to do. Please avoid these kind of issues.


Happened to you on such a crucial level! Damn! Hope Decay works in your favour! :crossed_fingers:

@PravinJ @Dhan_Help @Naman

Thoughts ? The same error also happened with my fellow traders. We don’t want to run into same issue again. We need assurance from Dhan on this.

Hi @t7support

We are having this checked with our concern team and will update you soon.

I had same issue. The sell order for put didn’t executed showing an error for hedge risk.

Hey @t7support ,

Very critical issue…

Have you ever experienced such issues on any other broker platform?


No never faced such an issue with any other broker. But we have to note that only Dhan provides hedge break alerts along with order placement via tradingview webhooks.

1 Like

It shouldn’t matter, since it should be an extension of the same functionality via API I suppose.

Yes the bug is in hedge break alerts.

@Dhan_Help @PravinJ @Naman pls disable this feature until the bug is fixed. The error happened today also. This bug is hampering our trading experience with Dhan.


Why is the Quality Control so casual? I remember facing glitches while placing orders using the “+” sign and had faced a loss due to it. I requested Dhan Help to fix it. Maybe the traders weren’t using that feature as the bug remained for quite long and was left unreported until I raised it several times.

These features need extensive real market testing before releasing I believe. We are understanding people and adjust for the time being till it gets fixed but newbies will just leave.

Please Dhan team, You have such a high capable platform and amazing team, try to avoid these common glitches so that we enjoy using Dhan without a second thought about any other broker!

Peace :v:


I agree on this. Yes ,you have a fantastic dev team and customer support, but when customer’s penny is involved, you should be doubly sure of the features you are releasing, pass thorough regression testing.


@Dhan_Help @PravinJ @Naman @Hardik

This happened again today.

Pls pls fix this

1 Like

hi @t7support

This isn’t a bug, we have mentioned it here - it’s alert when you are trying to exit a position on which you have a hedge benefit.

More on these alerts here: Update for Option Traders: Introducing Alerts on Breaking Hedge while Trading on Options on Dhan

Earlier when traders broke this hedge, there was a penalty that was being passed on to clients. Exchanges / Regulators have now prohibited brokers to pass on the penalty to clients - so if you exit, the penalty will still be there and Dhan will have to pay it. Hence to avoid such situations, we have introduced this alerts.

1 Like

@PravinJ This is a bug !!!

Last week I had sold 18900 call and bought 18300 call. Today from the basket order I first bought back 18900 call. Then tried to sell 18300 call. There is no hedge break scenario here.

Please fix this error.


It seems Dhan backend is not recognising the non existence of the short leg with in the milli second delay the next exit order of the long leg is placed when fired via the basket order.


This bug essentially means we cannot exit hedged positions via basket orders directly or via TV webhooks. Please disable this new feature until the bug is fixed or fix it ASAP.


@PravinJ @Dhan_Help @Naman @Hardik

The error happened again today.

How are the orders sent out when a basket is executed via tv webhook ? Is it in sequential top down order as set in basket ? Is it that all orders in basket are sent to exchanges in one go and so there is a likelihood of the order queue changing (different from the set basket)


Dear Dhan, I have already pointed this in a different context at the thread
“Yes Pj and Naman… Please give the user a way such that if the 1st leg is successful then execute the second leg so on as so forth . In this way we can avoid margin issue. Also, if you can allow drag and drop strike prices as per user preference is his order of preference that would be great”

At least implement this for market order. though limit orders in basket order may be an an bit complex in implementation

The full thread is given below

Hi @t7support

We have gone through your order logs and found out few things. This is a rare phenomenon and can happen with anyone. There is little control of broker in this. Here is the explanation:

Let us first understand the execution of Basket Order. The basket order is placed in the same sequence as arranged in the basket. You will get the hedge benefit upfront (or the overall margin will be same as shown in basket) only when the sequence of execution of orders is followed. There may be a case when your first order (say Buy market order for options) is placed first but didn’t execute or executed lately for some reason. And then second order ( say Sell market order for options) is placed. Since the Buy order is not executed, so your Sell order may reject if there is insufficient funds. The reason for non-execution or delayed execution of Buy market order can be anything : Low liquidity or MPP on options so market order is converted to limit order or delayed response from exchange etc…

Next let us understand the concept of “Hedge Break Alert”. In the above case, if all orders are successfully executed, you will get upfront hedge benefit, hence lower margin requirement to execute option strategy. Point to note, the Sell leg (short position) is hedged by the Buy leg (long position). The standalone short position has higher margin requirement than with a hedge. So if you try to exit long position first, then you must maintain sufficient margin to sustain standalone short position or exit the short position first. If this is not followed, our system will alert you about the Hedge Break and will not let you exit the strategy to avoid any margin shortfall.

Now in your case, you are doing it correct with basket order. Exiting the short open position first (with Buy order of 18050 PE) and then long open position (with Sell order of 18600 PE). But for some reason (it may be any as mentioned above but non exhaustive) your Buy order of 18050 PE is not executed before the Sell order of 18600 PE is placed, hence you got a hedge break alert message. All this happened in fraction of second. Though after few millisecond the Buy order of 18050PE is successfully executed as it was placed earlier. Later when you manually exited 18600 PE it went successfully.

Trust me, all this happened in fraction of seconds.

This is very rare, and cant be controlled. The only suggestion from my side will be to avoid trading in illiquid contracts or try placing order manually. Even if you are automating your system, make a rule to place next order only when you have a confirmation of successful execution of first.

Hope this helps!


yes this happened sometimes. but experience is fantastic with @Dhan