Documentation

### This is machine translation

Mouseover text to see original. Click the button below to return to the English version of the page.

# optstocksensbyblk

Determine option prices or sensitivities using Black-Scholes option pricing model

## Syntax

``PriceSens = optstocksensbyblk(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike)``
``PriceSens = optstocksensbyblk(___,Name,Value)``

## Description

example

````PriceSens = optstocksensbyblk(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike)` computes option prices on futures using the Black option pricing model. Note`optstocksensbyblk` calculates option prices or sensitivities on futures and forwards. If `ForwardMaturity` is not passed, the function calculates prices or sensitivities of future options. If `ForwardMaturity` is passed, the function computes prices or sensitivities of forward options. This function handles several types of underlying assets, for example, stocks and commodities. For more information on the underlying asset specification, see `stockspec`. ```

example

````PriceSens = optstocksensbyblk(___,Name,Value)` adds optional name-value pair arguments for `ForwardMaturity` and `OutSpec` to compute option prices or sensitivities on forwards using the Black option pricing model.```

## Examples

collapse all

This example shows how to compute option prices and sensitivities on futures using the Black pricing model. Consider a European put option on a futures contract with an exercise price of \$60 that expires on June 30, 2008. On April 1, 2008 the underlying stock is trading at \$58 and has a volatility of 9.5% per annum. The annualized continuously compounded risk-free rate is 5% per annum. Using this data, compute `delta`, `gamma`, and the `price` of the put option.

```AssetPrice = 58; Strike = 60; Sigma = .095; Rates = 0.05; Settle = 'April-01-08'; Maturity = 'June-30-08'; % define the RateSpec and StockSpec RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, 'EndDates',... Maturity, 'Rates', Rates, 'Compounding', -1, 'Basis', 1); StockSpec = stockspec(Sigma, AssetPrice); % define the options OptSpec = {'put'}; OutSpec = {'Delta','Gamma','Price'}; [Delta, Gamma, Price] = optstocksensbyblk(RateSpec, StockSpec, Settle,... Maturity, OptSpec, Strike,'OutSpec', OutSpec)```
```Delta = -0.7469 ```
```Gamma = 0.1130 ```
```Price = 2.3569 ```

This example shows how to compute option prices and sensitivities on forwards using the Black pricing model. Consider two European call options on the Brent Blend forward contract that expires on January 1, 2015. The options expire on October 1, 2014 and Dec 1, 2014 with an exercise price % of \$120 and \$150 respectively. Assume that on January 1, 2014 the forward price is at \$107, the annualized continuously compounded risk-free rate is 3% per annum and volatility is 28% per annum. Using this data, compute the price and delta of the options.

Define the `RateSpec`.

```ValuationDate = 'Jan-1-2014'; EndDates = 'Jan-1-2015'; Rates = 0.03; Compounding = -1; Basis = 1; RateSpec = intenvset('ValuationDate', ValuationDate, 'StartDates', ... ValuationDate, 'EndDates', EndDates, 'Rates', Rates, ... 'Compounding', Compounding, 'Basis', Basis');```

Define the `StockSpec`.

```AssetPrice = 107; Sigma = 0.28; StockSpec = stockspec(Sigma, AssetPrice);```

Define the options.

```Settle = 'Jan-1-2014'; Maturity = {'Oct-1-2014'; 'Dec-1-2014'}; %Options maturity Strike = [120;150]; OptSpec = {'call'; 'call'};```

Price the forward call options and return the `Delta` sensitivities.

```ForwardMaturity = 'Jan-1-2015'; % Forward contract maturity OutSpec = {'Delta'; 'Price'}; [Delta, Price] = optstocksensbyblk(RateSpec, StockSpec, Settle, Maturity, OptSpec, ... Strike, 'ForwardMaturity', ForwardMaturity, 'OutSpec', OutSpec)```
```Delta = 2×1 0.3518 0.1262 ```
```Price = 2×1 5.4808 1.6224 ```

## 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`

### Name-Value Pair Arguments

Specify optional comma-separated pairs of `Name,Value` arguments. `Name` is the argument name and `Value` is the corresponding value. `Name` must appear inside quotes. You can specify several name and value pair arguments in any order as `Name1,Value1,...,NameN,ValueN`.

Example: ```[Delta,Gamma,Price] = optstocksensbyblk(RateSpec,StockSpec,Settle,Maturity,OptSpec,Strike,'OutSpec',OutSpec)```

Maturity date or delivery date of forward contract, specified as the comma-separated pair consisting of `'ForwardMaturity'` and a `NINST`-by-`1` vector using serial date numbers or date character vectors.

Data Types: `double` | `cell`

Define outputs, specified as the comma-separated pair consisting of `'OutSpec'` and a `NOUT`- by-`1` or `1`-by-`NOUT` cell array of character vectors with possible values of `'Price'`, `'Delta'`, `'Gamma'`, `'Vega'`, `'Lambda'`, `'Rho'`, `'Theta'`, and `'All'`.

`OutSpec = {'All'}` specifies that the output should be `Delta`, `Gamma`, `Vega`, `Lambda`, `Rho`, `Theta`, and `Price`, in that order. This is the same as specifying `OutSpec` to include each sensitivity:

Example: ```OutSpec = {'delta','gamma','vega','lambda','rho','theta','price'}```

Data Types: `char` | `cell`

## Output Arguments

collapse all

Expected future prices or sensitivities values, returned as a `NINST`-by-`1` vector.

Data Types: `double`