Python function for Option Greeks
-
Hi,
Thanks for providing the feature of option greeks!
But do you have any dedicated function in python to retrieve these option greeks values?
E.g. any dedicated function like - individual_order_details(self, qParam) will be helpful.
If you already dedicated python function, please let us know.
Thanks!
-
Hi @godboleamit,
We are currently working on providing this functionality in Python SDK. It will be released soon.
Thank you.
Regards
SmartAPI Team -
Hey @hardip, getOptionGreeks() function is not defined. You will need to add this function yourself.
-
@godboleamit .Not works. getOptionGreeks not define
-
For those who need this function to get Option Greeks.
- Please go to the file - smartConnect.py.
- Add the following function to the file -
def getOptionGreeks(self, name, expirydate): optiongreeks = self._postRequest("api.market.optiongreeks", {"name": name,"expirydate": expirydate}) return optiongreeks
- Add one more line to the routes variable - (Look at the second line)
"api.allholding": "/rest/secure/angelbroking/portfolio/v1/getAllHolding", "api.market.optiongreeks": "/rest/secure/angelbroking/marketData/v1/optionGreek", "api.individual.order.details": "/rest/secure/angelbroking/order/v1/details/",
- Call a function as follows -
optionGreeks = smartApi.getOptionGreeks('TCS', '29FEB2024') print(optionGreeks)
You will get the required response.