Main Content

price

Compute price for equity instrument with VannaVolga pricer

Since R2020b

Description

[Price,PriceResult] = price(inpPricer,inpInstrument) computes the 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.

example

Examples

collapse all

This example shows the workflow to price a DoubleBarrier instrument when you use a BlackScholes model and a VannaVolga pricing method.

Create DoubleBarrier Instrument Object

Use fininstrument to create a DoubleBarrier instrument object.

DoubleBarrierOpt = fininstrument("DoubleBarrier",'Strike',100,'ExerciseDate',datetime(2020,8,15),'OptionType',"call",'ExerciseStyle',"European",'BarrierType',"DKO",'BarrierValue',[110 80],'Name',"doublebarrier_option")
DoubleBarrierOpt = 
  DoubleBarrier with properties:

       OptionType: "call"
           Strike: 100
     BarrierValue: [110 80]
    ExerciseStyle: "european"
     ExerciseDate: 15-Aug-2020
      BarrierType: "dko"
           Rebate: [0 0]
             Name: "doublebarrier_option"

Create BlackScholes Model Object

Use finmodel to create a BlackScholes model object.

BlackScholesModel = finmodel("BlackScholes","Volatility",0.02)
BlackScholesModel = 
  BlackScholes with properties:

     Volatility: 0.0200
    Correlation: 1

Create ratecurve Object

Create a flat ratecurve object using ratecurve.

Settle = datetime(2019,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-2019
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create VannaVolga Pricer Object

Use finpricer to create a VannaVolga pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

VolRR = -0.0045;
VolBF = 0.0037;
RateF = 0.0210;
outPricer = finpricer("VannaVolga","DiscountCurve",myRC,"Model",BlackScholesModel,'SpotPrice',100,'DividendValue',RateF,'VolatilityRR',VolRR,'VolatilityBF',VolBF)
outPricer = 
  VannaVolga with properties:

    DiscountCurve: [1×1 ratecurve]
            Model: [1×1 finmodel.BlackScholes]
        SpotPrice: 100
     DividendType: "continuous"
    DividendValue: 0.0210
     VolatilityRR: -0.0045
     VolatilityBF: 0.0037

Price DoubleBarrier Instrument

Use price to compute the price and sensitivities for the DoubleBarrier instrument.

[Price, outPR] = price(outPricer,DoubleBarrierOpt,["all"])
Price = 
1.6450
outPR = 
  priceresult with properties:

       Results: [1×7 table]
    PricerData: [1×1 struct]

outPR.Results 
ans=1×7 table
    Price     Delta     Gamma     Lambda     Vega      Theta      Rho  
    _____    _______    ______    ______    ______    _______    ______

    1.645    0.82818    75.662    50.346    14.697    -1.3145    74.666

Input Arguments

collapse all

Pricer object, specified as a scalar VannaVolga pricer object. Use finpricer to create the VannaVolga pricer object.

Data Types: object

Instrument object, specified as a scalar or vector of Vanilla, Barrier, DoubleBarrier, Touch, or DoubleTouch instrument objects. Use fininstrument to create the Vanilla, Barrier, DoubleBarrier, Touch, or DoubleTouch instrument objects.

Data Types: object

(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', 'Lambda', 'Rho', 'Theta', and 'Price'. This is the same as specifying inpSensitivity to include each sensitivity.

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

The sensitivities supported depend on the inpInstrument.

inpInstrumentSupported Sensitivities
Vanilla, 'delta','gamma','vega','rho','lambda','theta','price'
Barrier'delta','gamma','vega','rho','lambda','theta','price'
DoubleBarrier'delta','gamma','vega','rho','lambda','theta','price'
Touch'delta','gamma','vega','rho','lambda','theta','price'
DoubleTouch'delta','gamma','vega','rho','lambda','theta','price'

Data Types: string | cell

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

  • PriceResult.PricerData.Overhedge — TBD

More About

collapse all

Version History

Introduced in R2020b