Dashboard¶
The dashboard package contains all components for the Streamlit dashboard UI,
including the main service layer, plotting functions, and UI widgets.
plot_calendar_heatmap ¶
Plot the calandar heatmap.
Source code in src/optpricing/dashboard/plots.py
plot_error_heatmap ¶
plot_error_heatmap(market_surface: DataFrame, model_surface: DataFrame, model_name: str) -> go.Figure
Plots a heatmap of the pricing error (Model IV - Market IV) in basis points. FIXED: Handles duplicate index entries before pivoting.
Source code in src/optpricing/dashboard/plots.py
plot_iv_surface_3d ¶
Creates an interactive, INTERPOLATED 3D plot of the volatility surfaces.
Source code in src/optpricing/dashboard/plots.py
plot_smiles_by_expiry ¶
Generates a robust Plotly figure with volatility smiles for key expiries.
Source code in src/optpricing/dashboard/plots.py
DashboardService ¶
DashboardService(ticker: str, snapshot_date: str, model_configs: dict[str, Any], *, settings: CalibrationSettings | None = None, use_tuned: bool = True, allow_mc: bool = False)
Loads a chain (live or snapshot), calibrates the selected models with the
offline :class:~optpricing.workflows.DailyWorkflow and builds the market
and model implied-volatility surfaces for the plots.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ticker
|
str
|
Ticker symbol. |
required |
snapshot_date
|
str
|
|
required |
model_configs
|
dict[str, Any]
|
Recipes keyed by model name. |
required |
settings
|
CalibrationSettings | None
|
Calibration settings for every model (defaults if omitted). |
None
|
use_tuned
|
bool
|
Prefer the settings cached by |
True
|
allow_mc
|
bool
|
Permit Monte Carlo pricing for simulation-only models. |
False
|
Source code in src/optpricing/dashboard/service.py
calculate_iv_surfaces ¶
Market and per-model Black-Scholes implied-volatility surfaces.
Source code in src/optpricing/dashboard/service.py
run_calibrations ¶
Calibrates every configured model and fills the summary table.
Source code in src/optpricing/dashboard/service.py
settings_for ¶
Tuned settings for this ticker/model when requested and cached.
Source code in src/optpricing/dashboard/service.py
build_sidebar ¶
Builds the consistent sidebar for the dashboard and returns the selections.
Uses st.query_params to manage state for deep-linking.
Returns:
| Type | Description |
|---|---|
tuple[str, str, str]
|
A tuple containing the selected ticker, snapshot_date, and model_name. |