Skip to content

barone_adesi_whaley

module jetblack_options.american.barone_adesi_whaley

Summary

Option pricing functions implementing the Barone, Adesi and Whaley (1987)

Description

American approximation.

function jetblack_options.american.barone_adesi_whaley.ivol

Summary

Calculate the volatility of an option that is implied by the price.

jetblack_options.american.barone_adesi_whaley.ivol(
is_call: bool,
S: float,
K: float,
T: float,
r: float,
b: float,
p: float,
*,
max_iterations: int, Optional,
epsilon: float, Optional
) -> float

Parameters

is_call: bool

True for a call, false for a put.

S: float

The current asset price.

K: float

The option strike price

T: float

The time to expiry of the option in years.

r: float

The risk free rate.

b: float

The cost of carry of the asset.

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.american.barone_adesi_whaley.make_numeric_greeks

Summary

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

jetblack_options.american.barone_adesi_whaley.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.american.barone_adesi_whaley.price

Summary

The Barone-Adesi and Whaley (1987) American approximation.

jetblack_options.american.barone_adesi_whaley.price(
is_call: bool,
S: float,
K: float,
T: float,
r: float,
b: float,
v: float
) -> float

Parameters

is_call: bool

True for a call, false for a put.

S: float

The asset price.

K: float

The strike price.

T: float

The time to expiry in years.

r: float

The risk free rate.

b: float

The cost of carry.

v: float

The asset volatility.

Returns

float: The price of the option.