I am currently working with some options OHLC data (30 minute bars) from IBKR for a range of strike prices, maturities and for both calls/puts. For each bar, I am trying to back out the IV (crudely using the 3m treasury as a proxy for the risk-free rate and pyvollib/scipy's optimize.brentq method for the actual IV calculation), but however I am running into an issue.
I have noticed that whenever the IV calculation breaks down - it usually breaks down for ITM options and/or options that are close to expiration (1~10 days), by break down I mean it either returns an abnormally small number or throws an exception (something like: The volatility is below the intrinsic value.)
Why is this happening and are there any other methods/approximations I can use to successfully calculate the IV for ITM/deep ITM options, how do options data providers deal with this? This link (https://github.com/vollib/py_vollib/issues/5) provides some insight but I still cannot fully grasp the numerical instability issues, would appreciate any pointers!