Skip to Content

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 orderType to 2L for two legs or 3L for three legs, and name the legs leg1, leg2 and leg3.
  • Each leg must be a limit order (type 1). validity must be IOC, and productType must be INTRADAY or MARGIN.
  • 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 offlineOrder to true to place the order as an AMO order, and false when 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 seconds
  • X-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

AttributeData TypeDescription
orderTagstring(Optional) Tag you want to assign to the specific order
productType*string
  • INTRADAY => Applicable for NFO segments.
  • MARGIN => Applicable for NFO segments.
offlineOrder*boolean
  • False => When market is open
  • True => When placing AMO order.
orderType*string
  • 3L => Applicable for 3 leg order.
  • 2L => Applicable for 2 leg order.
validity*stringIOC => Immediate or Cancel
legs*jsonIt 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

AttributeData TypeDescription
symbol*stringEg: NSE:SBIN24JUNFUT
qty*intThe quantity should be in multiples of lot size for derivatives.
side*int
  • 1 => Buy
  • -1 => Sell
type*int
  • 1 => Limit Order
limitPrice*floatProvide valid price for Limit orders

Response Attributes

AttributeData TypeDescription
sstringok / error
codeint
  • This is the code to identify specific responses
  • If 201 comes in code it implies that order request has been made but no acknowledgement has been received in this case check orderbook before placing order
messagestring
  • Message to clarify the request status.
  • Eg: Order submitted successfully.
  • Your Order Ref. No.119062829763
idstring
  • The order number of the placed order.
  • Eg: 119031547242

Input Validations

Error MessageDescription
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