voly 0.0.14__tar.gz → 0.0.16__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.14/src/voly.egg-info → voly-0.0.16}/PKG-INFO +1 -1
- {voly-0.0.14 → voly-0.0.16}/pyproject.toml +2 -2
- {voly-0.0.14 → voly-0.0.16}/src/voly/core/fit.py +12 -4
- {voly-0.0.14 → voly-0.0.16/src/voly.egg-info}/PKG-INFO +1 -1
- {voly-0.0.14 → voly-0.0.16}/LICENSE +0 -0
- {voly-0.0.14 → voly-0.0.16}/README.md +0 -0
- {voly-0.0.14 → voly-0.0.16}/setup.cfg +0 -0
- {voly-0.0.14 → voly-0.0.16}/setup.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/__init__.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/client.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/core/__init__.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/core/charts.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/core/data.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/core/interpolate.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/core/rnd.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/exceptions.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/formulas.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/models.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/utils/__init__.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly/utils/logger.py +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly.egg-info/SOURCES.txt +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly.egg-info/dependency_links.txt +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly.egg-info/requires.txt +0 -0
- {voly-0.0.14 → voly-0.0.16}/src/voly.egg-info/top_level.txt +0 -0
- {voly-0.0.14 → voly-0.0.16}/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.16"
|
|
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.16"
|
|
64
64
|
warn_return_any = true
|
|
65
65
|
warn_unused_configs = true
|
|
66
66
|
disallow_untyped_defs = true
|
|
@@ -76,6 +76,7 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
76
76
|
fit_data = {
|
|
77
77
|
'Maturity': [],
|
|
78
78
|
'DTE': [],
|
|
79
|
+
'YTE': [],
|
|
79
80
|
'Success': [],
|
|
80
81
|
'Cost': [],
|
|
81
82
|
'Optimality': [],
|
|
@@ -89,6 +90,11 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
89
90
|
# Dictionary to store parameters
|
|
90
91
|
params_dict = {}
|
|
91
92
|
|
|
93
|
+
# ANSI color codes for terminal output
|
|
94
|
+
GREEN = '\033[32m'
|
|
95
|
+
RED = '\033[31m'
|
|
96
|
+
RESET = '\033[0m'
|
|
97
|
+
|
|
92
98
|
# Get unique expiries
|
|
93
99
|
unique_expiries = sorted(market_data['yte'].unique())
|
|
94
100
|
|
|
@@ -98,7 +104,7 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
98
104
|
maturity_name = expiry_data['maturity_name'].iloc[0]
|
|
99
105
|
dte_value = expiry_data['dte'].iloc[0]
|
|
100
106
|
|
|
101
|
-
logger.info(f"Optimizing for {maturity_name}
|
|
107
|
+
logger.info(f"Optimizing for {maturity_name}...")
|
|
102
108
|
|
|
103
109
|
# Optimize SVI parameters
|
|
104
110
|
try:
|
|
@@ -116,7 +122,8 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
116
122
|
params = result.x
|
|
117
123
|
params_dict[maturity_name] = {
|
|
118
124
|
'params': params,
|
|
119
|
-
'dte': dte_value
|
|
125
|
+
'dte': dte_value,
|
|
126
|
+
'yte': yte
|
|
120
127
|
}
|
|
121
128
|
|
|
122
129
|
# Calculate model predictions for statistics
|
|
@@ -134,6 +141,7 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
134
141
|
# Add to fit data
|
|
135
142
|
fit_data['Maturity'].append(maturity_name)
|
|
136
143
|
fit_data['DTE'].append(dte_value)
|
|
144
|
+
fit_data['YTE'].append(yte)
|
|
137
145
|
fit_data['Success'].append(result.success)
|
|
138
146
|
fit_data['Cost'].append(result.cost)
|
|
139
147
|
fit_data['Optimality'].append(result.optimality)
|
|
@@ -144,9 +152,9 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
144
152
|
fit_data['Number of Points'].append(num_points)
|
|
145
153
|
|
|
146
154
|
if result.success:
|
|
147
|
-
logger.info(f'Optimization for {maturity_name}
|
|
155
|
+
logger.info(f'Optimization for {maturity_name}: {GREEN}SUCCESS{RESET}')
|
|
148
156
|
else:
|
|
149
|
-
logger.warning(f'Optimization for {maturity_name}
|
|
157
|
+
logger.warning(f'Optimization for {maturity_name}: {RED}FAILED{RESET}')
|
|
150
158
|
|
|
151
159
|
logger.info('------------------------------------------')
|
|
152
160
|
|
|
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
|
|
File without changes
|