GeneralizedBlackScholes: Generalized BlackScholes formula

View source: R/GeneralizedBlackScholes.R

GeneralizedBlackScholesR Documentation

Generalized BlackScholes formula

Description

compute price of a option call or put with the Generalized BlackScholes formula

Usage

GeneralizedBlackScholes(s, K, r, b, v, t, type)

Arguments

s

price of the underlying asset

K

strike price

r

risk free rate

b

cost of carrying rate

v

volatility express in annual term

t

time to maturity of the option express in annual term

type

type of option Call "C" or Put "P

Details

The Black-Scholes-Merton model can be "generalized" by incorporating a cost-of-carry rate b. This model can be used to price European options on stocks, stocks paying a continuous dividend yield, options on futures, and currency options

Value

price of a option call or put given the price of the underlying s, strike price K, risk free rate r, cost of carrying rate b, volatility express in annual term v, time to maturity of the option express in annual term t, type of option Call "C" or Put "P

Author(s)

Colzani Luca, Magni Marta, Mancassola Gaia, Kakkanattu Jenson

References

Espen Gaarder Haug(2007):The Complete Guide to Option Pricing Formulas

Examples

GeneralizedBlackScholes(75,70,0.1,0.05,0.35,0.5,"P")
## The function is currently defined as
function (s, K, r, b, v, t, type) 
{
    d1 <- (log(s/K) + (b + v^2/2) * t)/(v * sqrt(t))
    d2 <- d1 - v * sqrt(t)
    if (type == "C") {
        price <- (s * exp((b - r) * t) * pnorm(d1) - K * exp(-r * 
            t) * pnorm(d2))
    }
    if (type == "P") {
        price <- (K * exp(-r * t) * pnorm(-d2) - s * exp((b - 
            r) * t) * pnorm(-d1))
    }
    return(round(price, 2))
  }

Lcolzani98/OptionPricingFunctions documentation built on June 13, 2022, 5:46 a.m.