Is there a manual way to calculate the margin required for an instrument & order type combination? Say for example, if I placed an order for CDS:USDINR20DECFUT NRML type, to find the margin would there be a percentage like LTP x 1000 x percentage to find the margin?
Calculating margin is a bit difficult to be done at your end. As it not only depends on the LTP movement but also on other factors like existing positions, open orders, etc. You can use open margin calculation APIs. Also, we will be integrating this API soon with all our official clients including python.
Meanwhile, as a quick hack and to get things up and running quickly ; would a 4% margin for currency derivatives be sufficient to cover the various parameters as mentioned by @rakeshr ? I am mainly interested in USDINR and GBPINR.
would a 4% margin for currency derivatives be sufficient to cover the various parameters
No. The Span margin varies for both CDS contracts. If you are in so hurry, maybe you can try using this branch of Connect Python client(which has Margin APIs integrated, but the test is still going on).
@milli, It only gives you data about the leverage. You will have to use that for calculation and it is manually updated by the RMS team which can be updated multiple times during the day as well. If you are looking for a straight forward solution like margin = qty * last price then you can use this. If you want the exact values which depend on your portfolio and pending orders then you need to use this.
I have been trying to get margin required for option spreads (i.e. bear call spread etc.). When I pass a list of orders with the same, I don't get the margin required as per the latest margin guidelines or as per your F&O margin calculator. Can you please help?
@rakeshrthe api call provides the necessary info for about 500 scrips in one go whereas for the python call you'll have to build each and every order_param_multi .
Can we get an array or data frame through python API exactly the same?
No, we don't have a specific python method for this. You can just fetch value from this link https://api.kite.trade/margins/equity. Maybe use the python requests library, and return JSON/List, which is easy to filter. Something like:
pykiteconnect doesn't have it yet. We are working on it.
Thanks
https://kite.trade/docs/connect/v3/margins/
with the python code? Any pointers would help.
Thanks a lot.
Here is the Java example. Params are exactly the same, the way you interact with the python request library might be different.
Meanwhile, as a quick hack and to get things up and running quickly ; would a 4% margin for currency derivatives be sufficient to cover the various parameters as mentioned by @rakeshr ? I am mainly interested in USDINR and GBPINR.
Thanks
If you are in so hurry, maybe you can try using this branch of Connect Python client(which has Margin APIs integrated, but the test is still going on).
Can I not use
https://api.kite.trade/margins/currency
to get the currently required margin for currency derivatives?
Thanks
It only gives you data about the leverage. You will have to use that for calculation and it is manually updated by the RMS team which can be updated multiple times during the day as well.
If you are looking for a straight forward solution like
margin = qty * last price
then you can use this. If you want the exact values which depend on your portfolio and pending orders then you need to use this.pip install --upgrade kiteconnect
.I have been trying to get margin required for option spreads (i.e. bear call spread etc.). When I pass a list of orders with the same, I don't get the margin required as per the latest margin guidelines or as per your F&O margin calculator. Can you please help?
We don't have baskets margin API yet. This feature will be available once the baskets margin calculation API is released.
What would be the python equivalent call for https://api.kite.trade/margins/equity ?
You can use this method to fetch margin for order/orders. You can check python example here.
order_param_multi
.Can we get an array or dataframe through python API exactly same as what's being returned via https://api.kite.trade/margins/equity