Basket Order Trigger - Not Based on Sequence

Hey @VijayNair

Here’s a benchmarking that we did for one of the broking platforms when we had this conversation last time. We tried to place orders both via their baskets as well as their APIs to check how they are processing orders. While the API orders failed as they were sent one after the other, the orders from the basket on their web went through with some delay. Also, we noticed there was a gap in between the orders from the order number as well for both the legs.

As I recall from our initial conversations, you were primarily trading via APIs. Wondering the reason to shift to basket based execution.

Yes, I primarily trade via API… but execute baskets from time to time.

It is possible I never face issues on Z because I always have plenty of margin. My problem with Dhan was more than just what you depicted above. Orders were sometimes failing(due to margin issues) even with 1-2 sec delay (many months back). I am told this has been fixed since… but apprehensive as @Castelinojason still faces issues wrt order slicing.

For now I am trading a low freq OB strategy manually on Dhan. Will be automating it once the login issues are sorted (as per the new rules).

Thanks @PravinJ @Hardik for the detailed response from a developer stand point.

Let me give a trader perspective. While a reasonable speed of execution is desired a reliable order execution is also very much desired. It is like driving the car to reach point B from Point A at moderate speed and not crashing rather than driving at top speed and crashing often.

Hedge margin benefit is available for traders and that must be available to them while executing orders. If they are closing an open position which releases margin to open a new position that should be available while executing orders. I fully understand that the first leg should get executed and instant margin updation should happen before the margin is available. This is why zerodha does this and ensures succesful multi leg basket order execution.

We just need the minimum delay required for order execution under the condition that we place a market order in a highly liquid instrument like Nifty FnO. Infact that is what we do. Any other situation beyond it needn’t be catered to. If you are not comfortable adding tiny delays like zerodha between legs then you can atleast try sending the orders in sequence depending on margin availability - a functionality like Iceberg + you have already implemented at this point :point_down:

With API orders we can add delays in code to ensure order execution. In the case of basket orders however we cannot. This is where we need the broker to act. Few ms delay and even few hundreds of it manual traders can’t perceive. What they do well is to note order execution failure.Then try again to execute the failed order - already few seconds have gone by causing excessive slippage. Situation can be even worse if the basket is fired in auto mode and one leg gets rejected and we are not around at that time to fix the issue.

2 Likes

I am not basing my opinion on the perception of how Dhan operates. I am your avid fan and have written many good things about you. see https://viswaram.com/how-to-get-started-with-algorithmic-trading-algo-trades-9b146b6af8ee

The objective of this post was to show you how a position that requires 13 lakhs final margin asked me to keep a balance of 42 lakhs, which also means I am not able to utilize this margin for any other trades.

If your basket shows an order margin of 13 lakhs, then it should work if I have a balance of 13 lakhs+10%. To make this happen, the basket has to work with the buy order first followed by the sell order.

I am not asking you to make any changes to the existing basket orders; I am asking you to create a new product that processes the items in a basket sequentially and allows the customer to select the time delay.

I may be okay even with a delay of 5 seconds, others may require 1 second etc.

Only if we have the sequential basket, a webhook will make sense.

If you don’t fix this, as soon as the webhook opens up with other brokers, you will see a mass exodus. As a trader, I need to protect my capital, and it’s nothing against a broker.

That is also another idea. Create a new Flexi Basket Order :grinning: Or just give a new Flexi option in current basket order.

Yeh Diwali Flexi Wali, Yeh Diwali Dhan Wali

1 Like

1 Like

@viswaram @t7support We’ve taken note of this and are actively exploring a solution to address it. Our team is looking into the best possible approach, and we’ll share an update once we have more clarity.
Thanks for your patience and continued feedback.

3 Likes

Thats more like it… Great. Do let us know once you have fixed this.

Thanks. Appreciate it very much… :pray:

Just to show you how much hedge benefit we are losing.


This order has a final margin of 22.86 lakhs, if the buy order gets executed first.

But Dhan asks us to maintain 98.62 lakhs.

Irrespective of the size of your trading account, a 1:4x margin requirement is really crazy. Hope @Alok_Pandey got its seriousness.

3 Likes

If these were expiry day contracts like SENSEX then even more money need to be brought in unnecessarily.

Any update on this after 2 weeks of active exploration @Alok_Pandey ?

Glad to know Yashraj joined from Dhan team on the SCORES complaint. I have detailed to him how the sequence order has to work for basket orders.

Look forward to the bug fixes.

1 Like

1 Like

1 Like

1 Like