# price

## Syntax

## Description

`[`

computes the instrument price and related pricing information based on the pricing object
`Price`

,`PriceResult`

] = price(`inpPricer`

,`inpInstrument`

)`inpPricer`

and the instrument object
`inpInstrument`

.

`[`

adds an optional argument to specify sensitivities.`Price`

,`PriceResult`

] = price(___,`inpSensitivity`

)

## Examples

### Use `FiniteDifference`

Pricer and `BlackScholes`

Model to Price `Barrier`

Instrument

This example shows the workflow to price a `Barrier`

instrument when you use a `BlackScholes`

model and a `FiniteDifference`

pricing method.

**Create Barrier Instrument Object**

Use `fininstrument`

to create a `Barrier`

instrument object.

BarrierOpt = fininstrument("Barrier",'Strike',105,'ExerciseDate',datetime(2019,1,1),'OptionType',"call",'ExerciseStyle',"american",'BarrierType',"DO",'BarrierValue',40,'Name',"barrier_option")

BarrierOpt = Barrier with properties: OptionType: "call" Strike: 105 BarrierType: "do" BarrierValue: 40 Rebate: 0 ExerciseStyle: "american" ExerciseDate: 01-Jan-2019 Name: "barrier_option"

**Create BlackScholes Model Object**

Use `finmodel`

to create a `BlackScholes`

model object.

BlackScholesModel = finmodel("BlackScholes",'Volatility',0.30)

BlackScholesModel = BlackScholes with properties: Volatility: 0.3000 Correlation: 1

**Create ratecurve Object**

Create a flat `ratecurve`

object using `ratecurve`

.

Settle = datetime(2018,1,1); Maturity = datetime(2023,1,1); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',1)

myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 1 Dates: 01-Jan-2023 Rates: 0.0350 Settle: 01-Jan-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"

**Create FiniteDifference Pricer Object**

Use `finpricer`

to create a `FiniteDifference`

pricer object and use the `ratecurve`

object for the `'DiscountCurve'`

name-value pair argument.

outPricer = finpricer("FiniteDifference",'Model',BlackScholesModel,'DiscountCurve',myRC,'SpotPrice',100)

outPricer = FiniteDifference with properties: DiscountCurve: [1x1 ratecurve] Model: [1x1 finmodel.BlackScholes] SpotPrice: 100 GridProperties: [1x1 struct] DividendType: "continuous" DividendValue: 0

**Price Barrier Instrument**

Use `price`

to compute the price and sensitivities for the `Barrier`

instrument.

`[Price, outPR] = price(outPricer,BarrierOpt,["all"])`

Price = 11.3230

outPR = priceresult with properties: Results: [1x7 table] PricerData: [1x1 struct]

outPR.Results

`ans=`*1×7 table*
Price Delta Gamma Lambda Theta Rho Vega
______ _______ ______ ______ _______ ______ ______
11.323 0.54126 0.0132 4.7802 -7.4408 42.766 39.627

## Input Arguments

`inpPricer`

— Pricer object

`FiniteDifference`

object

Pricer object, specified as a scalar `FiniteDifference`

pricer object. Use `finpricer`

to create the `FiniteDifference`

pricer object.

**Data Types: **`object`

`inpInstrument`

— Instrument object

`Vanilla`

object | `Barrier`

object | `DoubleBarrier`

object | `ConvertibleBond`

object

Instrument object, specified as a scalar or vector of `Vanilla`

, `Barrier`

, `DoubleBarrier`

, or
`ConvertibleBond`

instrument objects. Use `fininstrument`

to create the
`Vanilla`

, `Barrier`

, `DoubleBarrier`

, or
`ConvertibleBond`

instrument objects.

**Data Types: **`object`

`inpSensitivity`

— List of sensitivities to compute

`[ ]`

(default) | string array with values `"Price"`

, `"Delta"`

,
`"Gamma"`

, `"Vega"`

, `"Rho"`

,
`"Theta"`

, `"Lambda"`

