What is Multi Leg order in FYERS API document , can someone explain me to understand this concept . Chirag , su_yaSSH
@sathishmurugan450-phl
It is similar to Basket order BUT here in Multi-Leg order ALL legs are sent to the exchange in a single bundle at once instead of separate orders, to get effective margin benefit irrespective of first buying hedge strikes.
But if we place an multi leg orders using Basket orders also we will get margin benefit right ? then what the benefits in using Multi leg orders . can you please explain with some example orders .
- It is a new feature slightly different than Basket-order, supported by NSE exchange only.
- Here we can place only FnO legs of same underlying scrip.
- Max legs allowed in one order are 3, all should be valid and liquidly available for execution all at once.
- Brokerage will be as per number of legs, and not per order.
- It is useful for placing orders for Options Strategies.
Here is one test example (it will not execute as Limit Price is not nearby market) -
{
"orderTag": "test3legs",
"productType": "MARGIN",
"offlineOrder": false,
"orderType": "3L",
"validity": "IOC",
"legs": {
"leg1": {
"symbol": "NSE:RELIANCE24JULFUT",
"qty": 250,
"side": 1,
"type": 1,
"limitPrice": 3000
},
"leg2": {
"symbol": "NSE:RELIANCE24JUL3120PE",
"qty": 250,
"side": 1,
"type": 1,
"limitPrice": 50
},
"leg3": {
"symbol": "NSE:RELIANCE24JUL3140PE",
"qty": 250,
"side": 1,
"type": 1,
"limitPrice": 60
}
}
}
Basket Order is a solution from brokers side to the problem of making multiple orders but exchange will treat them separately.
Multi-Leg Order is now a feature supported by NSE. You will get single Order ID from exchange side for all legs.
@nsuyash11-m18 Thanks buddy for your clear explanation ,
Thanks @nsuyash11-m18 for the responses.
Multi-leg order allows all orders (Legs) to be sent to the exchange together as a single order.
Why Multi-leg order?
This guarantees the execution of all legs together, ensuring that you won’t have any naked open positions without a hedge.
For example, in a hedging position involving a sell and buy option, both legs are sent simultaneously, and also provides margin benefit.
Both legs must be available for immediate fill; otherwise, the order will be rejected.
This means either all legs will be executed together, or none will be executed.
How it’s different from Multi Order API ?
In the Multi Order API (which works like a basket order), one order can be executed while another can be rejected. This carries the risk of executing positions without a hedge.
Important Notes:
- Currently, only limit orders are allowed.
- No more than three legs are permitted due to exchange limitations.
- Order Validity: IOC (Immediate or Cancel).
- Only the NFO segment is allowed.
- One OrderTag for all legs.
- The order book will show differences between Order ID and OMS IDs with Leg1/Leg2/Leg3.
- All legs will have the same Exchange Order ID.
Hope you all like this feature, we would love to hear your feedback.
Thank you for choosing FYERS, Happy Trading.
Hi @naresh_janagama, is there an option to have partial fill?
For example if order is placed for 100 quantity but only 50 is available (on both legs), the multileg order is getting cancelled.
Is it possible to have the option for it to fill available quantity?
@siddarth.raghutaman-l28 Yes there is an option to fill , it depends on the bid and ask , Your order is getting cancelled as Multi-leg works on IOC and if there is no bid and ask the order will get cancelled
Let’s say I want to SELL 100qty NIFTY24JUN25000CE at 100rs and BUY NIFTY24JUN26000CE at 25rs
Current highest bid for 25000CE is 101 with 50qty and 2nd bid is 99 with 150 qty
Current lowest ask for 26000CE is 25 with 100qty
Hence, 50qty is available for 25000CE above my price
Similarly. 100qty is available for 26000CE below my price
If I place this multileg order, will it fill 50 qty and cancel the remaining 50qty? Or will it cancel the 100 qty?
In the given scenario, if both the buy and sell quantities are 100, and the bid for the first leg is only 50 while the ask for the second leg is 100, then only 50 units will be executed, and the remaining quantity will be cancelled
