voly 0.0.46__tar.gz → 0.0.47__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.46
3
+ Version: 0.0.47
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "voly"
7
- version = "0.0.46"
7
+ version = "0.0.47"
8
8
  description = "Options & volatility research package"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -60,7 +60,7 @@ line_length = 100
60
60
  multi_line_output = 3
61
61
 
62
62
  [tool.mypy]
63
- python_version = "0.0.46"
63
+ python_version = "0.0.47"
64
64
  warn_return_any = true
65
65
  warn_unused_configs = true
66
66
  disallow_untyped_defs = true
@@ -13,7 +13,7 @@ import plotly.graph_objects as go
13
13
 
14
14
  from voly.utils.logger import logger, catch_exception, setup_file_logging
15
15
  from voly.exceptions import VolyError
16
- from voly.models import SVIModel
16
+ from voly.models import SVIModel, svi, svi_d, svi_dd
17
17
  from voly.formulas import (
18
18
  d1, d2, bs, delta, gamma, vega, theta, rho, vanna, volga, charm, greeks, iv
19
19
  )
@@ -84,9 +84,21 @@ class VolyClient:
84
84
  raise
85
85
 
86
86
  # -------------------------------------------------------------------------
87
- # Black-Scholes and Greeks Calculations
87
+ # SVI, Black-Scholes and Greeks Calculations
88
88
  # -------------------------------------------------------------------------
89
89
 
90
+ @staticmethod
91
+ def svi(log_moneyness_array: float, a: float, b: float, sigma: float, rho: float, m: float) -> float:
92
+ return svi(log_moneyness_array, a, b, sigma, rho, m)
93
+
94
+ @staticmethod
95
+ def svi_d(log_moneyness_array: float, a: float, b: float, sigma: float, rho: float, m: float) -> float:
96
+ return svi_d(log_moneyness_array, a, b, sigma, rho, m)
97
+
98
+ @staticmethod
99
+ def svi_dd(log_moneyness_array: float, a: float, b: float, sigma: float, rho: float, m: float) -> float:
100
+ return svi_dd(log_moneyness_array, a, b, sigma, rho, m)
101
+
90
102
  @staticmethod
91
103
  def d1(s: float, k: float, r: float, vol: float, t: float,
92
104
  option_type: str = 'call') -> float:
@@ -42,16 +42,16 @@ class SVIModel:
42
42
  }
43
43
 
44
44
  @staticmethod
45
- def svi(moneyness: float, a: float, b: float, sigma: float, rho: float, m: float) -> float:
46
- return a + b * (rho * (moneyness - m) + np.sqrt((moneyness - m) ** 2 + sigma ** 2))
45
+ def svi(log_moneyness_array: float, a: float, b: float, sigma: float, rho: float, m: float) -> float:
46
+ return a + b * (rho * (log_moneyness_array - m) + np.sqrt((log_moneyness_array - m) ** 2 + sigma ** 2))
47
47
 
48
48
  @staticmethod
49
- def svi_d(moneyness: float, a: float, b: float, sigma: float, rho: float, m: float) -> float:
50
- return b * (rho + ((moneyness - m) / np.sqrt((moneyness - m) ** 2 + sigma ** 2)))
49
+ def svi_d(log_moneyness_array: float, a: float, b: float, sigma: float, rho: float, m: float) -> float:
50
+ return b * (rho + ((log_moneyness_array - m) / np.sqrt((log_moneyness_array - m) ** 2 + sigma ** 2)))
51
51
 
52
52
  @staticmethod
53
- def svi_dd(moneyness: float, a: float, b: float, sigma: float, rho: float, m: float) -> float:
54
- return b * sigma ** 2 / ((moneyness - m) ** 2 + sigma ** 2) ** 1.5
53
+ def svi_dd(log_moneyness_array: float, a: float, b: float, sigma: float, rho: float, m: float) -> float:
54
+ return b * log_moneyness_array ** 2 / ((log_moneyness_array - m) ** 2 + sigma ** 2) ** 1.5
55
55
 
56
56
  @staticmethod
57
57
  def svi_min_strike(sigma: float, rho: float, m: float) -> float:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.46
3
+ Version: 0.0.47
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes