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
dataarray 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
| Attribute | Data Type | Description |
|---|---|---|
symbol | string | Instrument symbol in FYERS symbology format. |
qty | int | Quantity in units, not lots. Must be a multiple of the lot size for derivatives. |
side | int | 1 = Buy; -1 = Sell. |
type | int | 1 = Limit; 2 = Market; 3 = Stop-market (SL-M); 4 = Stop-limit (SL-L). |
productType | string | CNC, INTRADAY, MARGIN or MTF, subject to instrument eligibility. |
limitPrice | float | Positive limit price for limit and stop-limit orders. Use 0.0 for market and stop-market orders. |
stopPrice | float | Positive trigger price for stop-market and stop-limit orders. Use 0.0 otherwise. |
stopLoss | float | Stop-loss value, where applicable. Use 0.0 otherwise. |
takeProfit | float | Take-profit value, where applicable. Use 0.0 otherwise. |
Response Attributes
| Attribute | Data Type | Description |
|---|---|---|
s | string | ok / error. |
code | int | API response code. |
message | string | Response or error message. |
margin_total | float | Approximate margin required for the submitted orders. |
margin_new_order | float | Approximate total margin required, including existing positions. |
margin_avail | float | Approximate available margin. |
prevMargin | float |
Last updated on