BarrierBS: Barrier option pricing via Black-Scholes (BS) model

Description Usage Arguments Details Value Author(s) References Examples

View source: R/Barrier.R

Description

This function calculates the price of a Barrier option. This price is based on the assumptions that the probability distribution is lognormal and that the asset price is observed continuously.

Usage

1
2
BarrierBS(o = OptPx(Opt(Style = "Barrier")), dir = c("Up", "Down"),
  knock = c("In", "Out"), H = 40)

Arguments

o

The OptPx option object to price. See OptBarrier(), OptPx(), and Opt() for more information.

dir

The direction of the option to price. Either Up or Down.

knock

Whether the option goes In or Out when the barrier is reached.

H

The barrier level

Details

To price the barrier option, we need to know whether the option is Up or Down | In or Out | Call or Put. Beyond that we also need the S0, K, r, q, vol, H, and ttm arguments from the object classes defined in the package.

Value

The price of the barrier option o, which is based on the BSM-adjusted algorithm (see references).

Author(s)

Kiryl Novikau, Department of Statistics, Rice University, Spring 2015

References

Hull, John C., Options, Futures and Other Derivatives, 9ed, 2014. Prentice Hall. ISBN 978-0-13-345631-8. http://www-2.rotman.utoronto.ca/~hull/ofod/index.html. pp.606-607

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(o = BarrierBS())$PxBS # Option with default arguments is valued at $9.71

 #Down-and-In-Call
 o = Opt(Style='Barrier', S0=50, K=50, ttm=1, Right="Call", ContrSize=10)
 o = OptPx(o,  r = .05, q = 0, vol = .25)
 o = BarrierBS(o, dir = "Down", knock = 'In', H = 40)

 #Down-and-Out Call
 o = Opt(Style='Barrier', S0=50, K=50, ttm=1, Right="Call", ContrSize=10)
 o = OptPx(o, r = .05, q = .02, vol = .25)
 o = BarrierBS(o, dir = "Down", knock = 'Out', H = 40)

 #Up-and-In Call
 o = Opt(Style='Barrier', S0=50, K=50, ttm=1, Right="Call", ContrSize=1)
 o = OptPx(o, r = .05, q = .02, vol = .25)
 o = BarrierBS(o, dir = "Up", knock = 'In', H = 60)

 #Up-and-Out Call
 o = Opt(Style='Barrier', S0 = 50, K = 50, ttm = 1, Right="Call", ContrSize=1)
 o = OptPx(o, r = .05, q = .02, vol = .25)
 o = BarrierBS(o, dir = "Up", knock = 'Out', H = 60)

 #Down-and-In Put
 o = Opt(Style='Barrier', S0=50, K=50, ttm=1, Right="Put", ContrSize=1)
 o = OptPx(o, r = .05, q = .02, vol = .25)
 o = BarrierBS(o, dir = "Down", knock = 'In', H = 40)

 #Down-and-Out Put
 o = Opt(Style='Barrier', S0=50, K=50, ttm=1, Right="Put", ContrSize=1)
 o = OptPx(o, r = .05, q = .02, vol = .25)
 o = BarrierBS(o, dir = "Down", knock = 'Out', H = 40)

 #Up-and-In Put
 o = Opt(Style='Barrier', S0=50, K=50, ttm=1, Right="Put", ContrSize=1)
 o = OptPx(o, r = .05, q = .02, vol = .25)
 o = BarrierBS(o, dir = "Up", knock = 'In', H = 60)

 #Up-and-Out Put
 o = Opt(Style='Barrier', S0=50, K=50, ttm=1, Right="Put", ContrSize=1)
 o = OptPx(o, r = .05, q = .02, vol = .25)
 o = BarrierBS(o, dir = "Up", knock = 'Out', H = 60)

Example output

[1] 9.708595

QFRM documentation built on May 2, 2019, 8:26 a.m.