Main Content

CDSOption

CDSOption instrument object

Description

Create and price a CDSOption instrument object using this workflow:

  1. Use fininstrument to create a CDSOption instrument object.

  2. Use finmodel to specify a CDSBlack model for the CDSoption instrument.

  3. Use finpricer to specify a CDSBlack pricing method for the CDSoption 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 using a CDSoption instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

example

CDSOptionObj = fininstrument(InstrumentType,'ExerciseDate',exercise_date,'Strike',strike_value,'CDS',cds_obj) creates a CDSOption object by specifying InstrumentType and sets the properties for the required name-value pair arguments ExerciseDate, Strike, and CDS.

example

CDSOptionObj = fininstrument(___,Name,Value) sets optional properties using additional name-value pairs in addition to the required arguments in the previous syntax. For example, CDSOptionObj = fininstrument("CDSoption",'ExerciseDate',datetime(2019,1,30),'Strike',500,'CDS',cds_object,'Name',"cdsoption_instrument") creates a CDSOption instrument with a strike of 500. You can specify multiple name-value pair arguments.

Input Arguments

expand all

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

Data Types: char | string

CDSOption 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: CDSOptionObj = fininstrument("CDSoption",'ExerciseDate',datetime(2019,1,30),'Strike',500,'CDS',cds_object,'Name',"cdsoption_instrument")
Required CDSOption Name-Value Pair Arguments

expand all

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 strike price, specified as the comma-separated pair consisting of 'Strike' and a scalar nonnegative numeric.

Data Types: double

CDS object, specified as the comma-separated pair consisting of 'CDS' and a scalar CDS object.

Data Types: object

Optional CDSOption Name-Value Pair Argument

expand all

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

Data Types: char | string

Flag indicating if option is knockout type, specified as the comma-separated pair consisting of 'Knockout' and a scalar logical.

Data Types: logical

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 exercise date, returned as a datetime.

Data Types: datetime

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

Data Types: double

CDS object, returned as a scalar CDS object.

Data Types: object

Definition of option, returned as a string using "call" or "put".

Data Types: string

Flag indicating if option is knockout type, returned as a scalar logical.

Data Types: logical

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

Data Types: string

Examples

collapse all

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

Create CDS Instrument Object

Use fininstrument to create the underlying CDS instrument object.

CDSOpt = fininstrument("CDS",'Maturity',datetime(2021,9,15),'ContractSpread',150,'Notional',100,'Name',"CDS_option")
CDSOpt = 
  CDS with properties:

           ContractSpread: 150
                 Maturity: 15-Sep-2021
                   Period: 4
                    Basis: 2
             RecoveryRate: 0.4000
    BusinessDayConvention: "actual"
                 Holidays: NaT
        PayAccruedPremium: 1
                 Notional: 100
                     Name: "CDS_option"

Create defprobcurve Object

Create a defprobcurve object using defprobcurve.

Settle = datetime(2020,9,20);
DefProbTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])];
DefaultProbabilities = [0.005 0.007 0.01 0.015 0.026 0.04 0.077 0.093 0.15 0.20]';
ProbDates = Settle + DefProbTimes;
DefaultProbCurve = defprobcurve(Settle,ProbDates,DefaultProbabilities,'Basis',5)
DefaultProbCurve = 
  defprobcurve with properties:

                  Settle: 20-Sep-2020
                   Basis: 5
                   Dates: [10x1 datetime]
    DefaultProbabilities: [10x1 double]

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2020,9,15);
Type = 'zero';
ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]';
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC = 
  ratecurve with properties:

                 Type: "zero"
          Compounding: -1
                Basis: 0
                Dates: [10x1 datetime]
                Rates: [10x1 double]
               Settle: 15-Sep-2020
         InterpMethod: "linear"
    ShortExtrapMethod: "next"
     LongExtrapMethod: "previous"

Create CDSOption Instrument Object

Use fininstrument to create a CDSOption instrument object.

CDSOptionInst = fininstrument("CDSOption",'ExerciseDate',datetime(2021,8,15),'Strike',20,'CDS',CDSOpt,'OptionType',"put",'Knockout',true,'Name',"CDSOption_option")
CDSOptionInst = 
  CDSOption with properties:

      OptionType: "put"
          Strike: 20
        Knockout: 1
    ExerciseDate: 15-Aug-2021
             CDS: [1x1 fininstrument.CDS]
            Name: "CDSOption_option"

Create CDSBlack Model Object

Use finmodel to create a CDSBlack model object.

CDSBlackModel = finmodel("CDSBlack",'SpreadVolatility',.2)
CDSBlackModel = 
  CDSBlack with properties:

    SpreadVolatility: 0.2000

Create CDSBlack Pricer Object

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

outPricer = finpricer("analytic",'Model',CDSBlackModel,'DefaultProbabilityCurve',DefaultProbCurve,'DiscountCurve',myRC)
outPricer = 
  CDSBlack with properties:

                      Model: [1x1 finmodel.CDSBlack]
              DiscountCurve: [1x1 ratecurve]
    DefaultProbabilityCurve: [1x1 defprobcurve]

Price CDSOption Instrument

Use price to compute the price for the CDSOption instrument.

Price = price(outPricer,CDSOptionInst)
Price = 3.3016e-04

More About

expand all

Introduced in R2020a