Skip to content

Commit e934e26

Browse files
committed
Updatet tests
1 parent be75d55 commit e934e26

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_core.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"maximum_return_in_the_domain": 2011.0,
1717
"implied_volatility": [0.0, 0.456],
1818
"in_the_money_probability": [1.0, 0.256866624586934],
19+
"probability_of_touch": [1.0, 0.5277250352054264],
1920
"delta": [1.0, -0.30713817729665704],
2021
"gamma": [0.0, 0.013948977387090415],
2122
"theta": [0.0, 0.19283555235589467],
@@ -33,6 +34,7 @@
3334
"maximum_return_in_the_domain": 740.0000000000018,
3435
"implied_volatility": [0.494, 0.482],
3536
"in_the_money_probability": [0.54558925139931, 0.465831136209786],
37+
"probability_of_touch": [1.0, 0.9661799112521838],
3638
"delta": [0.6039490632362865, -0.525237550169406],
3739
"gamma": [0.015297136732317718, 0.015806160944019643],
3840
"theta": [-0.21821351060901806, 0.22301627833773927],
@@ -51,6 +53,7 @@
5153
"maximum_return_in_the_domain": 114.99999999999999,
5254
"implied_volatility": [0.256],
5355
"in_the_money_probability": [0.1832371984432129],
56+
"probability_of_touch": [0.3741546603689868],
5457
"delta": [-0.20371918274704337],
5558
"gamma": [0.023104402361599465],
5659
"theta": [0.091289876347897],
@@ -85,11 +88,13 @@ def test_black_scholes():
8588
assert bs.call_theta == -8.780589609657586
8689
assert bs.call_rho == 0.04600635174517672
8790
assert bs.call_itm_prob == 0.2669832523577367
91+
assert bs.call_prob_of_touch == 0.5403744790632351
8892
assert bs.put_price == 6.27
8993
assert bs.put_delta == -0.7057027999944967
9094
assert bs.put_theta == -7.732314219179215
9195
assert bs.put_rho == -0.12631289052524033
9296
assert bs.put_itm_prob == 0.7330167476422633
97+
assert bs.put_prob_of_touch == 1.0
9398
assert bs.gamma == 0.042503588182705464
9499
assert bs.vega == 0.13973782416231934
95100

@@ -190,6 +195,7 @@ def test_covered_call_w_prev_position(nvidia):
190195
"maximum_return_in_the_domain": 3011.0,
191196
"implied_volatility": [0.0, 0.456],
192197
"in_the_money_probability": [1.0, 0.256866624586934],
198+
"probability_of_touch": [1.0, 0.5277250352054264],
193199
"delta": [1.0, -0.30713817729665704],
194200
"gamma": [0.0, 0.013948977387090415],
195201
"theta": [0.0, 0.19283555235589467],
@@ -312,6 +318,7 @@ def test_3_legs(nvidia):
312318
"maximum_return_in_the_domain": 11740.0,
313319
"implied_volatility": [0.0, 0.494, 0.482],
314320
"in_the_money_probability": [1.0, 0.54558925139931, 0.465831136209786],
321+
"probability_of_touch": [1.0, 1.0, 0.9661799112521838],
315322
"delta": [1.0, 0.6039490632362865, -0.525237550169406],
316323
"gamma": [0.0, 0.015297136732317718, 0.015806160944019643],
317324
"theta": [0.0, -0.21821351060901806, 0.22301627833773927],
@@ -372,6 +379,7 @@ def test_calendar_spread():
372379
"maximum_return_in_the_domain": 3009.999999999999,
373380
"implied_volatility": [0.47300000000000003, 0.419],
374381
"in_the_money_probability": [0.4895105709759477, 0.4805997906939539],
382+
"probability_of_touch": [1.0, 1.0],
375383
"delta": [-0.5216914758915705, 0.5273457614638198],
376384
"gamma": [0.03882722919950356, 0.02669940508461828],
377385
"theta": [0.22727438444823292, -0.15634971608107964],

0 commit comments

Comments
 (0)