Hide navigation sidebar
Hide table of contents sidebar
Toggle table of contents sidebar

# self.get_greeks

lumibot.strategies.strategy.Strategy.get_greeks(self, asset, implied_volatility=False, delta=False, option_price=False, pv_dividend=False, gamma=False, vega=False, theta=False, underlying_price=False)

  Returns the greeks for the option asset at the current bar.

  Will return all the greeks available unless any of the individual greeks are selected, then will only return those greeks.

  Parameters

    - asset (Asset) – Option asset only for with greeks are desired.

    - **kwargs –

    - implied_volatility (boolean) – True to get the implied volatility. (default: True)

    - delta (boolean) – True to get the option delta value. (default: True)

    - option_price (boolean) – True to get the option price. (default: True)

    - pv_dividend (boolean) – True to get the present value of dividends expected on the option’s underlying. (default: True)

    - gamma (boolean) – True to get the option gamma value. (default: True)

    - vega (boolean) – True to get the option vega value. (default: True)

    - theta (boolean) – True to get the option theta value. (default: True)

    - underlying_price (boolean) – True to get the price of the underlying. (default: True)

  Returns

    - Returns a dictionary with greeks as keys and greek values as

    - values.

    - implied_volatility (float) – The implied volatility.

    - delta (float) – The option delta value.

    - option_price (float) – The option price.

    - pv_dividend (float) – The present value of dividends expected on the option’s underlying.

    - gamma (float) – The option gamma value.

    - vega (float) – The option vega value.

    - theta (float) – The option theta value.

    - underlying_price – The price of the underlying.

  Example

      >>> # Will return the greeks for SPY
      >>> asset = "SPY"
      >>> greeks = self.get_greeks(asset)
      >>> implied_volatility = greeks["implied_volatility"]
      >>> delta = greeks["delta"]
      >>> gamma = greeks["gamma"]
      >>> vega = greeks["vega"]
      >>> theta = greeks["theta"]