Dashboard Service#
This file contains the core service layer that drives the dashboard application.
Orchestrates all logic for the Streamlit dashboard.
This class acts as a stateful service to manage data loading, model calibration, and result generation for a given ticker and date.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ticker
|
str
|
The stock ticker to analyze. |
required |
snapshot_date
|
str
|
The market data snapshot date ('YYYY-MM-DD') or 'Live Data'. |
required |
model_configs
|
dict[str, Any]
|
A dictionary of model configurations to be used for calibration. |
required |
Source code in src/quantfin/dashboard/service.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
market_data: pd.DataFrame
property
#
Lazily loads the market data for the selected ticker and date.
Returns:
Type | Description |
---|---|
DataFrame
|
A DataFrame containing the option chain market data. |
rate: Rate
property
#
Lazily computes and caches the risk-free Rate object.
The rate is implied from put-call parity.
Returns:
Type | Description |
---|---|
Rate
|
A Rate instance representing the risk-free rate. |
stock: Stock
property
#
Lazily computes and caches the underlying Stock object.
The dividend yield is implied from put-call parity.
Returns:
Type | Description |
---|---|
Stock
|
A Stock instance representing the underlying asset. |
get_iv_plots()
#
Generates and returns the volatility smile and 3D surface plots.
It first computes the market IV surface, then computes the IV surface for each successfully calibrated model, and finally generates the plots.
Returns:
Type | Description |
---|---|
tuple[Figure, Figure]
|
A tuple containing the volatility smile figure and the 3D surface figure. |
Source code in src/quantfin/dashboard/service.py
run_calibrations()
#
Runs the daily calibration workflow for all selected models.
This method iterates through the model configurations, runs the
DailyWorkflow
for each, and stores the calibrated models and
a summary of the results.