black76DF: black76DF

Description Usage Arguments Value Examples

Description

black76DF appies black76 to calculate the premium of European option on future based on black model, Black(1976) on each row of a dataframe with strike price, future price, option type, volatility, interest rate, and time to maturity as columns.

Usage

1
black76DF(df, Ftdf, sigmadf, Kdf, typedf, Timedf, rdf)

Arguments

df

Name of a dataframe

Ftdf

Name of a columns in the dataframe corresponding to future price.

sigmadf

Name of a columns in the dataframe corresponding to volatility.

Kdf

Name of a columns in the dataframe corresponding to strike price.

typedf

Name of a columns in the dataframe corresponding to option type.

Timedf

Name of a columns in the dataframe corresponding to interest rate.

rdf

Name of a columns in the dataframe corresponding to interest rate.

Value

Option premium calculated as a column in the dataframe.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
Ft <- 50
Kvec <- 80:120
Timevec <- c(c(3, 6, 9)/12, 1:5)
r <- 0.01
Vol <- runif(n = 328, min = 0.1, 0.3)
type <- sample(x = c("C", "P"), size = 328, replace = TRUE, prob = c(0.5, 0.5))
df <- data.frame(expand.grid(Kvec, Timevec), Ft, r, Vol, type)

df2 <- black76DF(df = df, Ftdf = 'Ft', sigmadf = 'Vol', Kdf = 'Var1',
                 typedf = 'type', rdf = 'r', Timedf = 'Var2')
                 head(df2)

OUKUN0705/black76IV documentation built on May 7, 2019, 8:55 p.m.