# optstockbycrr

Price stock option from Cox-Ross-Rubinstein tree

## Syntax

``````[Price,PriceTree] = optstockbycrr(CRRTree,OptSpec,Strike,Settle,ExerciseDates)``````
``````[Price,PriceTree] = optstockbycrr(___,AmericanOpt)``````

## Description

example

``````[Price,PriceTree] = optstockbycrr(CRRTree,OptSpec,Strike,Settle,ExerciseDates)``` returns the price of a European, Bermuda, or American stock option from a Cox-Ross-Rubinstein tree. ```

example

``````[Price,PriceTree] = optstockbycrr(___,AmericanOpt)``` adds an optional argument for `AmericanOpt`.```

## Examples

collapse all

This example shows how to price an American stock option using a CRR binomial tree by loading the file `deriv.mat`, which provides `CRRTree`. The `CRRTree` structure contains the stock specification and time information needed to price the American option.

```load deriv.mat; OptSpec = 'Call'; Strike = 105; Settle = '01-Jan-2003'; ExerciseDates = '01-Jan-2005'; AmericanOpt = 1; Price = optstockbycrr(CRRTree, OptSpec, Strike, Settle, ... ExerciseDates, AmericanOpt)```
```Price = 8.2863 ```

Load the file `deriv.mat`, which provides `CRRTree`. The `CRRTree` structure contains the stock specification and time information needed to price the Bermudan option.

```load deriv.mat; % Option OptSpec = 'Call'; Strike = 105; Settle = '01-Jan-2003'; ExerciseDatesBerm={'01-Jan-2004', '01-Jul-2004','01-Jan-2005','01-Jul-2005'};```

Price the Bermudan option.

`Price = optstockbycrr(CRRTree, OptSpec, Strike, Settle, ExerciseDatesBerm)`
```Warning: Some ExerciseDates are not aligned with tree nodes. Result will be approximated. ```
```Price = 9.6381 ```

## Input Arguments

collapse all

Stock tree structure, specified by using `crrtree`.

Data Types: `struct`

Definition of option, specified as `'call'` or `'put'` using a `NINST`-by-`1` cell array of character vectors.

Data Types: `char` | `cell`

Option strike price value, specified with a `NINST`-by-`1` or `NINST`-by-`NSTRIKES` depending on the option type:

• For a European option, use a `NINST`-by-`1` vector of strike prices.

• For a Bermuda option, use a`NINST`-by-`NSTRIKES` matrix of strike prices. Each row is the schedule for one option. If an option has fewer than `NSTRIKES` exercise opportunities, the end of the row is padded with `NaN`s.

• For an American option, use a `NINST`-by-`1` of strike prices.

### Note

The interpretation of the `Strike` and `ExerciseDates` arguments depends upon the setting of the `AmericanOpt` argument. If `AmericanOpt = 0`, `NaN`, or is unspecified, the option is a European or Bermuda option. If ```AmericanOpt = 1```, the option is an American option.

Data Types: `double`

Settlement date or trade date, specified as a `NINST`-by-`1` vector of date character vectors or serial date numbers.

### Note

The `Settle` date for every option is set to the `ValuationDate` of the stock tree. The option argument `Settle` is ignored.

Data Types: `char` | `double`

Option exercise dates, specified as a `NINST`-by-`1`,`NINST`-by-`2`, or `NINST`-by-`NSTRIKES` using serial date numbers or date character vectors, depending on the option type:

• For a European option, use a `NINST`-by-`1` vector of dates. Each row is the schedule for one option. For a European option, there is only one `ExerciseDates` on the option expiry date.

• For a Bermuda option, use a `NINST`-by-`NSTRIKES` vector of dates. Each row is the schedule for one option.

• For an American option, use a `NINST`-by-`2` vector of exercise date boundaries. The option can be exercised on any date between or including the pair of dates on that row. If only one non-`NaN` date is listed, or if `ExerciseDates` is a `NINST`-by-`1` vector, the option can be exercised between `ValuationDate` of the stock tree and the single listed `ExerciseDates`.

### Note

The interpretation of the `Strike` and `ExerciseDates` arguments depends upon the setting of the `AmericanOpt` argument. If `AmericanOpt = 0`, `NaN`, or is unspecified, the option is a European or Bermuda option. If ```AmericanOpt = 1```, the option is an American option.

Data Types: `double` | `char`

(Optional) Option type, specified as `NINST`-by-`1` vector of integer flags with values:

• `0` — European or Bermuda

• `1` — American

Data Types: `single` | `double`

## Output Arguments

collapse all

Expected price of the vanilla option at time `0`, returned as a `NINST`-by-`1` vector.

Structure containing trees of vectors of instrument prices and a vector of observation times for each node. Values are:

• `PriceTree.PTree` contains the clean prices.

• `PriceTree.tObs` contains the observation times.

• `PriceTree.dObs` contains the observation dates.

collapse all

### Vanilla Option

A vanilla option is a category of options that includes only the most standard components.

A vanilla option has an expiration date and straightforward strike price. American-style options and European-style options are both categorized as vanilla options.

The payoff for a vanilla option is as follows:

• For a call: $\mathrm{max}\left(St-K,0\right)$

• For a put: $\mathrm{max}\left(K-St,0\right)$

where:

St is the price of the underlying asset at time t.

K is the strike price.