Margin Requirements Calculation

hyuga
We can create a basket of multiple F&O contracts on the portal and check the exact margin requirements.
How to do the same margin requirement requests through Kiteconnect python API. We tried using the margins() function but it doesn't seem to work similarly to the basket.

Following is the code snippet for the margins API call we used-

positions = [
{"tradingsymbol": "BANKNIFTY21MAR36000CE", "exchange": "NFO", "quantity": 1, "product": "MIS"},
{"tradingsymbol": "BANKNIFTY21MAR36500CE", "exchange": "NFO", "quantity": -2, "product": "MIS"}
]
margins = kite.margins(segment="equity", positions=positions)
print("Total margin required:", margins["total"])

But margins() don't accept positions argument.
  • sujith
    You can check margin requirement for an order but not for a position. You can send the order details as mentioned here.
Sign In or Register to comment.