ecop.bs_option_price: Calculate option price from implied volatility in...

View source: R/ecop-bs-option-price-method.R

ecop.bs_option_priceR Documentation

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

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)

ecd documentation built on May 10, 2022, 1:07 a.m.