@Naman I have reported this issue to you. I have shared multiple instances where API orders are failing because of margin updation delay. Do we have a timeline from Dhan Engineering for a fix?
@VijayNair as a trader myself I can understand what u feel. Our money shouldnât go down the drain for no fault of ours. I feel accountable for nudging you towards Dhan. I am doing all that is within my capacity to get the issue fixed. Dhan team has also informed me that they are working to fix this. Hopefully, soon this will happen. Can you please in your code do the following if you are not already doing these as a temp fix ?
Check the trade status of the hedge leg to see whether it is traded. Note that there is also a postback feature when we generate an API token to get alerted on order status changes. It can be used if you donât want to keep polling for the order status.
Once a hedge leg has traded, give a delay of 3Sec before firing the short side trade for the time being until Dhan fixes the delay issue.
I squared off short call , after that when another short call was placed, it failed. The call failed 4 sec after the initial call square-off. Yes I have set delays to give super-fast-lightning Dhan time to update margins. Margin shouldnt have been an issue at all.
Oh K. Then before placing the next short call after a prior short call exit can a 3 Sec delay be added for the time being ?
Yes, Dhan has an extra delay issue that needs a fix. Not an edge case at all. This can be consistently reproduced and replicated as a behaviour of the underlying OMS.
@VijayNair any issues today after u increased the order placement delay ?
Does this mean that u fired each successive order 4 sec apart or just that the latter of the two orders you fired one after the other executed and failed 4 sec later relative to the first order ?
Thatâs the timestamp difference for those orders. Some code operations were run after square off and b4 reinstating.
@Naman called and assured me he will look into logs and figure out if something is amiss. Also told me this margin delay has only been reported by us and he hasnât received any other such complaints.
I have set a 3 sec delay now. Coincidentally havenât faced any failed order issue since.
@Naman I had shared you delay issue reported by couple of other users also (comments only) in addition to @VijayNair and my failed orders. Similar issue has also been reported verbally to me by other fellow traders who did vertical spreads. The issue happens when available margin is not enough to open a new position (margin req more than available margin) and then
If we have an open short option position, we exit that and place a new short option order, the latter fails even if the margin needed for latter is less than margin needed for former.
If we have an open long option position, we exit that and place a long option order, the latter fails even if the margin needed for latter is less than margin needed for former.
If we first place a hedge long option order (gets traded) and then a short option order, the latter fails even if the hedged margin required is within the available margin.
In all cases order goes through if done after 2 sec delay. There are other scenarios as well. I have listed just the ones I have experienced myself.
Well no such thing, we continue to make our platform better everyday. Our team has reviewed logs for the orders mentioned by you and @t7support and are checking the same. My guess is this may take some, at it affects core trading system and we will have to get the solution tested once developed over couple of mock trading days. We will keep you posted.
i am also facing similar delay issue , even while placing 2 legged strangle orders thru basket. almost 2-3 orders fail on every 10 orders. so far only temporary solution is 3 second delay as mentioned by you guys. also trading monthly options in zerodha & fyers and cant recall if i ever faced similar issue over there.
Hi @Vikas.Y Just checked, your orders from basket failed for regular margin shortage. Issue mentioned on this thread is very very specific one, does not happen for basket orders.
not talking about todays order. today one leg in market basket order went to pending state therefore other leg was rejected. that i understand.
but some times one leg get executed from same basket but other leg rejected due to margin short fall. if i again execute rejected leg with same quantity and margin requirement ,but after 3 sec+ delay ,it gets executed . with no margin shortage.
Yes Vikas, we have noticed this is in case where trader is getting a hedge benefit however the transaction leg for which the hedge benefit was available gets executed later.
Do share the specific case if you encountered this on help@dhan.co and we will have this reviewed.
I mostly trade via API, and I havenât seen this âmargin updation delayâ before with any other broker⌠I suppose slower reacting discretionary traders at Dhan will not be affected.
Hi @VijayNair We have pushed newer updates on API for faster traders over the weekend. Depending upon which instance of order management you are connected on DEXT - you will observe orders are now much faster than prior. Over next 4-6 weeks this will be available on all instances of DEXT.
Margin one is a unique problem now - in few situations where volumes of traders are higher, release on margin now has to become near instant on successful order placement. Work in progress at our end.