Multi-leg Order
This API allows you to place a two-leg or three-leg NSE futures and options order as a single order.
USE CASE
Trade a multi-leg strategy as one order instead of sending each leg separately.
Note
As per exchange mandate, while selecting symbols please check the stream key in the Symbol Master JSON file to ensure both legs belong to the same stream.
- The Multi Leg Order API currently does not support hedge margin benefits. Please use the Multi Order API to avail of these benefits.
Details
- This allows the user to place an MultiLeg order to NSE via Fyers.
- Placing orders needs an app with the Order Placement permission.
- Only NSE futures and options symbols (NFO) are allowed, and all legs must be on the same underlying. Banned F&O symbols are rejected.
- Set
orderTypeto2Lfor two legs or3Lfor three legs, and name the legsleg1,leg2andleg3. - Each leg must be a limit order (
type1).validitymust beIOC, andproductTypemust beINTRADAYorMARGIN. - The same symbol cannot be used in two legs, and each leg quantity must be a multiple of the lot size.
- The order-per-second limit of 10 orders, covering placing, modifying and cancelling, applies here too.
- Set
offlineOrdertotrueto place the order as an AMO order, andfalsewhen the market is open. - For order types, product types, validations and sync vs async behaviour, refer to the Order Placement Guide.
- When order rate limiting is triggered, the API returns
429 Too Many Requests. - Retry timing is provided through response headers, not in the response body.
Retry-After— Wait time before retrying, in secondsX-Retry-After-Ms— Wait time before retrying, in milliseconds- Use the retry interval returned in the response headers before sending another order request.
- Rate limits differ between the Standard and Prime plans. See Plans & rate limits.
Request Attributes
| Attribute | Data Type | Description |
|---|---|---|
orderTag | string | (Optional) Tag you want to assign to the specific order |
productType* | string |
|
offlineOrder* | boolean |
|
orderType* | string |
|
validity* | string | IOC => Immediate or Cancel |
legs* | json | It represents multiple trading legs in a multi-leg order. Each leg within the legs object corresponds to a specific trading instrument and order details. Each leg is identified by a unique key (leg1, leg2, leg3 ) |
Leg attributes
| Attribute | Data Type | Description |
|---|---|---|
symbol* | string | Eg: NSE:SBIN24JUNFUT |
qty* | int | The quantity should be in multiples of lot size for derivatives. |
side* | int |
|
type* | int |
|
limitPrice* | float | Provide valid price for Limit orders |
Response Attributes
| Attribute | Data Type | Description |
|---|---|---|
s | string | ok / error |
code | int |
|
message | string |
|
id | string |
|
Input Validations
| Error Message | Description |
|---|---|
The input symbol is invalid. | Input symbol ticker is not found in the exchange data |
Only NFO symbols are allowed | Options and Future symbols listed in NSE are allowed. |
The input symbol is banned for FNO trading. | The input symbol is banned for trading by the exchange. |
All symbols must be related to the same underlying symbol. | All symbols must be related to same symbol |
Quantity should be multiples of the lot size. | Input qty(Quantity) should be multiples of minimum lot size of that symbol |
You cannot add same symbol for two legs. | Input data should not have same symbol in more than one leg. |
Group combination not found | Input Symbols do not belong to same stream group. |
Last updated on