Valuation of barrier options with QuantLib-1.0
By Hachemi Benyahia
On 2010-04-28

A barrier option gives the holder the right to buy (in the case of a call option) or sell (in the case of a put option) a determined quantity of an underlying asset (UA) at a price and a date initially determined, if a predetermined threshold (the barrier) is crossed.

In other words, a barrier option entitles to the same payoff than a Vanilla option depending on the UA's life cycle. It is therefore a "path-dependent" option wich means an option whose payoff depends on the trajectory followed by the UA during its life cycle.

Specifically, two behaviors of the UA are possible during the life of the option:

 

  • at the initial date the course of the UA  is over the barrier and gets down to the latter: it's a down option
  • at the initial date the course of the UA  is under the barrier and gets up to the latter: it's a up option

 

In direct line with this typology two consequences on the payoff are possible when reaching the barrier during the option's life :

 

  • the option begins to exist: it's a in option
  • the option ceases to exist: it's a out option

 

Thus, eight types of barrier options can be considered:

 

  • call down-and-in
  • call down-and-out
  • call up-and-in
  • call up-and-out
  • put down-and-in
  • put down-and-out
  • put up-and-in
  • put up-and-out

 

 

From the point of view of the hedger, a barrier option is less costly than a vanilla option, which may be a considerable benefit. On the other hand, buying such an option, also implies accepting the risk of wasting its hedge strategy. n return the operator acquiring this type of option accepts the risk of lost coverage.

Quantitatively this can be explained by the fact that with similar characteristics, there are trajectories of the UA (and hence probabilities) through which the option ceases to exist or won't even exist.

Regarding the valuation of this type of option, Merton (1973) and later Reiner and Rubinstein (1991), have developed analytical formulas within a Black-Scholes-Merton model. Those formulas are based on the reflection principle of the brownian motion. The application of numerical methods such as finite-differences or Monte Carlo simulations can also be implemented to price these options.

In order to price this type of option, the free/open source library QuantLib-1.0.0 provides princing engines that can be used in the frame of the BSM model for both analytical and numerical (finite difference and Monte Carlo) approaches. It is interesting to mention that a Heston finite differences pricing engine is also available.

Here are some examples (QuantLib C++) showing how to use these pricing engines (see attached documents):

 

  • BlackScholesAnalyticBarrierEngine.cpp
  • BlackScholesMonteCarloEngine.cpp
  • BlackScholesFiniteDifferencesBarrierEngine.cpp

 

References:

 

Merton R. (1976)  ” Theory of Rational Option Pricing”, Bell Journal of Economics and Management Science
Reiner E. et Rubinstein M. (1991) ” Breaking Down the Barriers “ Risk
Haug E.G.(2007) ” The Complete Guide to Option Pricing Formulas “, McGrawHill – 2 nd edition

Some useful links
:

QuantLib - official website of the project free / open source QuantLib
Tino Kluge’ website - web site containing a pricer option barriers in a stochastic volatility model of Heston and finite difference numerical method.
Sitmo - website containing a barrier option pricer with an analytical approach and more generally containing a multitude of exotic option pricer.










FacebookGoogleTwitterMySpaceMore options






What is FinRoad?
Built by and reserved to Financial Markets and related Professionals, FinRoad is based on a precise classification of financial markets subsectors, functions and instruments.

Smart matching tools that exist nowhere else narrow down thousands of opportunities into a manageable number of real concrete ones in one single click, without going through fastidious searches and long lists of results, whether you are willing to buy, sell, partner, find a job, recruit, invest or raise funds.