You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/3_user-guide.md
+51-2Lines changed: 51 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,14 +97,57 @@ from oipd import MarketInputs
97
97
98
98
market = MarketInputs(
99
99
risk_free_rate=0.04,
100
-
valuation_date=snapshot.date, #or a fixed date
100
+
valuation_date=snapshot.asof, #recommended for intraday precision
101
101
underlying_price=snapshot.underlying_price, # set explicitly if snapshot is unavailable
102
102
# optional:
103
103
# risk_free_rate_mode="annualized", # default
104
104
# dividend_yield=0.01,
105
105
)
106
106
```
107
107
108
+
`valuation_date` accepts both plain dates and full datetimes. Date-only values
109
+
remain fully supported, and full datetimes (for example `snapshot.asof`) should
110
+
be preferred when intraday precision matters.
111
+
112
+
Market-object contract:
113
+
114
+
-`valuation_date` remains the public field name and stores the canonical
115
+
normalized timestamp.
116
+
-`valuation_calendar_date` is the explicit date-only convenience view.
117
+
-`valuation_timestamp` remains as a temporary compatibility alias to the same
118
+
canonical timestamp value.
119
+
120
+
The option maturity field remains `expiry`. OIPD keeps `valuation_date` as the
121
+
public input name for backwards compatibility, but internally it resolves both
122
+
`valuation_date` and `expiry` to full timestamps before computing maturity.
123
+
That means exact `time_to_expiry_years` is now the source-of-truth input for
124
+
pricing, calibration, and probability calculations. Reporting in day units now
125
+
uses explicit `time_to_expiry_days`, while `calendar_days_to_expiry` is the
126
+
explicit integer calendar bucket.
127
+
128
+
Maturity contract:
129
+
130
+
-`oipd.core.maturity` is the canonical home of maturity logic.
131
+
-`time_to_expiry_years` is the pricing truth.
132
+
-`time_to_expiry_days` is the continuous reporting truth.
133
+
-`calendar_days_to_expiry` is the integer calendar bucket.
134
+
135
+
Migration note:
136
+
137
+
- replace old `days_to_expiry` inputs with `time_to_expiry_years` for pricing
138
+
or `time_to_expiry_days` for reporting
139
+
- replace old `days_to_expiry` metadata reads with
140
+
`calendar_days_to_expiry` if you intended integer calendar-bucket semantics
141
+
142
+
If you use explicit dividends in the Black-Scholes path, `dividend_schedule`
143
+
supports both date-only and timestamp-style `ex_date` values. Same-day timing
144
+
matters: an ex-dividend timestamp after `valuation_date` is included in pricing,
145
+
while one before `valuation_date` is excluded. Date-only dividend rows keep the
146
+
current midnight semantics for backwards compatibility.
147
+
148
+
Timezone display redesign is still out of scope for this cycle. Intraday
149
+
arithmetic is supported, but timezone-aware display semantics are unchanged.
150
+
108
151
### 2.3 Fit single-expiry (`VolCurve`) or multi-expiry (`VolSurface`)
109
152
110
153
Single-expiry example:
@@ -143,6 +186,12 @@ Both surface objects support *slicing*:
143
186
144
187
After slicing, you can use the same methods you would use on regular curve objects (`implied_vol`, `price`, `greeks`, `iv_results` for volatility curves; `pdf`, `prob_below`, `quantile`, `density_results`, `plot` for probability curves).
145
188
189
+
When `expiry` or `valuation_date` includes a non-midnight timestamp, OIPD
190
+
preserves that intraday precision through surface queries and will show the
191
+
time-of-day in labels/plots where relevant. Midnight timestamps continue to
192
+
render as date-only labels, so older date-based workflows remain visually
|**Expiries**|`expiries` (1-tuple) | Single expiry date. |`expiries` (list) | List of fitted expiry dates. |
174
223
|**Distributions**|`implied_distribution()`| Get `ProbCurve` (RND). |`implied_distribution()`| Get `ProbSurface` (RND Surface). |
175
224
|**Visualization (2D curve)**|`plot()`| Plot fitted smile vs market. |`plot()`| Overlayed IV smiles. |
176
-
|**Visualization (3D surface)**|||`plot_3d()`| Isometric 3D volatility surface. |
225
+
|**Visualization (3D surface)**|||`plot_3d()`| Isometric 3D volatility surface. `expiry_range` accepts date-like bounds and is converted to continuous `time_to_expiry_days` internally. |
177
226
|**Term Structure**|||`plot_term_structure()`| Interpolated ATM-forward IV term structure vs days to expiry. |
0 commit comments