Skip to content

black_76

module jetblack_options.european.black_76

Summary

Black (1976) Options on futures/forwards

Description

  • The discounted futures price F,
  • Strike price K,
  • Risk-free rate r,
  • Annual dividend yield q,
  • Time to maturity τ=Tt
  • Volatility σ.

Most of the formula use one or both of the following terms.

d1=ln(F/K)+(σ2/2)TσT d2=ln(F/K)(σ2/2)TσT=d1σT φ(x)&=12πe12x2 Φ(x)&=12πxe12y2dy=112πxe12y2dy

function jetblack_options.european.black_76.delta

Summary

The sensitivity of the option to a change in the asset price

Description

using Black 76.

For the call.

CS=erτΦ(d1)

For the put.

PS=erτΦ(d1)
jetblack_options.european.black_76.delta(
is_call: bool,
F: float,
K: float,
T: float,
r: float,
v: float
) -> float

Parameters

is_call: bool

True for a call, false for a put.

F: float

The current futures price.

K: float

The strike price.

T: float

The time to expiry in years.

r: float

The risk free rate.

v: float

The volatility.

Returns

float: The delta.

function jetblack_options.european.black_76.gamma

Summary

The second derivative to the change in asset price using Black 76.

Description

The gamma for both calls and puts.

2VS2=erτφ(d1)Fστ=Kerτφ(d2)F2στ
jetblack_options.european.black_76.gamma(
F: float,
K: float,
T: float,
r: float,
v: float
) -> float

Parameters

F: float

The current futures price.

K: float

The strike price.

T: float

The time to expiry in years.

r: float

The risk free rate.

v: float

The volatility.

Returns

float: The gamma.

function jetblack_options.european.black_76.ivol

Summary

Calculate the volatility of a Black 76 option that is implied by the price.

jetblack_options.european.black_76.ivol(
is_call: bool,
F: float,
K: float,
T: float,
r: float,
p: float,
*,
max_iterations: int, Optional,
epsilon: float, Optional
) -> float

Parameters

is_call: bool

True for a call, false for a put.

F: float

The current asset price.

K: float

The option strike price

T: float

The time to maturity of the option in years.

r: float

The risk free rate.

p: float

The option price.

max_iterations: int, Optional

The maximum number of iterations before a price is returned. Defaults to 20.

epsilon: float, Optional (optional)

The largest acceptable error. Defaults to 1e-8.

Returns

float: The implied volatility.

function jetblack_options.european.black_76.make_numeric_greeks

Summary

Make a class to generate greeks numerically using finite difference methods.

jetblack_options.european.black_76.make_numeric_greeks(
is_call: bool
) -> NumericGreeks

Parameters

is_call: bool

If true the options is a call; otherwise it is a put.

Returns

NumericGreeks: A class which can generate Greeks using finite difference methods.

function jetblack_options.european.black_76.price

Summary

Fair value of a futures/forward using Black 76.

Description

For a call:

C=erτ[FΦ(d1)KΦ(d2)]

For a put:

P=erτ[KΦ(d2)FΦ(d1)]
jetblack_options.european.black_76.price(
is_call: bool,
F: float,
K: float,
T: float,
r: float,
v: float
) -> float

Parameters

is_call: bool

True for a call, false for a put.

F: float

The price of the future.

K: float

The strike price.

T: float

The time to expiry in years.

r: float

The risk free rate.

v: float

The asset volatility.

Returns

float: The option price.

function jetblack_options.european.black_76.rho

Summary

The sensitivity of the option price to a change in the risk free rate

Description

using Black 76.

For a call:

Cr=τerτ[FΦ(d1)KΦ(d2)]

For a put:

Pr=τerτ[KΦ(d2)FΦ(d1)]
jetblack_options.european.black_76.rho(
is_call: bool,
F: float,
K: float,
T: float,
r: float,
v: float
) -> float

Parameters

is_call: bool

True for a call, false for a put.

F: float

The price of the future.

K: float

The strike price.

T: float

The time to expiry in years.

r: float

The risk free rate.

v: float

The asset volatility.

Returns

float: The rho.

function jetblack_options.european.black_76.theta

Summary

The change in the value of the option with respect to time to expiry

Description

using Black 76.

For the call.

CTFerτφ(d1)σ2τrKerτΦ(d2)+rFerτΦ(d1)

For the put.

PTFerτφ(d1)σ2τ+rKerτΦ(d2)rFerτΦ(d1)
jetblack_options.european.black_76.theta(
is_call: bool,
F: float,
K: float,
T: float,
r: float,
v: float
) -> float

Parameters

is_call: bool

True for a call, false for a put.

F: float

The current futures price.

K: float

The strike price.

T: float

The time to expiry in years.

r: float

The risk free rate.

v: float

The volatility.

Returns

float: The theta.

function jetblack_options.european.black_76.vanna

Summary

The sensitivity of the option value to the underlying

Description

asset price and the volatility.

For both calls and puts.

2VFσ=erτφ(d1)d2σ=𝒱F[1d1στ]
jetblack_options.european.black_76.vanna(
F: float,
K: float,
T: float,
r: float,
v: float
) -> float

Parameters

F: float

The price of the future.

K: float

The strike price.

T: float

The time to expiry in years.

r: float

The risk free rate.

v: float

The asset volatility.

Returns

float: The vanna.

function jetblack_options.european.black_76.vega

Summary

The sensitivity of the options price or a change in the asset volatility

Description

using Black 76.

For both calls and puts.

Vσ=Ferτφ(d1)τ=Kerτφ(d2)τ
jetblack_options.european.black_76.vega(
F: float,
K: float,
T: float,
r: float,
v: float
) -> float

Parameters

F: float

The current futures price.

K: float

The strike price.

T: float

The time to expiry in years.

r: float

The risk free rate.

v: float

The volatility.

Returns

float: The vega.

function jetblack_options.european.black_76.vomma

Summary

The second order sensitivity to volatility.

Description

For both puts and calls.

2Vσ2=Ferτφ(d1)τd1d2σ=𝒱d1d2σ
jetblack_options.european.black_76.vomma(
F: float,
K: float,
T: float,
r: float,
v: float
) -> float

Parameters

F: float

The price of the future.

K: float

The strike price.

T: float

The time to expiry in years.

r: float

The risk free rate.

v: float

The asset volatility.

Returns

float: The vomma