voly 0.0.210__py3-none-any.whl → 0.0.212__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 CHANGED
@@ -27,6 +27,7 @@ class SVICalibrator:
27
27
  self.option_chain = option_chain
28
28
  self.currency = currency
29
29
  self.s = option_chain['index_price'].iloc[0]
30
+ self.r = option_chain['interest_rate'].iloc[0] if 'interest_rate' in option_chain else 0.0
30
31
  self.groups = option_chain.groupby('maturity_date')
31
32
  self.params_dict = {}
32
33
  self.results_data = {}
@@ -34,7 +35,7 @@ class SVICalibrator:
34
35
 
35
36
  # Initialize results data template
36
37
  self.field_names = [
37
- 's', 't', 'maturity_date', 'maturity_name', 'a', 'b', 'm', 'rho', 'sigma',
38
+ 's', 't', 'r', 'maturity_date', 'maturity_name', 'a', 'b', 'm', 'rho', 'sigma',
38
39
  'nu', 'psi', 'p', 'c', 'nu_tilde', 'log_min_strike', 'usd_min_strike',
39
40
  'fit_success', 'butterfly_arbitrage_free', 'calendar_arbitrage_free',
40
41
  'rmse', 'mae', 'r2', 'max_error', 'loss', 'n_points'
@@ -49,6 +50,7 @@ class SVICalibrator:
49
50
  return {
50
51
  's': float(self.s),
51
52
  't': float(t),
53
+ 'r': float(self.r),
52
54
  'maturity_date': maturity,
53
55
  'maturity_name': maturity_name,
54
56
  'fit_success': False,
@@ -169,6 +171,7 @@ class SVICalibrator:
169
171
  result = {
170
172
  's': float(self.s),
171
173
  't': float(t),
174
+ 'r': float(self.r),
172
175
  'maturity_date': maturity,
173
176
  'maturity_name': maturity_name,
174
177
  'fit_success': True,
voly/formulas.py CHANGED
@@ -305,7 +305,7 @@ def get_domain(domain_params: Tuple[float, float, int] = (-1.5, 1.5, 1000),
305
305
  elif return_domain == 'strikes':
306
306
  if s is None:
307
307
  raise ValueError("Spot price 's' is required for return_domain='strikes'.")
308
- return s / np.exp(LM)
308
+ return np.exp(LM) * s
309
309
 
310
310
  elif return_domain == 'delta':
311
311
  # Check for required parameters
@@ -320,7 +320,7 @@ def get_domain(domain_params: Tuple[float, float, int] = (-1.5, 1.5, 1000),
320
320
  f"Length 'o'={len(o)}, length 'LM'={len(LM)}")
321
321
 
322
322
  # Compute strikes
323
- K = s / np.exp(LM)
323
+ K = np.exp(LM) * s
324
324
 
325
325
  # Compute deltas
326
326
  D = delta(s, K, r, o, t, 'call')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: voly
3
- Version: 0.0.210
3
+ Version: 0.0.212
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
@@ -1,20 +1,20 @@
1
1
  voly/__init__.py,sha256=8xyDk7rFCn_MOD5hxuv5cxxKZvBVRiSIM7TgaMPpwpw,211
2
2
  voly/client.py,sha256=0kp2_I-imcJ6uxMcvS0BipS2PgWdFaCPZG5335Vg75Q,14383
3
3
  voly/exceptions.py,sha256=PBsbn1vNMvKcCJwwJ4lBO6glD85jo1h2qiEmD7ArAjs,92
4
- voly/formulas.py,sha256=JnEs6G0wlfRNH6X_YEJMe2RtLH-ryhzufjsim73Bj3c,11176
4
+ voly/formulas.py,sha256=Jn9hBoIx6PGv9k4lm8PeGM4lxFJkrLau8LpnXatdQPM,11176
5
5
  voly/models.py,sha256=tcilQxvUwObN41ar0j3pBmsw9Q5ddFRIa_LvrqNPx3Q,9305
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=SNF87C7-r-1IbKwf7rAhXkJ6X305yo7fCDJDdkwz3NM,14103
9
- voly/core/fit.py,sha256=Iz-khsr4KrM3KUheJX7iHWUDbAzueSZvqjt47BGYZig,14024
9
+ voly/core/fit.py,sha256=XlqMfVC4EUC0YmmQU-Za_4SSVoQsa6ndT6AWXgdWVFU,14192
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.210.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
17
- voly-0.0.210.dist-info/METADATA,sha256=nOb1_GHx1y4Q020yf6HygkYn4RD5vKbNhWRJCBKHsXM,4115
18
- voly-0.0.210.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
19
- voly-0.0.210.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
20
- voly-0.0.210.dist-info/RECORD,,
16
+ voly-0.0.212.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
17
+ voly-0.0.212.dist-info/METADATA,sha256=X15mBA_SRU4iVsc7mrfj3b0unomoIxqgoZSFZYPj9V0,4115
18
+ voly-0.0.212.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
19
+ voly-0.0.212.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
20
+ voly-0.0.212.dist-info/RECORD,,
File without changes