BarrierBS {QFRM} | R Documentation |
Barrier option pricing via Black-Scholes (BS) model
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
BarrierBS(o = OptPx(Opt(Style = "Barrier")), dir = c("Up", "Down"),
knock = c("In", "Out"), H = 40)
Arguments
o |
The |
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
(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)