voly 0.0.25__tar.gz → 0.0.28__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.25/src/voly.egg-info → voly-0.0.28}/PKG-INFO +1 -1
- {voly-0.0.25 → voly-0.0.28}/pyproject.toml +2 -2
- {voly-0.0.25 → voly-0.0.28}/src/voly/client.py +2 -2
- {voly-0.0.25 → voly-0.0.28}/src/voly/core/charts.py +28 -34
- {voly-0.0.25 → voly-0.0.28/src/voly.egg-info}/PKG-INFO +1 -1
- {voly-0.0.25 → voly-0.0.28}/LICENSE +0 -0
- {voly-0.0.25 → voly-0.0.28}/README.md +0 -0
- {voly-0.0.25 → voly-0.0.28}/setup.cfg +0 -0
- {voly-0.0.25 → voly-0.0.28}/setup.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/__init__.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/core/__init__.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/core/data.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/core/fit.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/core/interpolate.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/core/rnd.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/exceptions.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/formulas.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/models.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/utils/__init__.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly/utils/logger.py +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly.egg-info/SOURCES.txt +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly.egg-info/dependency_links.txt +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly.egg-info/requires.txt +0 -0
- {voly-0.0.25 → voly-0.0.28}/src/voly.egg-info/top_level.txt +0 -0
- {voly-0.0.25 → voly-0.0.28}/tests/test_client.py +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.28"
|
|
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.28"
|
|
64
64
|
warn_return_any = true
|
|
65
65
|
warn_unused_configs = true
|
|
66
66
|
disallow_untyped_defs = true
|
|
@@ -22,8 +22,8 @@ from voly.core.fit import fit_model, get_surface
|
|
|
22
22
|
from voly.core.rnd import calculate_rnd, calculate_pdf, calculate_cdf, calculate_strike_probability
|
|
23
23
|
from voly.core.interpolate import interpolate_model
|
|
24
24
|
from voly.core.charts import (
|
|
25
|
-
plot_all_smiles, plot_3d_surface, plot_parameters,
|
|
26
|
-
|
|
25
|
+
plot_all_smiles, plot_3d_surface, plot_parameters, plot_fit_performance,
|
|
26
|
+
plot_fit_performance, plot_rnd, plot_pdf, plot_cdf, plot_rnd_all_expiries,
|
|
27
27
|
plot_rnd_3d, plot_rnd_statistics, plot_interpolated_surface
|
|
28
28
|
)
|
|
29
29
|
|
|
@@ -46,47 +46,41 @@ def plot_volatility_smile(moneyness: np.ndarray,
|
|
|
46
46
|
y=iv * 100, # Convert to percentage
|
|
47
47
|
mode='lines',
|
|
48
48
|
name='Model',
|
|
49
|
-
line=dict(color='#
|
|
49
|
+
line=dict(color='#636EFA', width=2)
|
|
50
50
|
)
|
|
51
51
|
)
|
|
52
52
|
|
|
53
|
-
#
|
|
54
|
-
|
|
55
|
-
# Filter market data for the specific expiry
|
|
56
|
-
expiry_data = market_data[market_data['yte'] == expiry]
|
|
53
|
+
# Filter market data for the specific expiry
|
|
54
|
+
expiry_data = market_data[market_data['yte'] == expiry]
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)
|
|
56
|
+
if not expiry_data.empty:
|
|
57
|
+
# Add bid IV
|
|
58
|
+
fig.add_trace(
|
|
59
|
+
go.Scatter(
|
|
60
|
+
x=expiry_data['log_moneyness'],
|
|
61
|
+
y=expiry_data['bid_iv'] * 100, # Convert to percentage
|
|
62
|
+
mode='markers',
|
|
63
|
+
name='Bid IV',
|
|
64
|
+
marker=dict(size=8, symbol='circle', opacity=0.7)
|
|
68
65
|
)
|
|
66
|
+
)
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)
|
|
68
|
+
# Add ask IV
|
|
69
|
+
fig.add_trace(
|
|
70
|
+
go.Scatter(
|
|
71
|
+
x=expiry_data['log_moneyness'],
|
|
72
|
+
y=expiry_data['ask_iv'] * 100, # Convert to percentage
|
|
73
|
+
mode='markers',
|
|
74
|
+
name='Ask IV',
|
|
75
|
+
marker=dict(size=8, symbol='circle', opacity=0.7)
|
|
79
76
|
)
|
|
77
|
+
)
|
|
80
78
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
# Use default title if not provided
|
|
88
|
-
if title is None:
|
|
89
|
-
title = 'Volatility Smile'
|
|
79
|
+
# Get maturity name and DTE for title if not provided
|
|
80
|
+
if title is None:
|
|
81
|
+
maturity_name = expiry_data['maturity_name'].iloc[0]
|
|
82
|
+
dte_value = expiry_data['dte'].iloc[0]
|
|
83
|
+
title = f'Vol Smile for {maturity_name} (DTE: {dte_value:.1f})'
|
|
90
84
|
|
|
91
85
|
# Update layout
|
|
92
86
|
fig.update_layout(
|
|
@@ -243,7 +237,7 @@ def plot_parameters(raw_param_matrix: pd.DataFrame,
|
|
|
243
237
|
|
|
244
238
|
|
|
245
239
|
@catch_exception
|
|
246
|
-
def
|
|
240
|
+
def plot_fit_performance(fit_performance: pd.DataFrame) -> go.Figure:
|
|
247
241
|
"""
|
|
248
242
|
Plot the fitting accuracy statistics.
|
|
249
243
|
|
|
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
|