abaquant.derivatives.models.binomial

Import path: abaquant.derivatives.models.binomial

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

Purpose

Cox–Ross–Rubinstein binomial-tree option pricing.

When to use it

This module implements or supports one derivative model. Read the parameter constraints, pricing measure, numerical method, and limiting cases before comparing outputs across models.

Public objects

  • class: CoxRossRubinsteinModel — Recombining Cox–Ross–Rubinstein lattice model for vanilla options. * CoxRossRubinsteinModel.price — Return the model price of a call or put option. * CoxRossRubinsteinModel.call_price — Return the model price of a European call option. * CoxRossRubinsteinModel.put_price — Return the model price of a European put option. * CoxRossRubinsteinModel.full_tree — Return the displayed portion of the recombining binomial valuation tree. * CoxRossRubinsteinModel.delta — Estimate option delta from the first binomial-tree step. * CoxRossRubinsteinModel.visualize — Return a backend-native visualization of this option-pricing model.

  • function: crr_tree_parameters — Compute Cox–Ross–Rubinstein step parameters.

Detailed reference

Cox–Ross–Rubinstein binomial-tree option pricing.

Purpose

The module implements a recombining lattice model for European and American vanilla options, including selected tree diagnostics.

Conventions

Maturity is in years; N is an integer step count; rates, yields, and volatility are decimal annual values.

References

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

class abaquant.derivatives.models.binomial.CoxRossRubinsteinModel(spot_price, strike_price, maturity_years, risk_free_rate, volatility, dividend_yield=0.0, number_of_steps=200, allow_early_exercise=False)

Bases: OptionDiagnosticsMixin

Recombining Cox–Ross–Rubinstein lattice model for vanilla options.

Parameters:
  • spot_price (float) – Current underlying asset price in currency units.

  • strike_price (float) – Option exercise price in currency units.

  • maturity_years (float) – Time to expiration in years.

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

  • volatility (float) – Annualized lognormal volatility in decimal units.

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

  • number_of_steps (int, default=200) – Number of recombining time steps in the lattice.

  • allow_early_exercise (bool, default=False) – Whether the lattice applies the American early-exercise condition.

Initialize a Cox–Ross–Rubinstein option-pricing lattice.

Parameters:
  • spot_price (float) – Current underlying asset price in currency units.

  • strike_price (float) – Option exercise price in currency units.

  • maturity_years (float) – Time to expiration in years.

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

  • volatility (float) – Annualized lognormal volatility in decimal units.

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

  • number_of_steps (int, default=200) – Number of recombining time steps in the lattice.

  • allow_early_exercise (bool, default=False) – Whether the lattice applies the American early-exercise condition.

price(option_type='call')

Return the model price of a call or put option.

Parameters:

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

Returns:

Computed price in the units implied by the documented inputs.

Return type:

float

Notes

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

call_price()

Return the model price of a European call option.

Returns:

Computed call price in the units implied by the documented inputs.

Return type:

float

Notes

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

put_price()

Return the model price of a European put option.

Returns:

Computed put price in the units implied by the documented inputs.

Return type:

float

Notes

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

full_tree(option_type='call', max_display=7)

Return the displayed portion of the recombining binomial valuation tree.

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

  • max_display (int, default=7) – Maximum number of tree levels retained for display.

Returns:

(underlying_price_tree, option_value_tree). Each outer-list position represents a time step and each inner-list position represents the number of downward moves at that step.

Return type:

tuple[list[list[float]], list[list[float] | 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.

delta(option_type='call')

Estimate option delta from the first binomial-tree step.

Parameters:

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

Returns:

Computed delta in the units implied by the documented inputs.

Return type:

float

visualize(*, option_type='call', chart='payoff', backend=None, theme=None, save_path=None, filename=None, lower_spot_multiple=0.5, upper_spot_multiple=1.5, grid_size=101, lower_volatility_multiple=0.5, upper_volatility_multiple=1.5, volatility_grid_size=31, greek_scale='raw')

Return a backend-native visualization of this option-pricing model.

Parameters:
  • option_type ({"call", "put"}, default="call") – Vanilla option type used for payoff, price-profile, smile, or tree plots.

  • chart (str, default="payoff") – Visual diagnostic to create. Supported charts include payoff, price profile, extrinsic value, Greek curves, selected surfaces, volatility smile, and lattice tree when the model exposes a tree.

  • backend ({"matplotlib", "plotly"}, default="matplotlib") – Optional plotting backend. The returned figure is not shown automatically.

  • lower_spot_multiple (float, default=0.5, 1.5) – Price-grid bounds as multiples of the strike price.

  • upper_spot_multiple (float, default=0.5, 1.5) – Price-grid bounds as multiples of the strike price.

  • grid_size (int, default=101) – Number of spot-grid points for non-tree plots.

  • lower_volatility_multiple (float, default=0.5, 1.5) – Volatility-grid bounds expressed as multiples of the model’s base volatility.

  • upper_volatility_multiple (float, default=0.5, 1.5) – Volatility-grid bounds expressed as multiples of the model’s base volatility.

  • volatility_grid_size (int, default=31) – Number of volatility-grid points for surface plots.

  • greek_scale ({"raw", "standardized"}, default="raw") – Scaling mode for the multi-Greek curve chart.

Returns:

Figure object created without mutating model state.

Return type:

matplotlib.figure.Figure or plotly.graph_objects.Figure

abaquant.derivatives.models.binomial.crr_tree_parameters(T, r, sigma, q=0.0, N=200)

Compute Cox–Ross–Rubinstein step parameters.

Parameters:
  • 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%.

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

  • N (int, default=200) – Number of binomial time steps.

Returns:

Named outputs of the crr tree parameters calculation.

Return type:

dict[str, float]

Notes

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