Main Content

BlackScholes

Create BlackScholes model object for an Asian, Barrier, DoubleBarrier, Lookback, Spread, Vanilla, Touch, DoubleTouch, or Binary instrument

Description

Create and price a Vanilla, Lookback, Barrier, DoubleBarrier Asian, Spread, Touch, DoubleTouch, or Binary instrument object with a BlackScholes model using this workflow:

  1. Use fininstrument to create a Vanilla, Lookback, Barrier, Asian, Spread, DoubleBarrier, Binary, Touch, or DoubleTouch instrument object.

  2. Use finmodel to specify the BlackScholes model object for a Vanilla, Lookback, Barrier, DoubleBarrier, Asian, Spread, Touch, DoubleTouch, or Binary instrument.

  3. Use finpricer to specify a supported pricing method. For more information on the available pricing methods for the Vanilla, Lookback, Barrier, DoubleBarrier, Asian, Spread, Touch, DoubleTouch, or Binary instrument when using a BlackScholes model, see Choose Instruments, Models, and Pricers.

For more information on this workflow, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.

For more information on the available pricing methods for a Vanilla, Lookback, Barrier, DoubleBarrier, Asian, Spread, Touch, DoubleTouch, or Binary instrument when using a BlackScholes model, see Choose Instruments, Models, and Pricers.

Creation

Description

example

BlackScholesModelObj = finmodel(ModelType,'Volatility',volatility_value) creates a BlackScholes model object by specifying ModelType and sets the properties for the required name-value pair argument Volatility.

example

BlackScholesModelObj = finmodel(___,Name,Value) sets optional properties using additional name-value pairs in addition to the required arguments in the previous syntax. For example, BlackScholesModelObj = finmodel("BlackScholes",'Volatility',0.032) creates a BlackScholes model object. You can specify multiple name-value pair arguments.

Input Arguments

expand all

Model type, specified as a string with the value of "BlackScholes" or a character vector with the value of 'BlackScholes'.

Data Types: char | string

BlackScholes Name-Value Pair Arguments

Specify required and 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: BlackScholesModelObj = finmodel("BlackScholes",'Volatility',0.032)
Required BlackScholes Name-Value Pair Arguments

expand all

Volatility value, specified as the comma-separated pair consisting of 'Volatility' and a scalar nonnegative numeric.

Data Types: double

Optional BlackScholes Name-Value Pair Arguments

expand all

Correlation between the underlying asset prices, specified as the comma-separated pair consisting of 'Corr' and a scalar numeric.

Data Types: double

Properties

expand all

Volatility value, returned as a scalar nonnegative numeric.

Data Types: double

Correlation between underlying asset prices, returned as a scalar numeric.

Data Types: double

Examples

collapse all

This example shows the workflow to price an Asian instrument when you use a BlackScholes model and a TurnbullWakeman pricing method.

Create Asian Instrument Object

Use fininstrument to create an Asian instrument object.

AsianOpt = fininstrument("Asian",'ExerciseDate',datetime(2022,9,15),'Strike',105,'OptionType',"put",'ExerciseStyle',"european",'Name',"asian_option")
AsianOpt = 
  Asian with properties:

          OptionType: "put"
              Strike: 105
         AverageType: "arithmetic"
        AveragePrice: 0
    AverageStartDate: NaT
       ExerciseStyle: "european"
        ExerciseDate: 15-Sep-2022
                Name: "asian_option"

Create BlackScholes Model Object

Use finmodel to create a BlackScholes model object.

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

     Volatility: 0.2800
    Correlation: 1

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 TurnbullWakeman Pricer Object

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

outPricer = finpricer("analytic",'Model',BlackScholesModel,'DiscountCurve',myRC,'SpotPrice',100,'PricingMethod',"TurnbullWakeman")
outPricer = 
  TurnbullWakeman with properties:

    DiscountCurve: [1x1 ratecurve]
            Model: [1x1 finmodel.BlackScholes]
        SpotPrice: 100
    DividendValue: 0
     DividendType: "continuous"

Price Asian Instrument

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

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

       Results: [1x7 table]
    PricerData: []

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

    11.225    -0.38072    0.01087    -3.3917    44.242    -0.5256    -116.88

This example shows the workflow to price a DoubleBarrier instrument when you use a BlackScholes model and an AssetMonteCarlo 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',"american",'BarrierType',"DKO",'BarrierValue',[110 80],'Name',"doublebarrier_option")
DoubleBarrierOpt = 
  DoubleBarrier with properties:

       OptionType: "call"
           Strike: 100
     BarrierValue: [110 80]
    ExerciseStyle: "american"
     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",.3)
BlackScholesModel = 
  BlackScholes with properties:

     Volatility: 0.3000
    Correlation: 1

Create ratecurve Object

Create a flat ratecurve object using ratecurve.

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

Create AssetMonetCarlo Pricer Object

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

ExerciseDate = datetime(2020,08,15);
Settle = datetime(2017,9,15);
outPricer = finpricer("AssetMonteCarlo","DiscountCurve",myRC,"Model",BlackScholesModel,'SpotPrice',100,'simulationDates', Settle+days(1):days(1):ExerciseDate);

Price DoubleBarrier Instrument

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

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

       Results: [1x7 table]
    PricerData: [1x1 struct]

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

    6.9563    0.23644    -0.11701    3.399     0.14976    -99.727    -8.344

Introduced in R2020a