Binary

Binary instrument object

Description

Create and price a Binary instrument object using this workflow:

  1. Use fininstrument to create a Binary instrument object.

  2. Use finmodel to specify a BlackScholes model for the Binary instrument.

  3. Use finpricer to specify a BlackScholes or AssetMonteCarlo pricing method for the Binary instrument.

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 models and pricing methods for a Binary instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

example

BinaryOpt = fininstrument(InstrumentType,'Strike',strike_value,'ExerciseDate',exercise_date,'PayoffValue',payoff_value) creates a Binary object by specifying InstrumentType and sets properties using the required name-value pair arguments Strike, ExerciseDate, and PayoffValue.

example

BinaryOpt = fininstrument(___,Name,Value) sets optional properties using additional name-value pair arguments in addition to the required arguments in the previous syntax. For example, BinaryOpt = fininstrument("Binary",'Strike',100,'ExerciseDate',datetime(2019,1,30),'PayoffValue',110,'OptionType',"put",'Name',"binary_option") creates a Binary put option with a PayoffValue of 110. You can specify multiple name-value pair arguments.

Input Arguments

expand all

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

Data Types: char | string

Binary 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: BinaryOpt = fininstrument("Binary",'Strike',100,'ExerciseDate',datetime(2019,1,30),'PayoffValue',110,'OptionType',"put",'Name',"binary_option")
Required Binary Name-Value Pair Arguments

expand all

Option strike price value, specified as the comma-separated pair consisting of 'Strike' and a scalar nonnegative value.

Data Types: double

Option exercise date, specified as the comma-separated pair consisting of 'ExerciseDate' and a scalar datetime, serial date number, date character vector, or date string.

If you use a date character vector or date string, the format must be recognizable by datetime because the ExerciseDate property is stored as a datetime.

Data Types: double | char | string | datetime

Option payoff value, specified as the comma-separated pair consisting of 'PayoffValue' and a scalar numeric value.

Data Types: double

Optional Binary Name-Value Pair Arguments

expand all

Option type, specified as the comma-separated pair consisting of 'OptionType' and a scalar string or character vector.

Data Types: char | string

Option exercise style, specified as the comma-separated pair consisting of 'ExerciseStyle' and a scalar string or character vector.

Data Types: string | char

User-defined name for the instrument, specified as the comma-separated pair consisting of 'Name' and a scalar string or character vector.

Data Types: char | string

Properties

expand all

Option strike price value, returned as a scalar nonnegative value.

Data Types: double

Option exercise date, returned as a datetime.

Data Types: datetime

Option payoff value, returned as a numeric value.

Data Types: double

Option type, returned as a string with the value "call" or "put".

Data Types: string

This property is read-only.

Option exercise style, returned as a string with the value of "European".

Data Types: string

User-defined name for the instrument, returned as a string.

Data Types: string

Examples

collapse all

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

Create Binary Instrument Object

Use fininstrument to create a Binary instrument object.

BinaryOpt = fininstrument("Binary",'ExerciseDate',datetime(2022,9,15),'Strike',1000,'PayoffValue',130,'OptionType',"put",'Name',"binary_option")
BinaryOpt = 
  Binary with properties:

       OptionType: "put"
     ExerciseDate: 15-Sep-2022
           Strike: 1000
      PayoffValue: 130
    ExerciseStyle: "european"
             Name: "binary_option"

Create BlackScholes Model Object

Use finmodel to create a BlackScholes model object.

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

     Volatility: 0.2000
    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 AssetMonteCarlo Pricer Object

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

outPricer = finpricer("AssetMonteCarlo",'DiscountCurve',myRC,"Model",BlackScholesModel,'SpotPrice',102,'simulationDates',datetime(2022,9,15))
outPricer = 
  GBMMonteCarlo with properties:

      DiscountCurve: [1x1 ratecurve]
          SpotPrice: 102
    SimulationDates: 15-Sep-2022
          NumTrials: 1000
      RandomNumbers: []
              Model: [1x1 finmodel.BlackScholes]
       DividendType: "continuous"
      DividendValue: 0

Price Binary Instrument

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

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

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

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

    113.02      0        0        0       -451.98    3.9582     0  

This example shows the workflow to price a Binary instrument when you use a Merton model and an AssetMonteCarlo pricing method.

Create Binary Instrument Object

Use fininstrument to create a Binary instrument object.

BinaryOpt = fininstrument("Binary",'ExerciseDate',datetime(2022,9,15),'Strike',1000,'PayoffValue',130,'OptionType',"put",'Name',"binary_option")
BinaryOpt = 
  Binary with properties:

       OptionType: "put"
     ExerciseDate: 15-Sep-2022
           Strike: 1000
      PayoffValue: 130
    ExerciseStyle: "european"
             Name: "binary_option"

Create Merton Model Object

Use finmodel to create a Merton model object.

MertonModel = finmodel("Merton",'Volatility',0.45,'MeanJ',0.02,'JumpVol',0.07,'JumpFreq',0.09)
MertonModel = 
  Merton with properties:

    Volatility: 0.4500
         MeanJ: 0.0200
       JumpVol: 0.0700
      JumpFreq: 0.0900

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

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

outPricer = finpricer("AssetMonteCarlo",'DiscountCurve',myRC,"Model",MertonModel,'SpotPrice',102,'simulationDates',datetime(2022,9,15))
outPricer = 
  MertonMonteCarlo with properties:

      DiscountCurve: [1x1 ratecurve]
          SpotPrice: 102
    SimulationDates: 15-Sep-2022
          NumTrials: 1000
      RandomNumbers: []
              Model: [1x1 finmodel.Merton]
       DividendType: "continuous"
      DividendValue: 0

Price Binary Instrument

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

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

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

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

    112.45      0        0        0       -449.72    3.9384     0  

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

Create Binary Instrument Object

Use fininstrument to create a Binary instrument object.

BinaryOpt = fininstrument("Binary",'ExerciseDate',datetime(2022,9,15),'Strike',1000,'PayoffValue',130,'OptionType',"put",'Name',"binary_option")
BinaryOpt = 
  Binary with properties:

       OptionType: "put"
     ExerciseDate: 15-Sep-2022
           Strike: 1000
      PayoffValue: 130
    ExerciseStyle: "european"
             Name: "binary_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 BlackScholes Pricer Object

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

outPricer = finpricer("analytic",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',800,'DividendValue',0.045)
outPricer = 
  BlackScholes with properties:

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

Price Binary Instrument

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

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

       Results: [1x7 table]
    PricerData: []

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

    87.4     -0.075973    -3.1264e-05    -0.6954    -23.084    3.2599    -592.61

More About

expand all

Introduced in R2020b