, `"Vegalt"`

,
and `"All"`

| cell array of character vectors with values `'Price'`

,
`'Delta'`

, `'Gamma'`

, `'Lambda'`

,
`'Vegalt'`

, `'Vega'`

, `'Rho'`

,
`'Theta'`

, and `'All'`

(Optional) List of sensitivities to compute, specified as a
`NOUT`

-by-`1`

or a
`1`

-by-`NOUT`

cell array of character vectors or
string array with supported values.

`inpSensitivity = {'All'}`

or ```
inpSensitivity =
["All"]
```

specifies that the output is `'Delta'`

,
`'Gamma'`

, `'Vega'`

, `'Vegalt'`

,
`'Lambda'`

, `'Rho'`

, `'Theta'`

, and
`'Price'`

. This is the same as specifying
`inpSensitivity`

to include each sensitivity.

**Note**

When you price a `Barrier`

or `ConvertibleBond`

instruments using a `BlackScholes`

model,
`'Vegalt'`

is not supported.

**Example: **```
inpSensitivity =
{'delta','gamma','vega','vegalt','rho','lambda','theta','price'}
```

The sensitivities supported depend on the
`inpInstrument`

.

inpInstrument | Supported Sensitivities |
---|---|

`Vanilla` , | `'delta','gamma','vega','vegalt','rho','lambda','theta','price'` |

`Barrier` | `'delta','gamma','vega','rho','lambda','theta','price'` |

`DoubleBarrier` | `'delta','gamma','vega','vegalt','rho','lambda','theta','price'` |

`ConvertibleBond` | `'delta','gamma','vega','rho','lambda','theta','price'` |

**Data Types: **`string`

| `cell`

## Output Arguments

`Price`

— Instrument price

numeric

Instrument price, returned as a numeric.

`PriceResult`

— Price result

`PriceResult`

object

Price result, returned as a `PriceResult`

object. The object has
the following fields:

`PriceResult.Results`

— Table of results that includes sensitivities (if you specify`inpSensitivity`

)`PriceResult.PricerData`

— Structure for pricer data

## More About

### Delta

A *delta* sensitivity measures the rate at which
the price of an option is expected to change relative to a $1 change in the price of the
underlying asset.

Delta is not a static measure; it changes as the price of the underlying asset changes (a concept known as gamma sensitivity), and as time passes. Options that are near the money or have longer until expiration are more sensitive to changes in delta.

### Gamma

A *gamma* sensitivity measures the rate of change
of an option's delta in response to a change in the price of the underlying asset.

In other words, while delta tells you how much the price of an option might move, gamma tells you how fast the option's delta itself will change as the price of the underlying asset moves. This is important because this helps you understand the convexity of an option's value in relation to the underlying asset's price.

### Vega

A *vega* sensitivity measures the sensitivity of
an option's price to changes in the volatility of the underlying asset.

Vega represents the amount by which the price of an option would be expected to change for a 1% change in the implied volatility of the underlying asset. Vega is expressed as the amount of money per underlying share that the option's value will gain or lose as volatility rises or falls.

### Theta

A *theta* sensitivity measures the rate at which
the price of an option decreases as time passes, all else being equal.

Theta is essentially a quantification of time decay, which is a key concept in options pricing. Theta provides an estimate of the dollar amount that an option's price would decrease each day, assuming no movement in the price of the underlying asset and no change in volatility.

### Rho

A *rho* sensitivity measures the rate at which the
price of an option is expected to change in response to a change in the risk-free interest
rate.

Rho is expressed as the amount of money an option's price would gain or lose for a one percentage point (1%) change in the risk-free interest rate.

### Lambda

A *lambda* sensitivity measures the percentage
change in an option's price for a 1% change in the price of the underlying asset.

Lambda is a measure of leverage, indicating how much more sensitive an option is to price movements in the underlying asset compared to owning the asset outright.

## Version History

**Introduced in R2020a**

## MATLAB 命令

您点击的链接对应于以下 MATLAB 命令：

请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)