Gap | R Documentation |
The function computes the price of a Gap Option
Gap(s, K1, K2, r, b, v, t, type)
s |
underlying value |
K1 |
strike price |
K2 |
trigger price |
r |
interest free rate |
b |
cost of carryig rate |
v |
volatility |
t |
maturity |
type |
call "C" or put "P" |
Gap option is binary option whose stated strike price is different from its payoff strike. That is, there is a gap between the price at which the option can be exercised and the price at which it would produce a payoff to the holder. We price the option using the Reinerand Rubinstein (1991b) formula
Price of a Gap Option given the price of the underlying s, the strike price K1, the trigger price K2, the risk free rate r, the cost of carrying rate b, the volatility v, the time to maturity of the option t, the type of option call "C" or put "P"
Colzani Luca, Magni Marta, Mancassola Gaia, Kakkanattu Jenson
Espen Gaarder Haug(2007):The Complete Guide to Option Pricing Formulas
Gap(50,50,57,0.09,0.09,0.2,0.5,"C") ## The function is currently defined as function (s, K1, K2, r, b, v, t, type) { d1 <- (log(s/K1) + (b + v^(2)/2) * t)/(v * sqrt(t)) d2 <- d1 - v * sqrt(t) if (type == "C") { price <- s * exp((b - r) * t) * pnorm(d1) - K2 * exp(-r * t) * pnorm(d2) } if (type == "P") { price <- K2 * exp(-r * t) * pnorm(-d2) - s * exp((b - r) * t) * pnorm(-d1) } return(round(price, 4)) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.