Learn R Programming

RTL (version 1.3.7)

CRROption: Cox-Ross-Rubinstein Option Pricing Model

Description

Computes the price of European and American options using the Cox-Ross-Rubinstein binomial model. This function is optimized for performance and implemented in C++. Haug (2007) provides a detailed description of the model.

Usage

CRROption(S, X, sigma, r, b, T2M, N, type, optionStyle)

Value

A list containing the computed price of the option and a note indicating if the model is suitable for the provided parameters.

Arguments

S

Numeric, the current stock price (also known as the underlying asset price).

X

Numeric, the strike price of the option.

sigma

Numeric, the implied volatility of the underlying stock (annualized).

r

Numeric, the risk-free interest rate (annualized).

b

Numeric, the cost of carry, b = r - q for dividend paying assets, where q is the dividend yield rate.

T2M

Numeric, the time to maturity of the option (in years).

N

Integer, the number of time steps in the binomial tree.

type

Character, the type of option ("call" or "put").

optionStyle

Character, the style of the option ("european" or "american").

Examples

Run this code
# CRROption(S = 100, X = 100, sigma = 0.25, r = 0.1, b = 0, T2M = 1, N = 500,
# type = "call", optionStyle = "european")
# CRROption(S = 100, X = 100, sigma = 0.25, r = 0.1, b = 0, T2M = 1, N = 500,
# type = "call", optionStyle = "american")

Run the code above in your browser using DataLab