# optstockbybls

Price options using Black-Scholes option pricing model

## Syntax

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

## Description

example

````Price = optstockbybls(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike)` returns option prices using the Black-Scholes option pricing model. NoteWhen using `StockSpec` with `optstockbybls`, you can modify `StockSpec` to handle other types of underliers when pricing instruments that use the Black-Scholes model. When pricing Futures (Black model), enter the following in `StockSpec`: DivType = 'Continuous'; DivAmount = RateSpec.Rates; For example, see Compute Option Prices Using the Black-Scholes Option Pricing Model.When pricing Foreign Currencies (Garman-Kohlhagen model), enter the following in `StockSpec`: DivType = 'Continuous'; DivAmount = ForeignRate; where `ForeignRate` is the continuously compounded, annualized risk free interest rate in the foreign country. For example, see Compute Option Prices on Foreign Currencies Using the Garman-Kohlhagen Option Pricing Model. ```

## Examples

collapse all

This example shows how to compute option prices using the Black-Scholes option pricing model. Consider two European options, a call and a put, with an exercise price of \$29 on January 1, 2008. The options expire on May 1, 2008. Assume that the underlying stock for the call option provides a cash dividend of \$0.50 on February 15, 2008. The underlying stock for the put option provides a continuous dividend yield of 4.5% per annum. The stocks are trading at \$30 and have a volatility of 25% per annum. The annualized continuously compounded risk-free rate is 5% per annum. Using this data, compute the price of the options using the Black-Scholes model.

```Strike = 29; AssetPrice = 30; Sigma = .25; Rates = 0.05; Settle = 'Jan-01-2008'; Maturity = 'May-01-2008'; % define the RateSpec and StockSpec RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, 'EndDates',... Maturity, 'Rates', Rates, 'Compounding', -1); DividendType = {'cash';'continuous'}; DividendAmounts = [0.50; 0.045]; ExDividendDates = {'Feb-15-2008';NaN}; StockSpec = stockspec(Sigma, AssetPrice, DividendType, DividendAmounts,... ExDividendDates); OptSpec = {'call'; 'put'}; Price = optstockbybls(RateSpec, StockSpec, Settle, Maturity, OptSpec, Strike)```
```Price = 2×1 2.2030 1.2025 ```

This example shows how to compute option prices on foreign currencies using the Garman-Kohlhagen option pricing model. Consider a European put option on a currency with an exercise price of \$0.50 on October 1, 2015. The option expires on June 1, 2016. Assume that the current exchange rate is \$0.52 and has a volatility of 12% per annum. The annualized continuously compounded domestic risk-free rate is 4% per annum and the foreign risk-free rate is 8% per annum. Using this data, compute the price of the option using the Garman-Kohlhagen model.

```Settle = 'October-01-2015'; Maturity = 'June-01-2016'; AssetPrice = 0.52; Strike = 0.50; Sigma = .12; Rates = 0.04; ForeignRate = 0.08;```

Define the `RateSpec`.

```RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, 'EndDates',... Maturity, 'Rates', Rates, 'Compounding', -1)```
```RateSpec = struct with fields: FinObj: 'RateSpec' Compounding: -1 Disc: 0.9737 Rates: 0.0400 EndTimes: 0.6667 StartTimes: 0 EndDates: 736482 StartDates: 736238 ValuationDate: 736238 Basis: 0 EndMonthRule: 1 ```

Define the `StockSpec`.

```DividendType = 'Continuous'; DividendAmounts = ForeignRate; StockSpec = stockspec(Sigma, AssetPrice, DividendType, DividendAmounts)```
```StockSpec = struct with fields: FinObj: 'StockSpec' Sigma: 0.1200 AssetPrice: 0.5200 DividendType: {'continuous'} DividendAmounts: 0.0800 ExDividendDates: [] ```

Price the European put option.

```OptSpec = {'put'}; Price = optstockbybls(RateSpec, StockSpec, Settle, Maturity, OptSpec, Strike)```
```Price = 0.0162 ```

## Input Arguments

collapse all

Interest-rate term structure (annualized and continuously compounded), specified by the `RateSpec` obtained from `intenvset`. For information on the interest-rate specification, see `intenvset`.

Data Types: `struct`

Stock specification for the underlying asset. For information on the stock specification, see `stockspec`.

`stockspec` handles several types of underlying assets. For example, for physical commodities the price is `StockSpec.Asset`, the volatility is `StockSpec.Sigma`, and the convenience yield is `StockSpec.DividendAmounts`.

Data Types: `struct`

Settlement or trade date, specified as serial date number or date character vector using a `NINST`-by-`1` vector.

Data Types: `double` | `char`

Maturity date for option, specified as serial date number or date character vector using a `NINST`-by-`1` vector.

Data Types: `double` | `char`

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

Data Types: `char` | `cell`

Option strike price value, specified as a nonnegative `NINST`-by-`1` vector.

Data Types: `double`

## Output Arguments

collapse all

Expected option prices, returned as a `NINST`-by-`1` vector.

Data Types: `double`

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.