vollib.black_scholes_merton.greeks package

Submodules

vollib.black_scholes_merton.greeks.analytical module

vollib.black_scholes_merton.greeks.analytical

A library for option pricing, implied volatility, and greek calculation. vollib is based on lets_be_rational, a Python wrapper for LetsBeRational by Peter Jaeckel as described below.

copyright:© 2015 Iota Technologies Pte Ltd
license:MIT, see LICENSE for more details.

About LetsBeRational:

The source code of LetsBeRational resides at www.jaeckel.org/LetsBeRational.7z .

======================================================================================
Copyright © 2013-2014 Peter Jäckel.

Permission to use, copy, modify, and distribute this software is freely granted,
provided that this notice is preserved.

WARRANTY DISCLAIMER
The Software is provided "as is" without warranty of any kind, either express or implied,
including without limitation any implied warranties of condition, uninterrupted use,
merchantability, fitness for a particular purpose, or non-infringement.
======================================================================================
vollib.black_scholes_merton.greeks.analytical.delta(flag, S, K, t, r, sigma, q)[source]

Returns the Black-Scholes-Merton delta of an option.

Parameters:
  • flag (str) – ‘c’ or ‘p’ for call or put.
  • S (float) – underlying asset price
  • K (float) – strike price
  • t (float) – time to expiration in years
  • r (float) – annual risk-free interest rate
  • sigma (float) – volatility
  • q (float) – annualized continuous dividend yield
Returns:

float

vollib.black_scholes_merton.greeks.analytical.gamma(flag, S, K, t, r, sigma, q)[source]

Returns the Black-Scholes-Merton gamma of an option.

Parameters:
  • flag (str) – ‘c’ or ‘p’ for call or put.
  • S (float) – underlying asset price
  • K (float) – strike price
  • t (float) – time to expiration in years
  • r (float) – annual risk-free interest rate
  • sigma (float) – volatility
  • q (float) – annualized continuous dividend yield
Returns:

float

vollib.black_scholes_merton.greeks.analytical.rho(flag, S, K, t, r, sigma, q)[source]

Returns the Black-Scholes-Merton rho of an option.

Parameters:
  • flag (str) – ‘c’ or ‘p’ for call or put.
  • S (float) – underlying asset price
  • K (float) – strike price
  • t (float) – time to expiration in years
  • r (float) – annual risk-free interest rate
  • sigma (float) – volatility
  • q (float) – annualized continuous dividend yield
Returns:

float

vollib.black_scholes_merton.greeks.analytical.theta(flag, S, K, t, r, sigma, q)[source]

Returns the Black-Scholes-Merton theta of an option.

Parameters:
  • flag (str) – ‘c’ or ‘p’ for call or put.
  • S (float) – underlying asset price
  • K (float) – strike price
  • t (float) – time to expiration in years
  • r (float) – annual risk-free interest rate
  • sigma (float) – volatility
  • q (float) – annualized continuous dividend yield
Returns:

float

vollib.black_scholes_merton.greeks.analytical.vega(flag, S, K, t, r, sigma, q)[source]

Returns the Black-Scholes-Merton vega of an option.

Parameters:
  • flag (str) – ‘c’ or ‘p’ for call or put.
  • S (float) – underlying asset price
  • K (float) – strike price
  • t (float) – time to expiration in years
  • r (float) – annual risk-free interest rate
  • sigma (float) – volatility
  • q (float) – annualized continuous dividend yield
Returns:

float

vollib.black_scholes_merton.greeks.numerical module

Module contents