voly 0.0.205__tar.gz → 0.0.207__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {voly-0.0.205/src/voly.egg-info → voly-0.0.207}/PKG-INFO +1 -1
- {voly-0.0.205 → voly-0.0.207}/pyproject.toml +2 -2
- {voly-0.0.205 → voly-0.0.207}/src/voly/core/charts.py +2 -2
- {voly-0.0.205 → voly-0.0.207}/src/voly/core/fit.py +4 -4
- {voly-0.0.205 → voly-0.0.207}/src/voly/models.py +4 -4
- {voly-0.0.205 → voly-0.0.207/src/voly.egg-info}/PKG-INFO +1 -1
- {voly-0.0.205 → voly-0.0.207}/LICENSE +0 -0
- {voly-0.0.205 → voly-0.0.207}/README.md +0 -0
- {voly-0.0.205 → voly-0.0.207}/setup.cfg +0 -0
- {voly-0.0.205 → voly-0.0.207}/setup.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/__init__.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/client.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/core/__init__.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/core/data.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/core/hd.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/core/interpolate.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/core/rnd.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/exceptions.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/formulas.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/utils/__init__.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/utils/density.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly/utils/logger.py +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly.egg-info/SOURCES.txt +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly.egg-info/dependency_links.txt +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly.egg-info/requires.txt +0 -0
- {voly-0.0.205 → voly-0.0.207}/src/voly.egg-info/top_level.txt +0 -0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "voly"
|
7
|
-
version = "0.0.
|
7
|
+
version = "0.0.207"
|
8
8
|
description = "Options & volatility research package"
|
9
9
|
readme = "README.md"
|
10
10
|
authors = [
|
@@ -60,7 +60,7 @@ line_length = 100
|
|
60
60
|
multi_line_output = 3
|
61
61
|
|
62
62
|
[tool.mypy]
|
63
|
-
python_version = "0.0.
|
63
|
+
python_version = "0.0.207"
|
64
64
|
warn_return_any = true
|
65
65
|
warn_unused_configs = true
|
66
66
|
disallow_untyped_defs = true
|
@@ -63,8 +63,8 @@ def plot_volatility_smile(x_array: np.ndarray,
|
|
63
63
|
# Add market data if provided
|
64
64
|
if option_chain is not None and maturity is not None:
|
65
65
|
maturity_data = option_chain[option_chain['maturity_name'] == maturity]
|
66
|
-
if return_domain == 'delta':
|
67
|
-
|
66
|
+
#if return_domain == 'delta':
|
67
|
+
maturity_data = maturity_data[maturity_data['option_type'] == 'C']
|
68
68
|
|
69
69
|
if not maturity_data.empty:
|
70
70
|
# Add bid and ask IVs if available
|
@@ -145,7 +145,7 @@ class SVICalibrator:
|
|
145
145
|
# Not enough data points for fitting
|
146
146
|
if len(k) <= 5:
|
147
147
|
result = self.failed_calibration(maturity, maturity_name, t, len(k))
|
148
|
-
logger.error(f'
|
148
|
+
logger.error(f'\033[31mFAILED\033[0m for {maturity} (insufficient data points)')
|
149
149
|
self.update_results(result)
|
150
150
|
return maturity
|
151
151
|
|
@@ -155,7 +155,7 @@ class SVICalibrator:
|
|
155
155
|
# If fitting failed
|
156
156
|
if np.isnan(params[0]):
|
157
157
|
result = self.failed_calibration(maturity, maturity_name, t, len(k))
|
158
|
-
logger.error(f'
|
158
|
+
logger.error(f'\033[31mFAILED\033[0m for {maturity}')
|
159
159
|
self.update_results(result)
|
160
160
|
return maturity
|
161
161
|
|
@@ -178,8 +178,8 @@ class SVICalibrator:
|
|
178
178
|
**stats
|
179
179
|
}
|
180
180
|
|
181
|
-
logger.info(
|
182
|
-
|
181
|
+
logger.info(f'\033[32mSUCCESS\033[0m for {maturity}: a={stats["a"]:.4f}, b={stats["b"]:.4f}, m={stats["m"]:.4f}, rho={stats["rho"]:.4f}, sigma={stats["sigma"]:.4f}')
|
182
|
+
logger.info("=================================================================")
|
183
183
|
|
184
184
|
self.update_results(result)
|
185
185
|
return maturity
|
@@ -176,11 +176,11 @@ class SVIModel:
|
|
176
176
|
w_current = cls.svi(k_constraint, new_params[0] * t, new_params[1] * t, *new_params[2:])
|
177
177
|
w_prev = cls.svi(k_constraint, a_prev * prev_t, b_prev * prev_t, m_prev, rho_prev, sigma_prev)
|
178
178
|
violation = np.min(w_current - w_prev)
|
179
|
-
|
180
|
-
|
179
|
+
logger.info(f"Calendar arbitrage correction {'successful' if violation >= -1e-6 else 'failed'} for t={t:.4f}, "
|
180
|
+
f"min margin={violation:.6f}")
|
181
181
|
return new_params
|
182
182
|
|
183
|
-
|
183
|
+
logger.error(f"Calendar arbitrage correction failed for t={t:.4f}")
|
184
184
|
return params
|
185
185
|
|
186
186
|
@classmethod
|
@@ -221,7 +221,7 @@ class SVIModel:
|
|
221
221
|
w1 = cls.svi(k_val, a1 * t1, b1 * t1, m1, rho1, sigma1)
|
222
222
|
w2 = cls.svi(k_val, a2 * t2, b2 * t2, m2, rho2, sigma2)
|
223
223
|
if w2 < w1 - 1e-6:
|
224
|
-
|
224
|
+
logger.warning(
|
225
225
|
f"Calendar arbitrage violation at t1={t1:.4f}, t2={t2:.4f}, k={k_val:.4f}: w1={w1:.6f}, w2={w2:.6f}")
|
226
226
|
return False
|
227
227
|
return True
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|