abaquant.visualization.options¶
Import path: abaquant.visualization.options
Domain: Matplotlib and Plotly visualization helpers with shared themes.
Purpose¶
Configurable visualizations for scalar option-pricing model objects.
When to use it¶
Use these functions to inspect model behavior, portfolio allocations, market surfaces, credit assessments, calibrations, and dashboard outputs.
Public objects¶
function:
visualize_option_model— Visualize one scalar option-pricing model using the active theme.function:
visualize_derivative_scenario_grid— Visualize a derivative spot–volatility scenario grid.function:
visualize_option_chain_analytics— Visualize listed-option-chain analytics with the active theme.function:
visualize_option_strategy— Visualize a composable option strategy payoff profile.function:
visualize_calibration_result— Visualize an option-model calibration result.
Detailed reference¶
Configurable visualizations for scalar option-pricing model objects.
- abaquant.visualization.options.visualize_option_model(model, *, 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')¶
Visualize one scalar option-pricing model using the active theme.
- Parameters:
model (object) – Scalar model exposing
spot_priceandstrike_price. Value charts requirecall_price()andput_price(). Greek charts additionally requiregreeks().option_type ({"call", "put"}, default="call") – Vanilla payoff, value, decomposition, and Greek family to display.
chart (str, default="payoff") – Requested visual diagnostic. Supported values are
"payoff","price_profile","extrinsic_value","greeks","volatility_smile","tree","price_surface","extrinsic_surface","delta_surface","gamma_surface","theta_surface", and"vega_surface".backend ({"matplotlib", "plotly"}, optional) – Per-call backend override. When omitted,
theme.backendis used.theme (VisualizationTheme, optional) – Per-call style and export override. When omitted, the global theme is used.
save_path (str or pathlib.Path, optional) – Explicit export path. A filename extension selects the export format.
filename (str, optional) – Filename relative to
theme.save_directory.lower_spot_multiple (float, default=0.5, 1.5) – Spot-grid bounds expressed as multiples of the strike price.
upper_spot_multiple (float, default=0.5, 1.5) – Spot-grid bounds expressed as multiples of the strike price.
grid_size (int, default=101) – Number of spot points for curves and the surface x-axis.
lower_volatility_multiple (float, default=0.5, 1.5) – Volatility-grid bounds expressed as multiples of the model’s base volatility-like attribute.
upper_volatility_multiple (float, default=0.5, 1.5) – Volatility-grid bounds expressed as multiples of the model’s base volatility-like attribute.
volatility_grid_size (int, default=31) – Number of volatility points for surface charts.
greek_scale ({"raw", "standardized"}, default="raw") – Scaling mode for the multi-Greek curve chart.
"standardized"divides each Greek by its maximum absolute value over the spot grid.
- Returns:
Styled backend-native figure object. The figure is optionally saved but is never shown automatically.
- Return type:
matplotlib.figure.Figure or plotly.graph_objects.Figure
- abaquant.visualization.options.visualize_derivative_scenario_grid(scenario_grid, *, metric='price', chart='surface', backend=None, theme=None, save_path=None, filename=None)¶
Visualize a derivative spot–volatility scenario grid.
- Parameters:
scenario_grid (object) – Object exposing a long-form
dataDataFrame withspot_price,volatility, and the selected metric column.metric (str, default="price") – Scenario metric to display.
chart ({"surface", "heatmap", "curves"}, default="surface") – Visual form for the scenario table.
backend ({"matplotlib", "plotly"}, optional) – Per-call backend override.
theme (VisualizationTheme, optional) – Per-call style override.
save_path (str or pathlib.Path, optional) – Explicit export path.
filename (str, optional) – Filename relative to the active theme’s save directory.
- Returns:
Backend-native figure object.
- Return type:
matplotlib.figure.Figure or plotly.graph_objects.Figure
- abaquant.visualization.options.visualize_option_chain_analytics(analytics, *, chart='iv_smile', option_type='call', metric='implied_volatility', backend=None, theme=None, save_path=None, filename=None, **kwargs)¶
Visualize listed-option-chain analytics with the active theme.
- Parameters:
analytics (object) – Option-chain analytics object exposing
iv_smile,iv_surface,term_structure,rich_cheap_table, andopen_interest_grid.chart ({"iv_smile", "iv_surface", "term_structure", "rich_cheap", "open_interest_heatmap"}, default="iv_smile") – Chain diagnostic to render.
option_type ({"call", "put"}, default="call") – Option family used by diagnostics that accept an option-family filter.
metric (str, default="implied_volatility") – Metric displayed by surface charts.
backend ({"matplotlib", "plotly"}, optional) – Per-call backend override.
theme (VisualizationTheme, optional) – Per-call style override.
save_path (str or pathlib.Path, optional) – Explicit output path.
filename (str, optional) – Filename relative to the active theme save directory.
**kwargs (object) – Additional keyword arguments forwarded to the requested analytic table.
- Returns:
Backend-native figure object.
- Return type:
matplotlib.figure.Figure or plotly.graph_objects.Figure
- abaquant.visualization.options.visualize_option_strategy(strategy, *, chart='payoff', backend=None, theme=None, save_path=None, filename=None, spot_min=None, spot_max=None, points=501)¶
Visualize a composable option strategy payoff profile.
- Parameters:
strategy (object) – Strategy object exposing
profile(...)andbreak_even_points().chart ({"payoff", "components"}, default="payoff") –
"payoff"plots aggregate net profit."components"also plots each leg’s net profit contribution.backend ({"matplotlib", "plotly"}, optional) – Backend override.
theme (VisualizationTheme, optional) – Per-call style override.
save_path (str or pathlib.Path, optional) – Explicit export path.
filename (str, optional) – Filename relative to the active theme’s save directory.
spot_min (float, optional) – Terminal-price grid bounds.
spot_max (float, optional) – Terminal-price grid bounds.
points (int, default=501) – Number of grid points for the payoff table.
- Returns:
Backend-native figure object.
- Return type:
matplotlib.figure.Figure or plotly.graph_objects.Figure
- abaquant.visualization.options.visualize_calibration_result(calibration_result, *, chart='model_vs_market', backend=None, theme=None, save_path=None, filename=None)¶
Visualize an option-model calibration result.
- Parameters:
calibration_result (object) – Calibration result exposing
model_dataandparameter_table().chart ({"model_vs_market", "residuals", "parameters"}, default="model_vs_market") – Diagnostic to render.
"model_vs_market"compares the fitted model with observed market values,"residuals"shows fit errors by strike, and"parameters"displays calibrated parameter values.backend ({"matplotlib", "plotly"}, optional) – Per-call backend override.
theme (VisualizationTheme, optional) – Per-call style override.
save_path (str or pathlib.Path, optional) – Explicit export path.
filename (str, optional) – Filename relative to the active theme save directory.
- Returns:
Backend-native figure object.
- Return type:
matplotlib.figure.Figure or plotly.graph_objects.Figure