voly 0.0.15__py3-none-any.whl → 0.0.16__py3-none-any.whl
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/core/fit.py +9 -4
- {voly-0.0.15.dist-info → voly-0.0.16.dist-info}/METADATA +1 -1
- {voly-0.0.15.dist-info → voly-0.0.16.dist-info}/RECORD +6 -6
- {voly-0.0.15.dist-info → voly-0.0.16.dist-info}/LICENSE +0 -0
- {voly-0.0.15.dist-info → voly-0.0.16.dist-info}/WHEEL +0 -0
- {voly-0.0.15.dist-info → voly-0.0.16.dist-info}/top_level.txt +0 -0
voly/core/fit.py
CHANGED
|
@@ -90,6 +90,11 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
90
90
|
# Dictionary to store parameters
|
|
91
91
|
params_dict = {}
|
|
92
92
|
|
|
93
|
+
# ANSI color codes for terminal output
|
|
94
|
+
GREEN = '\033[32m'
|
|
95
|
+
RED = '\033[31m'
|
|
96
|
+
RESET = '\033[0m'
|
|
97
|
+
|
|
93
98
|
# Get unique expiries
|
|
94
99
|
unique_expiries = sorted(market_data['yte'].unique())
|
|
95
100
|
|
|
@@ -99,7 +104,7 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
99
104
|
maturity_name = expiry_data['maturity_name'].iloc[0]
|
|
100
105
|
dte_value = expiry_data['dte'].iloc[0]
|
|
101
106
|
|
|
102
|
-
logger.info(f"Optimizing for {maturity_name}
|
|
107
|
+
logger.info(f"Optimizing for {maturity_name}...")
|
|
103
108
|
|
|
104
109
|
# Optimize SVI parameters
|
|
105
110
|
try:
|
|
@@ -133,7 +138,7 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
133
138
|
max_error = np.max(np.abs(iv_market - iv_model))
|
|
134
139
|
num_points = len(expiry_data)
|
|
135
140
|
|
|
136
|
-
# Add to fit data
|
|
141
|
+
# Add to fit data
|
|
137
142
|
fit_data['Maturity'].append(maturity_name)
|
|
138
143
|
fit_data['DTE'].append(dte_value)
|
|
139
144
|
fit_data['YTE'].append(yte)
|
|
@@ -147,9 +152,9 @@ def fit_svi_parameters(market_data: pd.DataFrame,
|
|
|
147
152
|
fit_data['Number of Points'].append(num_points)
|
|
148
153
|
|
|
149
154
|
if result.success:
|
|
150
|
-
logger.info(f'Optimization for {maturity_name}
|
|
155
|
+
logger.info(f'Optimization for {maturity_name}: {GREEN}SUCCESS{RESET}')
|
|
151
156
|
else:
|
|
152
|
-
logger.warning(f'Optimization for {maturity_name}
|
|
157
|
+
logger.warning(f'Optimization for {maturity_name}: {RED}FAILED{RESET}')
|
|
153
158
|
|
|
154
159
|
logger.info('------------------------------------------')
|
|
155
160
|
|
|
@@ -6,13 +6,13 @@ voly/models.py,sha256=YJ12aamLz_-aOni4Qm0_XV9u4bjKK3vfJz0J2gc1h0o,3565
|
|
|
6
6
|
voly/core/__init__.py,sha256=GU6l7hpxJfitPx9jnmBtcb_QIeqOO8liZsSbLXXSbq8,384
|
|
7
7
|
voly/core/charts.py,sha256=GF55IS-aZfcc_0yoSPRPIPBPcJhFD1El18wNCo_mI_A,29918
|
|
8
8
|
voly/core/data.py,sha256=Dfk-ByHpdteUiLXr0p-wRLr3VAmdyjdDBKwjwdTgCjA,9939
|
|
9
|
-
voly/core/fit.py,sha256=
|
|
9
|
+
voly/core/fit.py,sha256=a7SlvYygqIzsDv2VH-ZBs1C_QFq-9FVrSt-dKSNbElk,9936
|
|
10
10
|
voly/core/interpolate.py,sha256=ztVIePJZOh-CIbn69wkh1JW2rKywNe2FEewRN0zcSAo,8185
|
|
11
11
|
voly/core/rnd.py,sha256=-xBVzvM9sMIBtfOfWyBJKtiVcBShSGTNNp2PZFOD5j0,12155
|
|
12
12
|
voly/utils/__init__.py,sha256=E05mWatyC-PDOsCxQV1p5Xi1IgpOomxrNURyCx_gB-w,200
|
|
13
13
|
voly/utils/logger.py,sha256=4-_2bVJmq17Q0d7Rd2mPg1AeR8gxv6EPvcmBDMFWcSM,1744
|
|
14
|
-
voly-0.0.
|
|
15
|
-
voly-0.0.
|
|
16
|
-
voly-0.0.
|
|
17
|
-
voly-0.0.
|
|
18
|
-
voly-0.0.
|
|
14
|
+
voly-0.0.16.dist-info/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
|
|
15
|
+
voly-0.0.16.dist-info/METADATA,sha256=NUBOaoUgGN9dvIGEqmoTSFtldQNZPCjqgfefkCx3eG4,4092
|
|
16
|
+
voly-0.0.16.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
17
|
+
voly-0.0.16.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
|
|
18
|
+
voly-0.0.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|