Calculate the second order Greeks of an option based on the Black Scholes Model. This will return the following Greeks per Strike Price and Expiration Date:

  • Gamma: measures the rate of change in the delta with respect to changes in the underlying price. Gamma is the second derivative of the value function with respect to the underlying price.
  • Dual Gamma: the second derivative of the option value with respect to the strike price rather than the underlying price. It is the discounted risk-neutral probability density of the underlying at expiration.
  • Vanna: also referred to as DvegaDspot and DdeltaDvol, is a second-order derivative of the option value, once to the underlying spot price and once to volatility.
  • Charm: Charm or delta decay measures the instantaneous rate of change of delta over the passage of time.
  • Vomma: also referred to as volga, vega convexity, or DvegaDvol measures second-order sensitivity to volatility. Vomma is the second derivative of the option value with respect to the volatility, or, stated another way, vomma measures the rate of change to vega as volatility changes.
  • Veta: also referred to as DvegaDtime, measures the rate of change in the vega with respect to the passage of time. Veta is the second derivative of the value function; once to volatility and once to time.
  • Vera: also referred to as rhova, measures the rate of change in rho with respect to volatility. Vera is the second derivative of the value function; once to volatility and once to interest rate.
  • Partial Derivative: measures the rate of change in the option price with respect to the strike price.

For a deeper explanation, please have a look at: https://en.wikipedia.org/wiki/Greeks_(finance) and the references to the literature as found on this page.

By default the most recent risk free rate, dividend yield and stock price is used, you can alter this by changing the start date. The volatility is calculated based on the daily returns of the stock price and the selected period (this can be altered by defining this accordingly when defining the Toolkit class, start_date and end_date).

Second-Order Greeks in Python

collect_second_order_greeks is part of the Options module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call collect_second_order_greeks as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(["AAPL", "MSFT"], api_key="FINANCIAL_MODELING_PREP_KEY")

toolkit.options.collect_second_order_greeks().loc["AAPL"]

Which returns:

Strike Price (Period(‘2026-07-31’, ‘D’), ‘Gamma’) (Period(‘2026-07-31’, ‘D’), ‘Dual Gamma’) (Period(‘2026-07-31’, ‘D’), ‘Vanna’) (Period(‘2026-07-31’, ‘D’), ‘Charm’) (Period(‘2026-07-31’, ‘D’), ‘Vomma’) (Period(‘2026-07-31’, ‘D’), ‘Vera’) (Period(‘2026-07-31’, ‘D’), ‘Veta’) (Period(‘2026-07-31’, ‘D’), ‘PD’)
335 0.0104 0.0088 0.9717 -1.7748 84.8089 22.1601 1047.21 0.0088
340 0.0084 0.0069 0.9252 -1.6697 96.5515 21.3439 1024.12 0.0069
345 0.0065 0.0052 0.8292 -1.4833 100.49 19.2881 958.182 0.0052
350 0.0049 0.0038 0.7054 -1.2534 97.1843 16.5099 857.73 0.0038
355 0.0036 0.0027 0.5729 -1.0126 88.2978 13.4738 735.564 0.0027
360 0.0025 0.0019 0.4462 -0.7853 75.9648 10.5348 605.433 0.0019
365 0.0017 0.0012 0.3344 -0.5865 62.2551 7.9212 479.276 0.0012
370 0.0012 0.0008 0.2419 -0.423 48.8282 5.7452 365.664 0.0008
375 0.0008 0.0005 0.1693 -0.2953 36.7917 4.0297 269.421 0.0005
380 0.0005 0.0003 0.1149 -0.1999 26.7166 2.7394 192.07 0.0003

Parameters

collect_second_order_greeks accepts the following parameters:

  • start_date (str | None, optional): The start date which determines the stock price. Defaults to None which means it will use the most recent date.
  • strike_price_range (float): The percentage range to use for the strike prices. Defaults to 0.25 which equals 25% and thus results in strike prices from 75 to 125 if the current stock price is 100.
  • strike_step_size (int): The step size to use for the strike prices. Defaults to 5 which means that the strike prices will be 75, 80, 85, 90, 95, 100, 105, 110, 115 and 120 if the current stock price is 100.
  • expiration_time_range (int): The number of days to use for the time to expiration. Defaults to 30 which equals 30 days.
  • risk_free_rate (float, optional): The risk free rate to use for the calculation. Defaults to None which means it will use the current risk free rate.
  • dividend_yield (float, optional): The dividend yield to use for the calculation. Defaults to None which means it will use the current dividend yield.
  • put_option (bool, optional): Whether to calculate the put option delta. Defaults to False which means it will calculate the call option delta.
  • show_input_info (bool, optional): Whether to show the input information. Defaults to False.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to 4.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result across the time to expiration columns for each ticker and strike price. Defaults to False.
Share