Powered | R Documentation |
Compute the price of a powered option
Powered(s, K, r, b, v, p, t, type)
s |
price of the underlying |
K |
strike price |
r |
risk free rate |
b |
cost of carrying rate |
v |
volatility |
p |
power |
t |
maturity of the option |
type |
type of option "C" or "P" |
Esser (2003) describes how to value these options
price of a powered option given the underlying price s, the strike price K, the risk free ratem the cost of carrying ratem the volatility v, the power p, the time to maturity of the option t and 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
Powered(100,100,0.1,0.07,0.1,2,0.5,"C") ## The function is currently defined as function (s, K, r, b, v, p, t, type) { price <- 0 if (type == "C") { for (j in 1:p) { d <- (log(s/K) + (b + (p - j - 0.5) * v^(2)) * t)/(v * sqrt(t)) price <- price + choose(p, j) * s^(p - j) * (-K)^(j) * exp((p - j - 1) * (r + (p - j) * v^(2)/2)*t - (p - j) * (r - b) * t) * pnorm(d) } } if (type == "P") { for (j in 1:p) { d <- (log(s/K) + (b + (p - j - 0.5) * v^(2)) * t)/(v * sqrt(t)) price <- price + choose(p, j) * (-s)^(p - j) * (K)^(j) * exp((p - j - 1) * (r + (p - j) * v^(2)/2)*t - (p - j) * (r - b) * t) * pnorm(-d) } } return(round(price, 2)) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.