View source: R/ecop-bs-option-price-method.R
ecop.bs_option_price | R Documentation |
This is the standard library to calculate option price from implied volatility σ_{BS} in Black-Sholes model. There is no external dependency on elliptic distribution.
ecop.bs_option_price(ivol, K, S, ttm, int_rate = 0, div_yield = 0, otype = "c") ecop.bs_call_price(ivol, K, S, ttm, int_rate = 0, div_yield = 0) ecop.bs_put_price(ivol, K, S, ttm, int_rate = 0, div_yield = 0)
ivol |
numeric vector of implied volatility |
K |
numeric vector of strike prices |
S |
length-one numeric for underlying price |
ttm |
length-one numeric for time to maturity, in the unit of days/365. |
int_rate |
length-one numeric for risk-free rate, default to 0. |
div_yield |
length-one numeric for dividend yield, default to 0. |
otype |
character, |
The call/put prices
ivol <- c(0.128886, 0.294296) K <- c(2100, 2040) S <- 2089.27 T <- 1/365 y <- 0.019 ecop.bs_option_price(ivol, K, S, ttm=T, div_yield=y, otype="c") # expect output of c(1.8, 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.