BarrierOptions | R Documentation |

A collection and description of functions to valuate
barrier options. Barrier options are path-dependent options,
with payoffs that depend on the price of the underlying
asset at expiration and whether or not the asset price
crosses a barrier during the life of the option. There
are two categories or types of Barrier options: "knock-in"
and "knock-out". "Knock-in" or "in" options are paid
for up front, but you do not receive the option until
the asset price crosses the barrier. "Knock-out" or "out"
options come into existence on the issue date but becomes
worthless if the asset price hits the barrier before the
expiration date. If the option is a knock-in (knock-out),
a predetermined cash rebate may be paid at expiration if
the option has not been knocked in (knocked-out) during
its lifetime. The barrier monitoring frequency specifies
how often the price is checked for a breach of the barrier.
All of the analytical models have a flag to change the
monitoring frequency where the default frequency is
continuous.

The functions are:

`StandardBarrierOption` | Standard Barrier Option, |

`DoubleBarrierOption` | Double Barrier Option, |

`PTSingleAssetBarrierOption` | Partial Time Single Asset Barrier Option, |

`TwoAssetBarrierOption` | Two Asset Barrier Option, |

`PTTwoAssetBarrierOption` | Partial Time Two Asset Barrier Option, |

`LookBarrierOption` | Lookback Barrier Option, |

`DiscreteBarrierOption` | Discrete Barrier Option |

`SoftBarrierOption` | Soft Barrier Option. |

StandardBarrierOption(TypeFlag, S, X, H, K, Time, r, b, sigma, title = NULL, description = NULL) DoubleBarrierOption(TypeFlag, S, X, L, U, Time, r, b, sigma, delta1, delta2, title = NULL, description = NULL) PTSingleAssetBarrierOption(TypeFlag, S, X, H, time1, Time2, r, b, sigma, title = NULL, description = NULL) TwoAssetBarrierOption(TypeFlag, S1, S2, X, H, Time, r, b1, b2, sigma1, sigma2, rho, title = NULL, description = NULL) PTTwoAssetBarrierOption(TypeFlag, S1, S2, X, H, time1, Time2, r, b1, b2, sigma1, sigma2, rho, title = NULL, description = NULL) LookBarrierOption(TypeFlag, S, X, H, time1, Time2, r, b, sigma, title = NULL, description = NULL) DiscreteBarrierOption(S, H, sigma, dt, title = NULL, description = NULL) SoftBarrierOption(TypeFlag, S, X, L, U, Time, r, b, sigma, title = NULL, description = NULL)

`b` |
the annualized cost-of-carry rate, a numeric value; e.g. 0.1 means 10% pa. |

`b1, b2` |
[PTTwoAssetBarrier*] - |

`delta1, delta2` |
[DoubleBarrier*] - |

`description` |
a character string which allows for a brief description. |

`dt` |
[DiscreteBarrier*] - |

`H` |
[StandardBarrier*] - |

`K` |
[StandardBarrier*] - |

`L, U` |
[DoubleBarrier*] - |

`r` |
the annualized rate of interest, a numeric value; e.g. 0.25 means 25% pa. |

`rho` |
[TwoAssetBarrier*] - |

`S` |
the asset price, a numeric value. |

`S1, S2` |
[PTTwoAssetBarrier*] - |

`sigma` |
the annualized volatility of the underlying security, a numeric value; e.g. 0.3 means 30% volatility pa. |

`sigma1, sigma2` |
[PTTwoAssetBarrier*] - |

`Time` |
the time to maturity measured in years, a numeric value; e.g. 0.5 means 6 months. |

`time1, Time2` |
[PTSingleAssetBarrier*][PTTwoAssetBarrier*] - |

`title` |
a character string which allows for a project title. |

`TypeFlag` |
usually a character string either |

`X` |
the exercise price, a numeric value. |

**Single [Standard] Barrier Options:**

There are four types of single barrier options. The type flag
`"cdi"`

denotes a down-and-in call,
`"cui"`

denotes an up-and-in call,
`"cdo"`

denotes a down-and-out call, and
`"cuo"`

denotes an up-and-out call.
Similarily, the type flags for the corresponding puts are
`cdi`

, `cui`

, `cdo`

, and `cuo`

.
A down-and-in option comes into existence
and knocked-in only if the asset price falls to the barrier level. An
up-and- in option comes into existence and knocked-in only if the asset
price rises to the barrier level. A down-and-out option comes into
existence and knocked-out only if the asset price falls to the barrier
level. An up-and-in option comes into existence and knocked-out only if
the asset price rises to the barrier level. European single barrier
options can be priced analytically using a model introduced by Reiner
and Rubinstein (1991). A trinomial lattice is used for the numerical
calculation of an American or European style single barrier options.

