abaquant.derivatives.trees

Import path: abaquant.derivatives.trees

Domain: Derivative pricing, simulation, calibration, diagnostics, and strategy analysis.

Purpose

Binomial-lattice option pricing.

When to use it

Use this package when valuing contingent claims, calculating Greeks, building option strategies, simulating stochastic processes, or fitting models to market observations.

Public objects

  • function: binomial_tree — Price a vanilla option by backward induction on a binomial lattice.

  • function: crr_binomial_tree — Price a vanilla option with the Cox–Ross–Rubinstein lattice convention.

Detailed reference

Binomial-lattice option pricing.

Purpose

This module constructs recombining Cox–Ross–Rubinstein-style trees for vanilla options and can include early exercise by backward induction.

Conventions

Maturity is in years, the number of steps is a positive integer, and rates, yields, and volatility are decimal annual quantities.

Scope and limitations

Tree values are numerical approximations whose accuracy depends on the number of time steps.

References

[ 1 ] Cox, J. C., S. A. Ross, and M. Rubinstein (1979), “Option Pricing: A Simplified Approach”.

abaquant.derivatives.trees.binomial_tree(S, K, T, r, sigma, n, q=0.0, option_type='call', american=False)

Price a vanilla option by backward induction on a binomial lattice.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K (float) – Option strike price in the same currency units as the underlying.

  • T (float) – Time to maturity in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • n (int) – Number of discrete periods, assets, or observations as determined by the callable.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

  • option_type (str, default='call') – Option type label, normally "call" or "put".

  • american (bool, default=False) – Whether early exercise is allowed in the lattice valuation.

Returns:

Positional outputs produced by the binomial tree calculation.

Return type:

tuple[float, tuple[np.ndarray, np.ndarray] | None]

Notes

Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.

abaquant.derivatives.trees.crr_binomial_tree(S, K, r, sigma, T, n, is_call=True, american=False, q=0.0)

Price a vanilla option with the Cox–Ross–Rubinstein lattice convention.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K (float) – Option strike price in the same currency units as the underlying.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • T (float) – Time to maturity in years.

  • n (int) – Number of discrete periods, assets, or observations as determined by the callable.

  • is_call (bool, default=True) – Whether the instrument is a call; false selects a put.

  • american (bool, default=False) – Whether early exercise is allowed in the lattice valuation.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

Returns:

Positional outputs produced by the crr binomial tree calculation.

Return type:

tuple[float, np.ndarray | None, np.ndarray | None]

Notes

Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.