Skip to content

garman_kohlhagen

module jetblack_options.european.garman_kohlhagen

Summary

Garman and Kohlhagen (1983) Currency options.

Description

The value of a call option.

c=S0erfT𝒩(d1)KerdT𝒩(d2)

The value of a put option.

p=KerdT𝒩(d2)S0erfT𝒩(d1)

where:

d1=ln(S0/K)+(rdrf+σ2/2)TσT

and

d2=d1σT
  • S0 is the current spot rate
  • K is the strike price
  • 𝒩(x) is the cumulative normal distribution function
  • rd is domestic risk free [[simple interest]] rate
  • rf is foreign risk free simple interest rate
  • T is the time to maturity (calculated according to the appropriate day count convention)
  • σ is the volatility of the FX rate.

function jetblack_options.european.garman_kohlhagen.ivol

Summary

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

jetblack_options.european.garman_kohlhagen.ivol(
is_call: bool,
S: float,
K: float,
T: float,
r: float,
rf: 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 of the base currency.

rf: float

The risk free rate of the quote currency.

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.garman_kohlhagen.make_numeric_greeks

Summary

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

jetblack_options.european.garman_kohlhagen.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.garman_kohlhagen.price

Summary

Garman and Kohlhagen (1983) Currency options.

jetblack_options.european.garman_kohlhagen.price(
is_call: bool,
S: float,
K: float,
T: float,
r: float,
rf: 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 of the base currency.

rf: float

The risk free rate of the quote currency.

v: float

The asset volatility.

Returns

float: description