voly 0.0.187__py3-none-any.whl → 0.0.189__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 +1 -10
- {voly-0.0.187.dist-info → voly-0.0.189.dist-info}/METADATA +1 -1
- {voly-0.0.187.dist-info → voly-0.0.189.dist-info}/RECORD +6 -6
- {voly-0.0.187.dist-info → voly-0.0.189.dist-info}/WHEEL +0 -0
- {voly-0.0.187.dist-info → voly-0.0.189.dist-info}/licenses/LICENSE +0 -0
- {voly-0.0.187.dist-info → voly-0.0.189.dist-info}/top_level.txt +0 -0
voly/core/fit.py
CHANGED
@@ -37,11 +37,8 @@ def fit_model(option_chain: pd.DataFrame) -> pd.DataFrame:
|
|
37
37
|
# Define column names and their data types
|
38
38
|
column_dtypes = {
|
39
39
|
's': float,
|
40
|
-
'u': float,
|
41
40
|
't': float,
|
42
41
|
'r': float,
|
43
|
-
'oi': float,
|
44
|
-
'volume': float,
|
45
42
|
'maturity_date': 'datetime64[ns]',
|
46
43
|
'a': float,
|
47
44
|
'b': float,
|
@@ -67,6 +64,7 @@ def fit_model(option_chain: pd.DataFrame) -> pd.DataFrame:
|
|
67
64
|
}
|
68
65
|
|
69
66
|
s = option_chain['index_price'].iloc[0]
|
67
|
+
unique_ts = sorted(option_chain['t'].unique())
|
70
68
|
maturity_names = [option_chain[option_chain['t'] == t]['maturity_name'].iloc[0] for t in unique_ts]
|
71
69
|
groups = option_chain.groupby('maturity_date')
|
72
70
|
params_dict = {}
|
@@ -94,7 +92,6 @@ def fit_model(option_chain: pd.DataFrame) -> pd.DataFrame:
|
|
94
92
|
|
95
93
|
# Combine cleaned duplicates and unique rows
|
96
94
|
maturity_data = pd.concat([unique_iv, cleaned_duplicated_iv])
|
97
|
-
#maturity_name = maturity_data['maturity_name'].iloc[0]
|
98
95
|
maturity_date = maturity_data['maturity_date'].iloc[0]
|
99
96
|
|
100
97
|
t = group['t'].iloc[0]
|
@@ -113,10 +110,7 @@ def fit_model(option_chain: pd.DataFrame) -> pd.DataFrame:
|
|
113
110
|
nu = psi = p = c = nu_tilde = np.nan
|
114
111
|
rmse = mae = r2 = max_error = np.nan
|
115
112
|
butterfly_arbitrage_free = True
|
116
|
-
u = s # Assume underlying_price is index_price
|
117
113
|
r = maturity_data['interest_rate'].iloc[0] if 'interest_rate' in maturity_data.columns else 0
|
118
|
-
oi = maturity_data['open_interest'].sum() if 'open_interest' in maturity_data.columns else 0
|
119
|
-
volume = maturity_data['volume'].sum() if 'volume' in maturity_data.columns else 0
|
120
114
|
log_min_strike = usd_min_strike = np.nan
|
121
115
|
|
122
116
|
if len(k) > 5:
|
@@ -165,11 +159,8 @@ def fit_model(option_chain: pd.DataFrame) -> pd.DataFrame:
|
|
165
159
|
|
166
160
|
# Store results
|
167
161
|
results_data['s'].append(float(s))
|
168
|
-
results_data['u'].append(float(u))
|
169
162
|
results_data['t'].append(float(t))
|
170
163
|
results_data['r'].append(float(r))
|
171
|
-
results_data['oi'].append(float(oi))
|
172
|
-
results_data['volume'].append(float(volume))
|
173
164
|
results_data['maturity_date'].append(maturity_date)
|
174
165
|
results_data['a'].append(float(a_scaled) if not np.isnan(params[0]) else np.nan)
|
175
166
|
results_data['b'].append(float(b_scaled) if not np.isnan(params[0]) else np.nan)
|
@@ -6,15 +6,15 @@ voly/models.py,sha256=2aNGsF3joCx4jGbiF8m0zxEW_nvcSBERSYPSKCXV3us,7019
|
|
6
6
|
voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
|
7
7
|
voly/core/charts.py,sha256=2S-BfCo30aj1_xlNLqF-za5rQWxF_mWKIdtdOe5bgbw,12735
|
8
8
|
voly/core/data.py,sha256=9v9iuE2XdIIlzoRAB7q1ol7YghBzBsPGAiwZ11oDuis,13650
|
9
|
-
voly/core/fit.py,sha256=
|
9
|
+
voly/core/fit.py,sha256=cHd4SmdsjSKnllH-g_pU7_L8N9dSl07Q6tsqDjd2jNA,17217
|
10
10
|
voly/core/hd.py,sha256=UFAyLncNUHivpPAcko6IK1bC55mudVtdlRFfXp63HXE,14771
|
11
11
|
voly/core/interpolate.py,sha256=JkK172-FXyhesW3hY4pEeuJWG3Bugq7QZXbeKoRpLuo,5305
|
12
12
|
voly/core/rnd.py,sha256=GoC3m1Q46Wnk5tV_mstr-3_aktHeue6BBLh4DQTciW0,13307
|
13
13
|
voly/utils/__init__.py,sha256=E05mWatyC-PDOsCxQV1p5Xi1IgpOomxrNURyCx_gB-w,200
|
14
14
|
voly/utils/density.py,sha256=q0fX4im9TGwMCZ32Hzdv8CNh56KnJo8bmG5w0gVWZH8,5879
|
15
15
|
voly/utils/logger.py,sha256=4-_2bVJmq17Q0d7Rd2mPg1AeR8gxv6EPvcmBDMFWcSM,1744
|
16
|
-
voly-0.0.
|
17
|
-
voly-0.0.
|
18
|
-
voly-0.0.
|
19
|
-
voly-0.0.
|
20
|
-
voly-0.0.
|
16
|
+
voly-0.0.189.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
|
17
|
+
voly-0.0.189.dist-info/METADATA,sha256=Tz2ZLYVNWXtm9123NubqXctsRkv0j2gteQRLw0S2SCg,4115
|
18
|
+
voly-0.0.189.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
19
|
+
voly-0.0.189.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
|
20
|
+
voly-0.0.189.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|