bs.opt: Black-Scholes Option

Description Usage Arguments Details Value References Examples

Description

Applications of he Black-Scholes option pricing formula

Usage

1
2
bs.opt(cp=c("call", "put"), strike=NULL, delta=NULL, time.to.mat=NULL, val.date=NULL, exp.date=NULL, spot, vol=NULL, price=NULL, rate=NULL, fwd=NULL)
bs.fx.opt(cp=c("call", "put"), strike=NULL, delta=NULL, time.to.mat=NULL, val.date=NULL, exp.date=NULL, spot, vol, rate=NULL, fwd=NULL)

Arguments

cp

Direction of the option: call or put.

strike

Strike price of the option. If left NULL, will be calculated from delta.

delta

Delta of the option. Used to calculate the strike if strike is NULL, and ignored otherwise.

time.to.mat

Time to maturity of the option, expressed in years. If left NULL, will be calculated from val.date and exp.date.

val.date, exp.date

Valuation and expiration dates. Used to calculate time to maturity if time.to.mat is NULL, and ignored otherwise.

spot

Spot price of the underlying.

vol

Volatility of the underlying.

price

Price of the option.

rate

Risk-free or forward rate. If left NULL, will be implied from fwd, spot, and time.to.mat.

fwd

Forward price of the underlying. Used to calculate forward rate if rate is NULL, and ignored otherwise.

Details

These functions take inputs necessary for evaluating options and run them through the Black-Scholes formula and its derivatives. The bs.fx.opt variant implements the conventions of FX options that are priced in the currency of the underlying. E.g., a EUR/USD option (the option to buy or sell EUR vs USD) is priced in EUR. In this function:

P' = P/S \\ Δ' = dP'/dS * S = Δ - P' \\ Γ' = dΔ'/dS = Γ - Δ'/S

Value

A data.frame with inputs, price, and sensitivities.

References

http://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## puts on SPX
bs.opt("put", strike=seq(1940, 1960, 5), time.to.mat=63/365, spot=1960, vol=0.025, fwd=1954)

## use dates instead of time.to.mat
today <- Sys.Date()
bs.opt("put", strike=seq(1940, 1960, 5), val.date=today, exp.date=today+63, spot=1960, vol=0.025, rate=0.0197)

## EUR/USD -- use fwd instead of rate
bs.fx.opt("call", strike=135:138/100, val.date=today, exp.date=today+365, spot=1.365, vol=0.07, fwd=1.365)

## back into strikes from deltas
bs.fx.opt(c("put", "put", "call", "call"), delta=c(-.25, -.50, .50, .25), time.to.mat=0.25, spot=1.365, vol=0.05, rate=0)

johnlaing/bs.opt documentation built on May 19, 2019, 5:15 p.m.