Learn R Programming

VarSwapPrice (version 1.0)

black_scholes: Black-Scholes pricing for call and put options

Description

This function computes the analytical prices of call and put options using the formulas obtained by Black and Scholes (1973).

Usage

black_scholes(S, X, r, t, vol)

Arguments

S
spot price
X
strike price
r
risk-free interest rate
t
time to maturity
vol
volatility

Value

CallPrice
price of a call option
PutPrice
price of a put option

References

Fischer Black and Myron Scholes (1973), "The Pricing of Options and Corporate Liabilities", Journal of Political Economy, 81(3), 637-654.

Examples

Run this code
S      <- c( 100 )
X      <- c( 70 )
r      <- c( 0.05 )
t      <- c( 50 )
vol    <- c( 0.2 )
prices <- black_scholes(S, X, r, t, vol) 

Run the code above in your browser using DataLab