Skip to content

Files

Latest commit

 

History

History
83 lines (66 loc) · 4.08 KB

Margin_Required.md

File metadata and controls

83 lines (66 loc) · 4.08 KB

Margin_Required

Get required margin details

client.margin_required(exchange_segment = "", price = "", order_type= "", product = "", quantity = "", instrument_token = "",
                       transaction_type = "")

Example

from neo_api_client import NeoAPI

#First initialize session and generate session token

client = NeoAPI(consumer_key=" ",consumer_secret=" ",environment=" ")
client.login(mobilenumber=" ", password=" ")
client.session_2fa("")

try:
    client.margin_required(exchange_segment = "", price = "", order_type= "", product = "",   quantity = "", instrument_token = "",  transaction_type = "")
except Exception as e:
    print("Exception when calling margin_required->margin_required: %s\n" % e)

Parameters

Name Description Type
exchange_segment nse_cm - NSE
bse_cm - BSE
nse_fo - NFO
bse_fo - BFO
cde_fo - CDS
mcx_fo - MCX
Str
price Price of the order Str
product NRML - Normal
CNC - Cash and Carry
MIS - MIS
INTRADAY - INTRADAY
CO - Cover Order
Str
order_type L - Limit
MKT - Market
SL - Stop loss limit
SL-M - Stop loss market
Str
quantity Quantity of the order Str
instrument_token pSymbol in ScripMaster files Str
transaction_type B(Buy), S(sell) Str
trading_symbol pTrdSymbol in ScripMaster files Str
transaction_type B(Buy), S(sell) Str
trigger_price Optional, required for stop loss and cover order Str

Return type

object

Sample response

{
    "data": 
                {
                    "avlCash": "104.96", 
                    "insufFund": "12520.04", 
                    "stat": "Ok", 
                    "totMrgnUsd": "12625.00", 
                    "mrgnUsd": "0.00", 
                    "reqdMrgn": "12625.00", 
                    "avlMrgn": "104.96", 
                    "stCode": 200, 
                    "tid": "server2_2330220", 
                    "ordMrgn": "12625.00", 
                    "rmsVldtd": 78
                }
}

HTTP request headers

  • Accept: application/json

HTTP response details

Status Code Description
200 Gets the margin_required data for a client account
400 Invalid or missing input parameters
403 Invalid session, please re-login to continue
429 Too many requests to the API
500 Unexpected error
502 Not able to communicate with OMS
503 Trade API service is unavailable
504 Gateway timeout, trade API is unreachable

[Back to top] [Back to API list] [Back to README]