Basket orders with dhan api

I’m creating a simple algo with dhan api.
in that i need to place multiple orders for to hedge but the problem is the margin required is large if the orders being triggered individually and i checked over the app if they are executed as basket the margin required is much less so is there an options provided by the api to basket orders before of while executing.?

Fire your hedge leg first. Then fire your heavy margin blocking order. This way u will get hedge benefit after order execution.

1 Like

Have you faced the same problem. Ever before
The problem is that it still the same. No hedge benefit it is considering them to be completely separate orders.

Dhan has multiple issues with margin update unlike other brokers

  1. 500 ms delay if you are unloading an existing margin blocked position for release of the blocked margin

  2. If we have put an exit long order for an existing short position, margin is not released just because we close the short position. We have to close the exit order separately also to unblock the entire margin used for the short position

  3. If you have two long positions and a short position for the same underlying the hedge marking system marks both as hedge legs and so exiting either one of the long legs is blocked even though one leg can be easily released without affecting the margin required to hold the short position.

Other than that if you have a long and short leg even if fired separately the hedge benefit is received.

1 Like

Take the example of today itself I had two buy orders and one sell order to be executed at some condition but the margin if they would have been considered a basket would be around 140000 but as the hedge benefit for them was not provided whole fund of 431000 was blocked.
It makes a problem to even exit the position as that time it will again consider them as separate order and would require separate margin for them.
Isn’t that the case?

you seem to have run into Dhan margin update delay issue as I posted earlier. Keep a sec delay between each order and try.

1 Like

I can give that delay but isn’t there any other solution to it as it’ll affect my algo efficiency