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


  • @godboleamit

    For those who need this function to get Option Greeks.

    1. Please go to the file - smartConnect.py.
    2. Add the following function to the file -
         def getOptionGreeks(self, name, expirydate):
            optiongreeks = self._postRequest("api.market.optiongreeks", {"name": name,"expirydate": expirydate})
            return optiongreeks
    
    1. 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/",
    
    1. Call a function as follows -
    optionGreeks = smartApi.getOptionGreeks('TCS', '29FEB2024')
    print(optionGreeks)
    

    You will get the required response.