[Haug's Book, Chapter 2.10.1]

**Double Barrier Options:**

A double barrier option is either knocked in or knocked out if the
asset price touches the lower or upper barrier during its lifetime.
The type flag
`"co"`

denotes an up-and-out-down-and-out call,
`"ci"`

denotes an up-and-in-down-and-in call,
`"po"`

denotes an up-and-out-down-and-out put, and
`"pi"`

denotes an up-and-in-down-and-in call.
Once a barrier is crossed, the option comes into existence if it is
a knock-in barrier or becomes worthless if it is a knocked out barrier.
Double barrier options can be priced analytically using a model
introduced by Ikeda and Kunitomo (1992).

[Haug's Book, Chapter 2.10.2]

**Partial-Time Barrier Options:**

For single asset partial-time barrier options, the monitoring period
for a barrier crossing is confined to only a fraction of the option's
lifetime. There are two types of partial-time barrier options:
partial-time-start and partial-time-end. Partial-time-start barrier
options have the monitoring period start at time zero and end at an
arbitrary date before expiration. Partial-time-end barrier options
have the monitoring period start at an arbitrary date before expiration
and end at expiration. Partial-time-end barrier options are then broken
down again into two categories: B1 and B2. Type B1 is defined such that
only a barrier hit or crossed causes the option to be knocked out.
There is no difference between up and down options. Type B2 options
are defined such that a down-and-out call is knocked out as soon as
the underlying price is below the barrier. Similarly, an up-and-out
call is knocked out as soon as the underlying price is above the barrier.
Partial-time barrier options can be priced analytically using a model
introduced by Heynen and Kat (1994).

[Haug's Book, Chapter 2.10.3]

**Two-Asset Barrier Options:**

The underlying asset, Asset 1, determines how much the option is in
or out-of-the-money. The other asset, Asset 2, is the trigger asset
that is linked to barrier hits. Two-asset barrier options can be
priced analytically using a model introduced by Heynen and Kat (1994).

[Haug's Book, Chapter 2.10.4]

**Lookback Barrier Options:**

A look-barrier option is the combination of a forward starting fixed
strike Lookback option and a partial time barrier option. The option's
barrier monitoring period starts at time zero and ends at an arbitrary
date before expiration. If the barrier is not triggered during this
period, the fixed strike Lookback option will be kick off at the end
of the barrier tenor. Lookback barrier options can be priced analytically
using a model introduced by Bermin (1996).

[Haug's Book, Chapter 2.10.6]

**Partial-Time-Two-Asset Options:**

Partial-time two-asset barrier options are similar to standard two-asset
barrier options, except that the barrier hits are monitored only for a
fraction of the option's lifetime. The option is knocked in or knocked
out is Asset 2 hits the barrier during the monitoring period. The payoff
depends on Asset 1 and the strike price. Partial-time two-asset barrier
options can be priced analytically using a model introduced by Bermin
(1996).

[Haug's Book, Chapter 2.10.5]

**Soft Barrier Options:**

A soft-barrier option is similar to a standard barrier option, except
that the barrier is no longer a single level. Rather, it is a soft
range between a lower level and an upper level. Soft-barrier options
are knocked in or knocked out proportionally. Introduced by Hart and
Ross (1994), the valuation formula can be used to price soft-down-and-in
call and soft-up-and-in put options. The value of the related "out"
option can be determined by subtracting the "in" option value from the
value of a standard plain option. Soft-barrier options can be priced
analytically using a model introduced by Hart and Ross (1994).

[Haug's Book, Chapter 2.10.8]

The option price, a numeric value.

The functions implement the algorithms to valuate plain vanilla options as described in Chapter 2.10 of Haug's Book (1997).

Diethelm Wuertz for the Rmetrics **R**-port.

Haug E.G. (1997);
*The complete Guide to Option Pricing Formulas*,
Chapter 2.10, McGraw-Hill, New York.

## Examples from Chapter 2.10 in E.G. Haug's Option Guide (1997) ## Standard Barrier Option [2.10.1]: # down-and-out Barrier Call StandardBarrierOption(TypeFlag = "cdo", S = 100, X = 90, H = 95, K = 3, Time = 0.5, r = 0.08, b = 0.04, sigma = 0.25) ## Double Barrier Option [2.10.2]: DoubleBarrierOption(TypeFlag = "co", S = 100, X = 100, L = 50, U = 150, Time = 0.25, r = 0.10, b = 0.10, sigma = 0.15, delta1 = -0.1, delta2 = 0.1) ## Partial Time Single-Asset Barrier Option [2.10.3]: PTSingleAssetBarrierOption(TypeFlag = "coB1", S = 95, X = 110, H = 100, time1 = 0.5, Time2 = 1, r = 0.20, b = 0.20, sigma = 0.25) ## Two Asset Barrier Option [2.10.4]: TwoAssetBarrierOption(TypeFlag = "puo", S1 = 100, S2 = 100, X = 110, H = 105, Time = 0.5, r = 0.08, b1 = 0.08, b2 = 0.08, sigma1 = 0.2, sigma2 = 0.2, rho = -0.5) ## PT Two Asset Barrier Option [2.10.5]: PTTwoAssetBarrierOption(TypeFlag = "pdo", S1 = 100, S2 = 100, X = 100, H = 85, time1 = 0.5, Time2 = 1, r = 0.1, b1 = 0.1, b2 = 0.1, sigma1 = 0.25, sigma2 = 0.30, rho = -0.5) ## Look Barrier Option [2.10.6]: LookBarrierOption(TypeFlag = "cuo", S = 100, X = 100, H = 130, time1 = 0.25, Time2 = 1, r = 0.1, b = 0.1, sigma = 0.15) LookBarrierOption(TypeFlag = "cuo", S = 100, X = 100, H = 110, time1 = 1, Time2 = 1, r = 0.1, b = 0.1, sigma = 0.30) ## Discrete Barrier Option [2.10.7]: DiscreteBarrierOption(S = 100, H = 105, sigma = 0.25, dt = 0.1) ## Soft Barrier Option [2.10.8]: SoftBarrierOption(TypeFlag = "cdo", S = 100, X = 100, L = 70, U = 95, Time = 0.5, r = 0.1, b = 0.05, sigma = 0.20)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.