Skip to content
All library documents

Pricing Barrier Options with Local Volatility in QuantLib

Article Quant Q&A · Author: Bryce Xu

Summary

The document explains how to price a barrier option with a finite-difference engine in QuantLib when volatility is represented by a market implied-volatility surface. It points to the finite-difference Black–Scholes barrier engine and notes that its local-volatility setting uses the local volatility supplied by the pricing process.

It also highlights that QuantLib’s generalized Black–Scholes process can convert Black volatility to local volatility internally, so a separate conversion step may be unnecessary. The response is a brief pointer to relevant library behavior rather than a worked implementation. It does not discuss how to construct or validate the implied-volatility surface, configure the process, or assess numerical accuracy and model risk; checking the implementation details is recommended.

Key ideas

  • QuantLib provides a finite-difference Black–Scholes engine for barrier options.
  • The engine can use local volatility from the pricing process when configured to do so.
  • The generalized Black–Scholes process can perform the conversion from Black volatility to local volatility internally.
  • The response does not provide a complete setup or discuss numerical validation.

Tags

Full text
# how to price barrier option under local vol model using QuantLib


# how to price barrier option under local vol model using QuantLib












I use QuantLib in Python. Now I have implied volatility surface data. How can I get the local vol surface than using finite difference method to price a barrier option in QuantLib?

## Answer by Luigi Ballabio (score 4, accepted)

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

From a cursory look, the `FdBlackScholesBarrierEngine` seems to do what you want; when the `localVol` parameter is set to `true`, it will use the local volatility contained in the passed process. I'd suggest you to check the code, though.

As a further note: the `GeneralizedBlackScholesProcess` class converts the Black volatility to the local one internally (see the code here) so you might not need to.

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.