Description Usage Arguments Value Examples
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.
1 |
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. |
Option premium calculated as a column in the dataframe.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.