|
16 | 16 | "maximum_return_in_the_domain": 2011.0, |
17 | 17 | "implied_volatility": [0.0, 0.456], |
18 | 18 | "in_the_money_probability": [1.0, 0.256866624586934], |
| 19 | + "probability_of_touch": [1.0, 0.5277250352054264], |
19 | 20 | "delta": [1.0, -0.30713817729665704], |
20 | 21 | "gamma": [0.0, 0.013948977387090415], |
21 | 22 | "theta": [0.0, 0.19283555235589467], |
|
33 | 34 | "maximum_return_in_the_domain": 740.0000000000018, |
34 | 35 | "implied_volatility": [0.494, 0.482], |
35 | 36 | "in_the_money_probability": [0.54558925139931, 0.465831136209786], |
| 37 | + "probability_of_touch": [1.0, 0.9661799112521838], |
36 | 38 | "delta": [0.6039490632362865, -0.525237550169406], |
37 | 39 | "gamma": [0.015297136732317718, 0.015806160944019643], |
38 | 40 | "theta": [-0.21821351060901806, 0.22301627833773927], |
|
51 | 53 | "maximum_return_in_the_domain": 114.99999999999999, |
52 | 54 | "implied_volatility": [0.256], |
53 | 55 | "in_the_money_probability": [0.1832371984432129], |
| 56 | + "probability_of_touch": [0.3741546603689868], |
54 | 57 | "delta": [-0.20371918274704337], |
55 | 58 | "gamma": [0.023104402361599465], |
56 | 59 | "theta": [0.091289876347897], |
@@ -85,11 +88,13 @@ def test_black_scholes(): |
85 | 88 | assert bs.call_theta == -8.780589609657586 |
86 | 89 | assert bs.call_rho == 0.04600635174517672 |
87 | 90 | assert bs.call_itm_prob == 0.2669832523577367 |
| 91 | + assert bs.call_prob_of_touch == 0.5403744790632351 |
88 | 92 | assert bs.put_price == 6.27 |
89 | 93 | assert bs.put_delta == -0.7057027999944967 |
90 | 94 | assert bs.put_theta == -7.732314219179215 |
91 | 95 | assert bs.put_rho == -0.12631289052524033 |
92 | 96 | assert bs.put_itm_prob == 0.7330167476422633 |
| 97 | + assert bs.put_prob_of_touch == 1.0 |
93 | 98 | assert bs.gamma == 0.042503588182705464 |
94 | 99 | assert bs.vega == 0.13973782416231934 |
95 | 100 |
|
@@ -190,6 +195,7 @@ def test_covered_call_w_prev_position(nvidia): |
190 | 195 | "maximum_return_in_the_domain": 3011.0, |
191 | 196 | "implied_volatility": [0.0, 0.456], |
192 | 197 | "in_the_money_probability": [1.0, 0.256866624586934], |
| 198 | + "probability_of_touch": [1.0, 0.5277250352054264], |
193 | 199 | "delta": [1.0, -0.30713817729665704], |
194 | 200 | "gamma": [0.0, 0.013948977387090415], |
195 | 201 | "theta": [0.0, 0.19283555235589467], |
@@ -312,6 +318,7 @@ def test_3_legs(nvidia): |
312 | 318 | "maximum_return_in_the_domain": 11740.0, |
313 | 319 | "implied_volatility": [0.0, 0.494, 0.482], |
314 | 320 | "in_the_money_probability": [1.0, 0.54558925139931, 0.465831136209786], |
| 321 | + "probability_of_touch": [1.0, 1.0, 0.9661799112521838], |
315 | 322 | "delta": [1.0, 0.6039490632362865, -0.525237550169406], |
316 | 323 | "gamma": [0.0, 0.015297136732317718, 0.015806160944019643], |
317 | 324 | "theta": [0.0, -0.21821351060901806, 0.22301627833773927], |
@@ -372,6 +379,7 @@ def test_calendar_spread(): |
372 | 379 | "maximum_return_in_the_domain": 3009.999999999999, |
373 | 380 | "implied_volatility": [0.47300000000000003, 0.419], |
374 | 381 | "in_the_money_probability": [0.4895105709759477, 0.4805997906939539], |
| 382 | + "probability_of_touch": [1.0, 1.0], |
375 | 383 | "delta": [-0.5216914758915705, 0.5273457614638198], |
376 | 384 | "gamma": [0.03882722919950356, 0.02669940508461828], |
377 | 385 | "theta": [0.22727438444823292, -0.15634971608107964], |
|
0 commit comments