voly 0.0.43__py3-none-any.whl → 0.0.45__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
@@ -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
@@ -36,18 +36,19 @@ def vectorize_inputs(func):
36
36
 
37
37
  @catch_exception
38
38
  @vectorize_inputs
39
- def d1(s: float, k: float, r: float, vol: float, t: float) -> float:
39
+ def d1(s: float, k: float, r: float, vol: float, t: float, option_type: str = 'call') -> float:
40
+ # option_type is ignored in this function but included for compatibility
40
41
  if vol <= 0 or t <= 0:
41
42
  return np.nan
42
- return (np.log(s / k) + (r + vol * vol / 2) * t) / (vol * np.sqrt(t))
43
-
43
+ return (np.log(s / k) + (r + vol ** 2 / 2) * t) / (vol * np.sqrt(t))
44
44
 
45
45
  @catch_exception
46
46
  @vectorize_inputs
47
- def d2(s: float, k: float, r: float, vol: float, t: float) -> float:
47
+ def d2(s: float, k: float, r: float, vol: float, t: float, option_type: str = 'call') -> float:
48
+ # option_type is ignored in this function but included for compatibility
48
49
  if vol <= 0 or t <= 0:
49
50
  return np.nan
50
- return d1(s, k, r, vol, t) - vol * np.sqrt(t)
51
+ return d1(s, k, r, vol, t, option_type) - vol * np.sqrt(t)
51
52
 
52
53
 
53
54
  @catch_exception
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.43
3
+ Version: 0.0.45
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=1UhouPsIvZRylIqe8UyONwSgZvSzpXoMve_1c-KbP5A,19527
3
3
  voly/exceptions.py,sha256=PBsbn1vNMvKcCJwwJ4lBO6glD85jo1h2qiEmD7ArAjs,92
4
- voly/formulas.py,sha256=FvxDNtian6bUvQdFbHEa1pGuhmsqyyW8wJ_4dwVQjKg,8320
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.43.dist-info/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
15
- voly-0.0.43.dist-info/METADATA,sha256=4-qY6hJJ4KWuDmGLkqTAbWVihwrWfoUF6Wm7KU8rh3U,4092
16
- voly-0.0.43.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
17
- voly-0.0.43.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
18
- voly-0.0.43.dist-info/RECORD,,
14
+ voly-0.0.45.dist-info/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
15
+ voly-0.0.45.dist-info/METADATA,sha256=dzVR5JNfPxPm5H11VIfG3b4Aw_ZLVTmnNH7tmYOL_vU,4092
16
+ voly-0.0.45.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
17
+ voly-0.0.45.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
18
+ voly-0.0.45.dist-info/RECORD,,
File without changes
File without changes