# price

Compute price for equity instrument with `RoughVolMonteCarlo` pricer

Since R2024a

## Syntax

``[Price,PriceResult] = price(inpPricer,inpInstrument)``
``[Price,PriceResult] = price(___,inpSensitivity)``

## Description

example

````[Price,PriceResult] = price(inpPricer,inpInstrument)` computes the equity instrument price and related pricing information based on the pricing object `inpPricer` and the instrument object `inpInstrument`.```

example

````[Price,PriceResult] = price(___,inpSensitivity)` adds an optional argument to specify sensitivities. Use this syntax with the input argument combination in the previous syntax.```

## Examples

collapse all

This example shows the workflow to price a fixed-strike `Asian` instrument when you use a `RoughBergomi` model and an `RoughVolMonteCarlo` pricing method.

Create `Asian` Instrument Object

Use `fininstrument` to create an `Asian` instrument object.

`AsianOpt = fininstrument("Asian",'ExerciseDate',datetime(2019,1,30),'Strike',1000,'OptionType',"put",'Name',"asian_option")`
```AsianOpt = Asian with properties: OptionType: "put" Strike: 1000 AverageType: "arithmetic" AveragePrice: 0 AverageStartDate: NaT ExerciseStyle: "european" ExerciseDate: 30-Jan-2019 Name: "asian_option" ```

Create `RoughBergomi` Model Object

Use `finmodel` to create a `RoughBergomi` model object.

`RoughBergomiModel = finmodel("RoughBergomi",Alpha=-0.32, Xi=0.1,Eta=0.003,RhoSV=0.9)`
```RoughBergomiModel = RoughBergomi with properties: Alpha: -0.3200 Xi: 0.1000 Eta: 0.0030 RhoSV: 0.9000 ```

Create `ratecurve` Object

Create a flat `ratecurve` object using `ratecurve`.

```Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',12)```
```myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 12 Dates: 15-Sep-2023 Rates: 0.0350 Settle: 15-Sep-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous" ```

Create `RoughVolMonteCarlo` Pricer Object

Use `finpricer` to create an `RoughVolMonteCarlo` pricer object and use the `ratecurve` object for the `'DiscountCurve'` name-value argument.

`outPricer = finpricer("RoughVolMonteCarlo",DiscountCurve=myRC,Model=RoughBergomiModel,SpotPrice=900,simulationDates=datetime(2019,1,30))`
```outPricer = RoughBergomiMonteCarlo with properties: DiscountCurve: [1x1 ratecurve] SpotPrice: 900 SimulationDates: 30-Jan-2019 NumTrials: 1000 RandomNumbers: [] Model: [1x1 finmodel.RoughBergomi] DividendType: "continuous" DividendValue: 0 MonteCarloMethod: "standard" BrownianMotionMethod: "standard" ```

Price `Asian` Instrument

Use `price` to compute the price and sensitivities for the `Asian` instrument.

`[Price, outPR] = price(outPricer,AsianOpt,"all")`
```Price = 103.0639 ```
```outPR = priceresult with properties: Results: [1x7 table] PricerData: [1x1 struct] ```
`outPR.Results `
```ans=1×7 table Price Delta Gamma Lambda Rho Theta Vega ______ ________ _________ _______ _______ _______ ______ 103.06 -0.77793 0.0024128 -6.7932 -166.05 -1.4838 88.272 ```

## Input Arguments

collapse all

Pricer object, specified as a previously created `RoughVolMonteCarlo` pricer object. Create the pricer object using `finpricer`.

Data Types: `object`

Instrument object, specified as a scalar or a vector of previously created instrument objects. Create the instrument objects using `fininstrument`. The following instrument objects are supported:

Data Types: `object`

(Optional) List of sensitivities to compute, specified as an `NOUT`-by-`1` or `1`-by-`NOUT` cell array of character vectors or string array.

The supported sensitivities depend on the pricing method.

`inpInstrument` ObjectSupported Sensitivities
`Vanilla````{'delta','gamma','vega', 'theta','rho','price','lambda'}```
`Asian``{'delta','gamma','vega','theta','rho','price','lambda'}`
`Cliquet``{'delta','gamma','vega','theta','rho','price','lambda}'`
`Binary``{'delta','gamma','vega','theta','rho','price','lambda'}`

`inpSensitivity = {'All'}` or ```inpSensitivity = ["All"]``` specifies that all sensitivities for the pricing method are returned. This is the same as specifying `inpSensitivity` to include each sensitivity.

Example: ```inpSensitivity = ["delta","gamma","vega","lambda","rho","theta","price"]```

Data Types: `cell` | `string`

## Output Arguments

collapse all

Instrument price, returned as a numeric.

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

## Version History

Introduced in R2024a