voly 0.0.162__py3-none-any.whl → 0.0.163__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/formulas.py +0 -28
- {voly-0.0.162.dist-info → voly-0.0.163.dist-info}/METADATA +1 -1
- {voly-0.0.162.dist-info → voly-0.0.163.dist-info}/RECORD +6 -6
- {voly-0.0.162.dist-info → voly-0.0.163.dist-info}/WHEEL +0 -0
- {voly-0.0.162.dist-info → voly-0.0.163.dist-info}/licenses/LICENSE +0 -0
- {voly-0.0.162.dist-info → voly-0.0.163.dist-info}/top_level.txt +0 -0
voly/formulas.py
CHANGED
@@ -60,8 +60,6 @@ def vectorize_inputs(func):
|
|
60
60
|
@vectorize_inputs
|
61
61
|
def d1(s: float, K: float, r: float, o: float, t: float, option_type: str = 'call') -> float:
|
62
62
|
# option_type is ignored in this function but included for compatibility
|
63
|
-
if o <= 0 or t <= 0:
|
64
|
-
return np.nan
|
65
63
|
return (np.log(s / K) + (r + o ** 2 / 2) * t) / (o * np.sqrt(t))
|
66
64
|
|
67
65
|
|
@@ -69,8 +67,6 @@ def d1(s: float, K: float, r: float, o: float, t: float, option_type: str = 'cal
|
|
69
67
|
@vectorize_inputs
|
70
68
|
def d2(s: float, K: float, r: float, o: float, t: float, option_type: str = 'call') -> float:
|
71
69
|
# option_type is ignored in this function but included for compatibility
|
72
|
-
if o <= 0 or t <= 0:
|
73
|
-
return np.nan
|
74
70
|
return d1(s, K, r, o, t, option_type) - o * np.sqrt(t)
|
75
71
|
|
76
72
|
|
@@ -114,9 +110,6 @@ def delta(s: float, K: float, r: float, o: float, t: float, option_type: str = '
|
|
114
110
|
@catch_exception
|
115
111
|
@vectorize_inputs
|
116
112
|
def gamma(s: float, K: float, r: float, o: float, t: float, option_type: str = 'call') -> float:
|
117
|
-
if o <= 0 or t <= 0:
|
118
|
-
return 0.0
|
119
|
-
|
120
113
|
d1_val = d1(s, K, r, o, t, option_type)
|
121
114
|
return norm.pdf(d1_val) / (s * o * np.sqrt(t))
|
122
115
|
|
@@ -124,9 +117,6 @@ def gamma(s: float, K: float, r: float, o: float, t: float, option_type: str = '
|
|
124
117
|
@catch_exception
|
125
118
|
@vectorize_inputs
|
126
119
|
def vega(s: float, K: float, r: float, o: float, t: float, option_type: str = 'call') -> float:
|
127
|
-
if o <= 0 or t <= 0:
|
128
|
-
return 0.0
|
129
|
-
|
130
120
|
d1_val = d1(s, K, r, o, t, option_type)
|
131
121
|
return s * norm.pdf(d1_val) * np.sqrt(t) / 100 # Divided by 100 for 1% change
|
132
122
|
|
@@ -134,9 +124,6 @@ def vega(s: float, K: float, r: float, o: float, t: float, option_type: str = 'c
|
|
134
124
|
@catch_exception
|
135
125
|
@vectorize_inputs
|
136
126
|
def theta(s: float, K: float, r: float, o: float, t: float, option_type: str = 'call') -> float:
|
137
|
-
if o <= 0 or t <= 0:
|
138
|
-
return 0.0
|
139
|
-
|
140
127
|
d1_val = d1(s, K, r, o, t, option_type)
|
141
128
|
d2_val = d2(s, K, r, o, t, option_type)
|
142
129
|
|
@@ -156,9 +143,6 @@ def theta(s: float, K: float, r: float, o: float, t: float, option_type: str = '
|
|
156
143
|
@catch_exception
|
157
144
|
@vectorize_inputs
|
158
145
|
def rho(s: float, K: float, r: float, o: float, t: float, option_type: str = 'call') -> float:
|
159
|
-
if o <= 0 or t <= 0:
|
160
|
-
return 0.0
|
161
|
-
|
162
146
|
d2_val = d2(s, K, r, o, t, option_type)
|
163
147
|
|
164
148
|
if option_type.lower() in ["call", "c"]:
|
@@ -170,9 +154,6 @@ def rho(s: float, K: float, r: float, o: float, t: float, option_type: str = 'ca
|
|
170
154
|
@catch_exception
|
171
155
|
@vectorize_inputs
|
172
156
|
def vanna(s: float, K: float, r: float, o: float, t: float, option_type: str = 'call') -> float:
|
173
|
-
if o <= 0 or t <= 0:
|
174
|
-
return 0.0
|
175
|
-
|
176
157
|
d1_val = d1(s, K, r, o, t, option_type)
|
177
158
|
d2_val = d2(s, K, r, o, t, option_type)
|
178
159
|
|
@@ -182,9 +163,6 @@ def vanna(s: float, K: float, r: float, o: float, t: float, option_type: str = '
|
|
182
163
|
@catch_exception
|
183
164
|
@vectorize_inputs
|
184
165
|
def volga(s: float, K: float, r: float, o: float, t: float, option_type: str = 'call') -> float:
|
185
|
-
if o <= 0 or t <= 0:
|
186
|
-
return 0.0
|
187
|
-
|
188
166
|
d1_val = d1(s, K, r, o, t, option_type)
|
189
167
|
d2_val = d2(s, K, r, o, t, option_type)
|
190
168
|
|
@@ -194,9 +172,6 @@ def volga(s: float, K: float, r: float, o: float, t: float, option_type: str = '
|
|
194
172
|
@catch_exception
|
195
173
|
@vectorize_inputs
|
196
174
|
def charm(s: float, K: float, r: float, o: float, t: float, option_type: str = 'call') -> float:
|
197
|
-
if o <= 0 or t <= 0:
|
198
|
-
return 0.0
|
199
|
-
|
200
175
|
d1_val = d1(s, K, r, o, t, option_type)
|
201
176
|
d2_val = d2(s, K, r, o, t, option_type)
|
202
177
|
|
@@ -248,9 +223,6 @@ def iv(option_price: float, s: float, K: float, r: float, t: float,
|
|
248
223
|
Returns:
|
249
224
|
- Implied volatility
|
250
225
|
"""
|
251
|
-
if t <= 0:
|
252
|
-
return np.nan
|
253
|
-
|
254
226
|
# Check if option price is within theoretical bounds
|
255
227
|
if option_type.lower() in ["call", "c"]:
|
256
228
|
intrinsic = max(0, s - K * np.exp(-r * t))
|
@@ -1,7 +1,7 @@
|
|
1
1
|
voly/__init__.py,sha256=8xyDk7rFCn_MOD5hxuv5cxxKZvBVRiSIM7TgaMPpwpw,211
|
2
2
|
voly/client.py,sha256=-yE1_cBvjkK-BO_kKCYtn4WPbNOhAzT0hsfykU5LvQQ,14761
|
3
3
|
voly/exceptions.py,sha256=PBsbn1vNMvKcCJwwJ4lBO6glD85jo1h2qiEmD7ArAjs,92
|
4
|
-
voly/formulas.py,sha256=
|
4
|
+
voly/formulas.py,sha256=yClxKgwOAOpTvTANTkivf2JlGh0WDwjMzkm3JPgBVbQ,11188
|
5
5
|
voly/models.py,sha256=o-pHujGfr5Gn8ItckMzLI4Q8yaX9FQaV8UjCxv2zgTY,3364
|
6
6
|
voly/core/__init__.py,sha256=bu6fS2I1Pj9fPPnl-zY3L7NqrZSY5Zy6NY2uMUvdhKs,183
|
7
7
|
voly/core/charts.py,sha256=E21OZB5lTY4YL2flgaFJ6s5g3_ExtAQT2zryZZxLPyM,12735
|
@@ -13,8 +13,8 @@ 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.
|
17
|
-
voly-0.0.
|
18
|
-
voly-0.0.
|
19
|
-
voly-0.0.
|
20
|
-
voly-0.0.
|
16
|
+
voly-0.0.163.dist-info/licenses/LICENSE,sha256=wcHIVbE12jfcBOai_wqBKY6xvNQU5E909xL1zZNq_2Q,1065
|
17
|
+
voly-0.0.163.dist-info/METADATA,sha256=x5afx6En4M8gw3RIQGJLmSMavZl5J_bhUiJibLtyNX0,4115
|
18
|
+
voly-0.0.163.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
|
19
|
+
voly-0.0.163.dist-info/top_level.txt,sha256=ZfLw2sSxF-LrKAkgGjOmeTcw6_gD-30zvtdEY5W4B7c,5
|
20
|
+
voly-0.0.163.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|