MATLAB Examples

# Compute American Option Prices Using the Barone-Adesi and Whaley Option Pricing Model

Consider an American call option with an exercise price of \$120. The option expires on Jan 1, 2018. The stock has a volatility of 14% per annum, and the annualized continuously compounded risk-free rate is 4% per annum as of Jan 1, 2016. Using this data, calculate the price of the American call, assuming the price of the stock is \$125 and pays a dividend of 2%.

```StartDate = 'Jan-1-2016'; EndDate = 'jan-1-2018'; Basis = 1; Compounding = -1; Rates = 0.04; ```

Define the RateSpec.

```RateSpec = intenvset('ValuationDate',StartDate,'StartDate',StartDate,'EndDate',EndDate, ... 'Rates',Rates,'Basis',Basis,'Compounding',Compounding) ```
```RateSpec = struct with fields: FinObj: 'RateSpec' Compounding: -1 Disc: 0.9231 Rates: 0.0400 EndTimes: 2 StartTimes: 0 EndDates: 737061 StartDates: 736330 ValuationDate: 736330 Basis: 1 EndMonthRule: 1 ```

Define the StockSpec.

```Dividend = 0.02; AssetPrice = 125; Volatility = 0.14; StockSpec = stockspec(Volatility,AssetPrice,'Continuous',Dividend) ```
```StockSpec = struct with fields: FinObj: 'StockSpec' Sigma: 0.1400 AssetPrice: 125 DividendType: {'continuous'} DividendAmounts: 0.0200 ExDividendDates: [] ```

Define the American option.

```OptSpec = 'call'; Strike = 120; Settle = 'Jan-1-2016'; Maturity = 'jan-1-2018'; ```

Compute the price for the American option.

```Price = optstockbybaw(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike) ```
```Price = 14.5180 ```