50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


ecd (version 0.9.2.4)

ecop.bs_option_price: Calculate option price from implied volatility in Black-Sholes model

Description

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.

Usage

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)

Arguments

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, c or p. Default is c.

Value

The call/put prices

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab