PO | R Documentation |
compute the price of a product option
PO(s1, s2, K, r, b1, b2, v1, v2, rho, t, type)
s1 |
value of underlying 1 |
s2 |
value of underlying 2 |
K |
strike price |
r |
risk free rate |
b1 |
cost of carry rate 1 |
b2 |
cost of carry rate 2 |
v1 |
volatility asset 1 |
v2 |
volatility asset 2 |
rho |
correlation |
t |
time to maturity |
type |
call "C" or put "P" |
Zhang (1998) describes formulas for product options.
price of a product option give the price of the asset 1 s1, the price of asset 2 s2, the strike price K, teh risk free rate r, the cost of carrying rate of the first asset 1, the cost of carrying rate of asset 2, the volatility of asset 1, the volatility of asset 2, the correlation between the two asset rho, the time to maturity 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
PO(100,105,15000,0.07,0.02,0.05,0.3,0.3,-0.5,0.1,"C") ## The function is currently defined as function (s1, s2, K, r, b1, b2, v1, v2, rho, t, type) { f <- s1 * s2 * exp((b1 + b2 + rho * v1 * v2) * t) v <- sqrt(v1^2 + v2^2 + 2 * rho * v1 * v2) d1 <- (log(f/K) + t * ((v^2)/2))/(v * sqrt(t)) d2 <- d1 - v * sqrt(t) if(type == "C"){ price <- exp(-r*t)*(f*pnorm(d1) - K*pnorm(d2)) } if(type == "P"){ price <- exp(-r*t)*(K*pnorm(d1) - f*pnorm(d2)) } return(round(price,4)) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.