voly 0.0.76__py3-none-any.whl → 0.0.78__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/charts.py +2 -0
- voly/core/data.py +2 -2
- {voly-0.0.76.dist-info → voly-0.0.78.dist-info}/METADATA +1 -1
- {voly-0.0.76.dist-info → voly-0.0.78.dist-info}/RECORD +7 -7
- {voly-0.0.76.dist-info → voly-0.0.78.dist-info}/LICENSE +0 -0
- {voly-0.0.76.dist-info → voly-0.0.78.dist-info}/WHEEL +0 -0
- {voly-0.0.76.dist-info → voly-0.0.78.dist-info}/top_level.txt +0 -0
voly/core/charts.py
CHANGED
|
@@ -61,6 +61,8 @@ def plot_volatility_smile(x_array: np.ndarray,
|
|
|
61
61
|
# Add market data if provided
|
|
62
62
|
if option_chain is not None and maturity is not None:
|
|
63
63
|
maturity_data = option_chain[option_chain['maturity_name'] == maturity]
|
|
64
|
+
if return_domain == 'delta':
|
|
65
|
+
maturity_data = maturity_data[maturity_data['option_type']=='C']
|
|
64
66
|
|
|
65
67
|
if not maturity_data.empty:
|
|
66
68
|
# Add bid and ask IVs if available
|
voly/core/data.py
CHANGED
|
@@ -200,7 +200,7 @@ def process_option_chain(df: pd.DataFrame, currency: str) -> pd.DataFrame:
|
|
|
200
200
|
splits = df['instrument_name'].str.split('-')
|
|
201
201
|
df['currency'] = splits.str[0]
|
|
202
202
|
df['maturity_name'] = splits.str[1]
|
|
203
|
-
df['
|
|
203
|
+
df['strikes'] = splits.str[2].astype(float)
|
|
204
204
|
df['option_type'] = splits.str[3]
|
|
205
205
|
|
|
206
206
|
# Create maturity date at 8:00 AM UTC
|
|
@@ -224,7 +224,7 @@ def process_option_chain(df: pd.DataFrame, currency: str) -> pd.DataFrame:
|
|
|
224
224
|
df['ask_iv'] = df['ask_iv'].replace({0: np.nan}) / 100
|
|
225
225
|
|
|
226
226
|
# Calculate log-moneyness
|
|
227
|
-
df['log_moneyness'] = np.log(df['index_price'] / df['
|
|
227
|
+
df['log_moneyness'] = np.log(df['index_price'] / df['strikes'])
|
|
228
228
|
# Calculate moneyness
|
|
229
229
|
df['moneyness'] = np.exp(df['log_moneyness'])
|
|
230
230
|
|
|
@@ -4,15 +4,15 @@ voly/exceptions.py,sha256=PBsbn1vNMvKcCJwwJ4lBO6glD85jo1h2qiEmD7ArAjs,92
|
|
|
4
4
|
voly/formulas.py,sha256=wSbGAH6GuQThT9QyQY4Ud2eUf9fo1YFHglUmP6fNris,11871
|
|
5
5
|
voly/models.py,sha256=LXXIlpXZQEfXTuCngxC8Hd3bWtw6wdXDCSGxTLmHM-c,3659
|
|
6
6
|
voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
|
|
7
|
-
voly/core/charts.py,sha256=
|
|
8
|
-
voly/core/data.py,sha256=
|
|
7
|
+
voly/core/charts.py,sha256=4LrpN14DXeqhcO6JitKY_wHYAAJqcf2z9CvKdvu5Q5c,27175
|
|
8
|
+
voly/core/data.py,sha256=JCPD44UDSJqh83jjapAtXVpJEHm8Hq4JC8lVhl5Zb4A,8935
|
|
9
9
|
voly/core/fit.py,sha256=JOr2XjM-I9HtfbyEN0tdGuNCZimQ2ttm4lNUpF-tKb4,9226
|
|
10
10
|
voly/core/interpolate.py,sha256=ztVIePJZOh-CIbn69wkh1JW2rKywNe2FEewRN0zcSAo,8185
|
|
11
11
|
voly/core/rnd.py,sha256=8FTU-Qp9epW9yE4XSOdiFGIRXrGyXqF6mVgZn1NMvxk,11813
|
|
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.78.dist-info/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
|
|
15
|
+
voly-0.0.78.dist-info/METADATA,sha256=e5sEfgeHuswinGxYlluMgcoe84IorOWwfFO67ZqV58c,4092
|
|
16
|
+
voly-0.0.78.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
|
17
|
+
voly-0.0.78.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
|
|
18
|
+
voly-0.0.78.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|