Main Content

BlackScholes

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

Since R2020a

Description

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

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

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

  3. Use finpricer to specify a supported pricing method. For more information on the available pricing methods for the Vanilla, Lookback, PartialLookback, Barrier, DoubleBarrier, Asian, Spread, Touch, DoubleTouch, Cliquet, or Binary instrument object 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, PartialLookback, 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,'Correlation',Corr) 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

Name-Value Arguments

Specify required and optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: BlackScholesModelObj = finmodel("BlackScholes",'Volatility',0.032,'Correlation',Corr)

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 'Correlation' and a semidefinite matrix. For more information on creating a positive semidefinite matrix, see nearcorr.

Data Types: double

Properties

expand all

Volatility value, returned as a scalar nonnegative numeric.

Data Types: double

Correlation between underlying assets, returned as a semi-definite matrix.

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.9667
outPR = 
  priceresult with properties:

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

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

    6.9667    0.26875    -0.096337    3.8576    0.39855    9.5406    -1.2907

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

Create Vanilla Instrument Object

Use fininstrument to create a Vanilla instrument object.

VanillaOpt = fininstrument("Vanilla",'ExerciseDate',datetime(2019,5,1),'Strike',29,'OptionType',"put",'ExerciseStyle',"european",'Name',"vanilla_option")
VanillaOpt = 
  Vanilla with properties:

       OptionType: "put"
    ExerciseStyle: "european"
     ExerciseDate: 01-May-2019
           Strike: 29
             Name: "vanilla_option"

Create BlackScholes Model Object

Use finmodel to create a BlackScholes model object.

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

     Volatility: 0.2500
    Correlation: 1

Create ratecurve Object

Create a flat ratecurve object using ratecurve.

Settle = datetime(2018,1,1);
Maturity = datetime(2020,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-2020
                Rates: 0.0350
               Settle: 01-Jan-2018
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create AssetTree Pricer Object

Use finpricer to create an AssetTree pricer object for a LR equity tree and use the ratecurve object for the 'DiscountCurve' name-value pair argument.

LRPricer = finpricer("AssetTree",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',30,'PricingMethod',"LeisenReimer",'Maturity',datetime(2019,5,1),'NumPeriods',15)
LRPricer = 
  LRTree with properties:

    InversionMethod: PP1
             Strike: 30
               Tree: [1x1 struct]
         NumPeriods: 15
              Model: [1x1 finmodel.BlackScholes]
      DiscountCurve: [1x1 ratecurve]
          SpotPrice: 30
       DividendType: "continuous"
      DividendValue: 0
          TreeDates: [02-Feb-2018 08:00:00    06-Mar-2018 16:00:00    08-Apr-2018 00:00:00    10-May-2018 08:00:00    11-Jun-2018 16:00:00    14-Jul-2018 00:00:00    15-Aug-2018 08:00:00    16-Sep-2018 16:00:00    ...    ] (1x15 datetime)

Price Vanilla Instrument

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

[Price, outPR] = price(LRPricer,VanillaOpt,"all")
Price = 2.2542
outPR = 
  priceresult with properties:

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

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

    2.2542    -0.33628    0.044039    12.724    -4.469    -16.433    -0.76073

More About

expand all

Version History

Introduced in R2020a