voly 0.0.44__py3-none-any.whl → 0.0.46__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/client.py CHANGED
@@ -15,7 +15,7 @@ from voly.utils.logger import logger, catch_exception, setup_file_logging
15
15
  from voly.exceptions import VolyError
16
16
  from voly.models import SVIModel
17
17
  from voly.formulas import (
18
- bs, delta, gamma, vega, theta, rho, vanna, volga, charm, greeks, iv
18
+ d1, d2, bs, delta, gamma, vega, theta, rho, vanna, volga, charm, greeks, iv
19
19
  )
20
20
  from voly.core.data import fetch_option_chain, process_option_chain
21
21
  from voly.core.fit import fit_model, get_iv_surface
@@ -87,6 +87,16 @@ class VolyClient:
87
87
  # Black-Scholes and Greeks Calculations
88
88
  # -------------------------------------------------------------------------
89
89
 
90
+ @staticmethod
91
+ def d1(s: float, k: float, r: float, vol: float, t: float,
92
+ option_type: str = 'call') -> float:
93
+ return d1(s, k, r, vol, t, option_type)
94
+
95
+ @staticmethod
96
+ def d2(s: float, k: float, r: float, vol: float, t: float,
97
+ option_type: str = 'call') -> float:
98
+ return d2(s, k, r, vol, t, option_type)
99
+
90
100
  @staticmethod
91
101
  def bs(s: float, k: float, r: float, vol: float, t: float,
92
102
  option_type: str = 'call') -> float:
voly/formulas.py CHANGED
@@ -40,8 +40,7 @@ def d1(s: float, k: float, r: float, vol: float, t: float, option_type: str = 'c
40
40
  # option_type is ignored in this function but included for compatibility
41
41
  if vol <= 0 or t <= 0:
42
42
  return np.nan
43
- return (np.log(s / k) + (r + vol * vol / 2) * t) / (vol * np.sqrt(t))
44
-
43
+ return (np.log(s / k) + (r + vol ** 2 / 2) * t) / (vol * np.sqrt(t))
45
44
 
46
45
  @catch_exception
47
46
  @vectorize_inputs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.44
3
+ Version: 0.0.46
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
@@ -1,7 +1,7 @@
1
1
  voly/__init__.py,sha256=8xyDk7rFCn_MOD5hxuv5cxxKZvBVRiSIM7TgaMPpwpw,211
2
- voly/client.py,sha256=8nBT2cbjSCYn9Qf1xEFMifmlggkg7BI9ANFVNhHYKUI,19171
2
+ voly/client.py,sha256=s74ZNnmo_ecCq2iXKOggnI8ydAemqaVpPOo7lj-ukbU,19535
3
3
  voly/exceptions.py,sha256=PBsbn1vNMvKcCJwwJ4lBO6glD85jo1h2qiEmD7ArAjs,92
4
- voly/formulas.py,sha256=vk00FVVtdxPz2sL89fK-6q9WW-rqyjVhwbPPLiZGaIU,8541
4
+ voly/formulas.py,sha256=XA8E19pKQtMWNUB6qB04laifsok9E0Wt7HVq4wNM6QE,8539
5
5
  voly/models.py,sha256=YJ12aamLz_-aOni4Qm0_XV9u4bjKK3vfJz0J2gc1h0o,3565
6
6
  voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
7
7
  voly/core/charts.py,sha256=T8cogkiHj8NcFxfARumNvAjLJUAxsMlHUOVgshwjye8,26474
@@ -11,8 +11,8 @@ 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.44.dist-info/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
15
- voly-0.0.44.dist-info/METADATA,sha256=hKSBZrDxJeHiUbguAQ0Bmq98DXwUc-SE5a3TVPs8HQo,4092
16
- voly-0.0.44.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
17
- voly-0.0.44.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
18
- voly-0.0.44.dist-info/RECORD,,
14
+ voly-0.0.46.dist-info/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
15
+ voly-0.0.46.dist-info/METADATA,sha256=aQ6AKZw78TbI6nENrP9mDq1qd4RChZ4-xrrktN2nYyw,4092
16
+ voly-0.0.46.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
17
+ voly-0.0.46.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
18
+ voly-0.0.46.dist-info/RECORD,,
File without changes
File without changes