Skip to content
All library documents

Diagnosing Unattainable Implied Volatility in QuantLib’s Black Formula

Article Quant Q&A · Author: xz0910

Summary

The document explains a runtime error from QuantLib’s Black formula implied standard deviation function. The error means the numerical solver could not find a standard deviation that reproduces the supplied option price within its search range. In the example, the call is out of the money, and the stated premium exceeds the maximum price the response says the formula can produce for those inputs. This indicates an input that violates the model’s pricing bounds rather than merely a solver failure.

Possible causes include an unrealistic or illiquid quote, a minimum tick being mistaken for a meaningful premium, or a unit mismatch. Another response specifically recommends checking premium units. The discussion also notes that the function expects standard deviation and a forward price, which can be unintuitive when users have volatility and spot data. It suggests using QuantLib’s European option and analytic pricing engine interface instead. The diagnosis relies on the example inputs and does not establish which quote or unit issue occurred in the original data.

Key ideas

  • The implied standard deviation solver fails when no value can reproduce the supplied option premium.
  • Option prices must satisfy the Black model’s no-arbitrage bounds.
  • An out-of-the-money call premium above the model’s attainable range suggests suspect inputs or quotes.
  • Check premium units and quote liquidity when implied volatility cannot be computed.
  • The Black formula interface uses forward prices and standard deviation, which may differ from users’ available inputs.

Tags

Full text
# Quantlib, blackFormulaImpliedStdDev RuntimeError


# Quantlib, blackFormulaImpliedStdDev RuntimeError












```
import numpy as np
import QuantLib as ql
ql.blackFormulaImpliedStdDev(
                ql.Option.Call ,
                0.006725    ,
                0.006456, 0.01,
                1  
            )
```

I am encountering an error when running a function that downloads data as a JPY_USD option. But the following error shows, can anyone help me fix it or tell me what's the problem please? Thanks. Please, the data is correct. If you want to close my question, at least tell me the reason. Thank you.

```
  21529 def blackFormulaImpliedStdDev(*args):
  21530     r"""blackFormulaImpliedStdDev(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real discount=1.0, Real displacement=0.0, Real guess=Null< Real >(), Real accuracy=1.0e-6, Natural maxIterations=100) -> Real"""
> 21531     return _QuantLib.blackFormulaImpliedStdDev(*args)
RuntimeError: root not bracketed: f[0,24] -> [-1.000000e-02,-3.544000e-03]
```

## Answer by Luigi Ballabio (score 2)

https://quant.stackexchange.com/a/82067

The error message is saying (in a somewhat cryptic way) that it has tried values of standard deviation between 0% and 2400% and it couldn't reproduce the price of 0.01 that you passed as input.

Looking at your call, you're passing a strike of 0.006725 and a forward price of 0.006456, which makes your option out of the money. To get to a price of 0.01, your standard deviation would have to be large enough that a relevant part of the underlying price distribution is above 0.006725 + 0.01 = 0.016725, but such a large std dev would also cause a relevant part of the distribution where the option is worthless. From playing around with `ql.blackFormula` it seems that no matter how large you set the std dev, you'll only get a price of at most around 0.006.

This probably means that the quoted option price is illiquid, or possibly that one cent is the minimum price you'll find quoted. In any case, it suggests that the price is not realistic. I would ignore that option.

As a final aside, `ql.blackFormula` and its siblings are used internally by some engines in the library but don't have a great interface for users (they work with std dev instead of volatility, forward underlying price instead of spot, etc.) I'd suggest using `ql.EuropeanOption` and `ql.AnalyticEuropeanEngine` instead, like in this example.

## Answer by user35980 (score 1)

https://quant.stackexchange.com/a/81884

There's sparse info in your question but the error you're encountering stems from no-arbitrage conditions in black's model. I'd check the units of the premium you're using (should be in pips domestic ccy) - e.g. 0.001 works.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.