I placed a 2-leg multileg order via /api/v3/multileg/orders/sync (NSE:NIFTY26AUG24000PE sell + NSE:NIFTY26AUG23900PE buy, qty 65 each) and got ‘Margin Shortfall: ₹1,60,863’ — but the exact same spread built in your own app’s ‘Create Strategy’ tool shows Funds Required: ₹37,791.85. Why does the multileg API price this so differently from the app, and how do I get the API to apply the same combined-margin benefit?
Hi Sonal,
Sorry for the confusion. Multi-Leg API does not work like basket orders in the UI.
With a Multi-Leg order, all three orders are executed together, and the hedge benefit on margin is not available (currently).
In contrast, the Multi-Order API sends orders sequentially. If the buy orders are placed first, the hedge benefit will auto apply.
Therefore, instead of using the Multi-Leg Order API, please use the Multi-Order API, which behaves similarly to basket orders in the UI and provides the required margin benefit.
Refer API Doc for multi-order API: API - FYERS
Thanks for the reply. I will use multi order. But i preferred multi-leg because of the atomic filled or cancel order feature as in multi order i need to manually handle 1 leg getting filled and another not able to be filled.
But nevertheless i will go with multi order. Thanks once again.