Margin calculation?

healthsecure15
I read this: https://kite.trade/docs/connect/v3/margins/

Seems very interesting. I cannot find the python call for it.

I tried:

kite.margins([
{
"exchange": "NSE",
"tradingsymbol": "INFY",
"transaction_type": "BUY",
"variety": "regular",
"product": "CNC",
"order_type": "MARKET",
"quantity": 1,
"price": 0,
"trigger_price": 0

}
])

Which gave the obvious output. What would be the correct call for calculation of margin as per the kite.trade doc linked above?

Thanks
  • rakeshr
    I cannot find the python call for it.
    You can use order_margin method to make the order margin calculation call. You can refer python example code for the same here.
  • mayankk
    @rakeshr can you please help answer how to get the margin for the basket order. I used order_margins for multiple orders but it only gives the individual orders margin. How do I get the final margin for the basket using python. appreciate your help thanks
  • mlearner
    You can use order_margin method to make the order margin calculation call. You can refer python example code for the same here.
    @rakeshr - The python call as mentioned in sample code is not working for me.
    margin_detail = kite.order_margins(order_param_single)
    Getting below error -
    INFO:root:Required order margin: 'KiteConnect' object has no attribute 'order_margins'
    Also for basket orders, will "kite.order_margins()" work or the python call is "kite.basket_margins()"?
  • rakeshr
    INFO:root:Required order margin: 'KiteConnect' object has no attribute 'order_margins'
    You need to update your package using pip install --upgrade kiteconnect.
    Also for basket orders, will "kite.order_margins()" work or the python call is "kite.basket_margins()"?
    Also for basket orders, will "kite.order_margins()" work or the python call is "kite.basket_margins()"?
    We haven't added basket margins APIs to python client, as of now. You will have to use requests to use this, for now. We will add this to python client soon.
Sign In or Register to comment.