Skip to Content
API ReferenceMargin CalculatorMulti-order Margin Calculator

Multi-order Margin Calculator

This API allows you to calculate the approximate margin required for proposed equity and derivative orders, including commodity derivatives, and returns the available account margin.

USE CASE

Check the funding requirement of an order basket before you submit it, using the intended order sequence and product types.

Note

A maximum of 50 orders is allowed per request. Order sequence and product types can affect the margin requirement. For hedged strategies, passing hedge BUY orders before SELL orders can reduce the required margin. Using different product types for hedge and main legs can increase the margin requirement.

Details

  • Pass the orders inside a data array in the intended execution sequence.
  • Margin fields are returned inside data.
  • Rate limits differ between the Standard and Prime plans. See Plans & rate limits.

Request Attributes

AttributeData TypeDescription
symbolstringInstrument symbol in FYERS symbology format.
qtyintQuantity in units, not lots. Must be a multiple of the lot size for derivatives.
sideint1 = Buy; -1 = Sell.
typeint1 = Limit; 2 = Market; 3 = Stop-market (SL-M); 4 = Stop-limit (SL-L).
productTypestringCNC, INTRADAY, MARGIN or MTF, subject to instrument eligibility.
limitPricefloatPositive limit price for limit and stop-limit orders. Use 0.0 for market and stop-market orders.
stopPricefloatPositive trigger price for stop-market and stop-limit orders. Use 0.0 otherwise.
stopLossfloatStop-loss value, where applicable. Use 0.0 otherwise.
takeProfitfloatTake-profit value, where applicable. Use 0.0 otherwise.

Response Attributes

AttributeData TypeDescription
sstringok / error.
codeintAPI response code.
messagestringResponse or error message.
margin_totalfloatApproximate margin required for the submitted orders.
margin_new_orderfloatApproximate total margin required, including existing positions.
margin_availfloatApproximate available margin.
prevMarginfloat
Last updated on