Skip to content
All library documents

Representing Touch Options as Barrier Options in QuantLib

Article Quant Q&A · Author: Sanjit

Summary

The document gives a pointer for pricing single- or double-touch options with QuantLib. Its answer describes a touch option as a barrier option and suggests constructing a down-in barrier with a binary payoff. It identifies the payoff representation as QuantLib’s strike-payoff class and points to an external example, but does not include the code or full setup.

Key ideas

  • A touch option can be represented as a barrier option in QuantLib.
  • The answer suggests a down-in barrier structure for a touch payoff.
  • A binary payoff can model the payment triggered by the barrier event.
  • The excerpt offers a pointer rather than a complete implementation, and does not detail double-touch setup.

Tags

Full text
# How to price touch options using quantlib?


# How to price touch options using quantlib?












I am new to quantlib and I want use it to to price a touch option (single/double).

I searched on google for example code but I could not find anything. Hence, I am not sure if `quantlib` supports touch option.

Could you please give me some pointers?

## Answer by SmallChess (score 3, accepted)

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

Touch option is simply a barrier option in QuantLib. You could create one like a down-in barrier type. You can also set the payoff to a binary payoff. The payoff is represented by the StrikePayOff class. A comprehensible example is available on github here.

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.