Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black-Scholes implied vol BelowIntrinsicError with negative risk-free rate #13

Closed
stnatter opened this issue Apr 11, 2020 · 1 comment
Closed

Comments

@stnatter
Copy link

Trying to calculate the implied vol for Eurostoxx50 options and running into problems due to the negative risk-free rate in EUR:

from py_vollib.black_scholes.implied_volatility import implied_volatility
implied_volatility(price=107.35, S=3576.1, K=3575, t=0.139726, r=-0.618873, flag='p')

Any suggestions how to handle/overcome this?


BelowIntrinsicException Traceback (most recent call last)
in
1 from py_vollib.black_scholes.implied_volatility import implied_volatility
----> 2 implied_volatility(price=107.35, S=3576.1, K=3575, t=0.139726, r=-0.618873, flag='p')

~/miniconda3/lib/python3.8/site-packages/py_vollib/black_scholes/implied_volatility.py in implied_volatility(price, S, K, t, r, flag)
89 undiscounted_option_price = price / deflater
90 F = forward_price(S, t, r)
---> 91 sigma_calc = iv(undiscounted_option_price, F, K, t, binary_flag[flag])
92 if sigma_calc == FLOAT_MAX:
93 raise PriceIsAboveMaximum()

~/miniconda3/lib/python3.8/site-packages/py_lets_be_rational/lets_be_rational.py in implied_volatility_from_a_transformed_rational_guess(price, F, K, T, q)
650 :rtype: float
651 """
--> 652 return implied_volatility_from_a_transformed_rational_guess_with_limited_iterations(
653 price, F, K, T, q, implied_volatility_maximum_iterations)
654

~/miniconda3/lib/python3.8/site-packages/py_lets_be_rational/lets_be_rational.py in implied_volatility_from_a_transformed_rational_guess_with_limited_iterations(price, F, K, T, q, N)
601 intrinsic = fabs(max(K - F if q < 0 else F - K, 0.0))
602 if price < intrinsic:
--> 603 raise BelowIntrinsicException
604 max_price = K if q < 0 else F
605 if price >= max_price:

BelowIntrinsicException: The volatility is below the intrinsic value.

@stnatter
Copy link
Author

mea culpa. breaks of course down with non-sensical rates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant