Skip to content

Moneyness

Conversion utilities between strike, log-strike, and moneyness representations.

These functions provide a single authoritative source for the relationships between absolute strikes, log-strikes, and time-scaled moneyness used throughout the library.

quantflow.options.moneyness

Moneyness and log-strike conversion utilities.

This module provides the canonical conversions between absolute strikes, log-strikes, and time-scaled moneyness used throughout the library.

See the glossary for definitions.

moneyness_from_log_strike

moneyness_from_log_strike(log_strike, ttm)

Convert log-strike \(k\) to moneyness \(m\).

\[\begin{equation} m = \frac{k}{\sqrt{\tau}} \end{equation}\]
PARAMETER DESCRIPTION
log_strike

Log-strike

TYPE: FloatArrayLike

ttm

Time to maturity in years

TYPE: FloatArrayLike

Source code in quantflow/options/moneyness.py
def moneyness_from_log_strike(
    log_strike: Annotated[FloatArrayLike, Doc("Log-strike")],
    ttm: Annotated[FloatArrayLike, Doc("Time to maturity in years")],
) -> FloatArrayLike:
    r"""Convert log-strike $k$ to moneyness $m$.

    \begin{equation}
        m = \frac{k}{\sqrt{\tau}}
    \end{equation}
    """
    return log_strike / np.sqrt(ttm)

log_strike_from_moneyness

log_strike_from_moneyness(moneyness, ttm)

Convert time-scaled moneyness to log-strike.

\[\begin{equation} k = m \sqrt{\tau} \end{equation}\]
PARAMETER DESCRIPTION
moneyness

Time-scaled moneyness

TYPE: FloatArrayLike

ttm

Time to maturity in years

TYPE: FloatArrayLike

Source code in quantflow/options/moneyness.py
def log_strike_from_moneyness(
    moneyness: Annotated[FloatArrayLike, Doc("Time-scaled moneyness")],
    ttm: Annotated[FloatArrayLike, Doc("Time to maturity in years")],
) -> FloatArrayLike:
    r"""Convert time-scaled moneyness to log-strike.

    \begin{equation}
        k = m \sqrt{\tau}
    \end{equation}
    """
    return moneyness * np.sqrt(ttm)

strike_from_moneyness

strike_from_moneyness(moneyness, ttm, forward)

Convert time-scaled moneyness to an absolute strike price.

\[\begin{equation} K = F \exp\left(m \sqrt{\tau}\right) \end{equation}\]
PARAMETER DESCRIPTION
moneyness

Time-scaled moneyness

TYPE: float

ttm

Time to maturity in years

TYPE: float

forward

Forward price of the underlying

TYPE: float

Source code in quantflow/options/moneyness.py
def strike_from_moneyness(
    moneyness: Annotated[float, Doc("Time-scaled moneyness")],
    ttm: Annotated[float, Doc("Time to maturity in years")],
    forward: Annotated[float, Doc("Forward price of the underlying")],
) -> Decimal:
    r"""Convert time-scaled moneyness to an absolute strike price.

    \begin{equation}
        K = F \exp\left(m \sqrt{\tau}\right)
    \end{equation}
    """
    return to_decimal(forward * math.exp(moneyness * math.sqrt(ttm)))

strike_from_log_strike

strike_from_log_strike(log_strike, forward)

Convert log-strike to an absolute strike price.

\[\begin{equation} K = F \exp(k) \end{equation}\]
PARAMETER DESCRIPTION
log_strike

Log-strike

TYPE: float

forward

Forward price of the underlying

TYPE: float

Source code in quantflow/options/moneyness.py
def strike_from_log_strike(
    log_strike: Annotated[float, Doc("Log-strike")],
    forward: Annotated[float, Doc("Forward price of the underlying")],
) -> Decimal:
    r"""Convert log-strike to an absolute strike price.

    \begin{equation}
        K = F \exp(k)
    \end{equation}
    """
    return to_decimal(forward * math.exp(log_strike))

log_strike_from_strike

log_strike_from_strike(strike, forward)

Convert an absolute strike to log-strike.

\[\begin{equation} k = \ln\frac{K}{F} \end{equation}\]
PARAMETER DESCRIPTION
strike

Absolute strike price

TYPE: float | Decimal

forward

Forward price of the underlying

TYPE: float | Decimal

Source code in quantflow/options/moneyness.py
def log_strike_from_strike(
    strike: Annotated[float | Decimal, Doc("Absolute strike price")],
    forward: Annotated[float | Decimal, Doc("Forward price of the underlying")],
) -> float:
    r"""Convert an absolute strike to log-strike.

    \begin{equation}
        k = \ln\frac{K}{F}
    \end{equation}
    """
    return math.log(float(strike) / float(forward))