Main Content

FixedBond

FixedBond instrument object

Description

Create and price a FixedBond instrument object for one of more Fixed Bond instruments using this workflow:

  1. Use fininstrument to create a FixedBond instrument object for one of more Fixed Bond instruments.

  2. Use ratecurve to specify a curve model for the FixedBond instrument object or use a HullWhite, BraceGatarekMusiela, SABRBraceGatarekMusiela, or LinearGaussian2F model.

  3. Choose a pricing method.

    • When using a ratecurve use finpricer to specify a Discount pricing method for one or more FixedBond instruments.

    • When using a HullWhite, BraceGatarekMusiela, SABRBraceGatarekMusiela, or LinearGaussian2F model, use finpricer to specify an IRMonteCarlo pricing method for one or more FixedBond instruments.

For more detailed 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 FixedBond instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

example

FixedBondObj = fininstrument(InstrumentType,'CouponRate',couponrate_value,'Maturity',maturity_date) creates a FixedBond object for one of more Fixed Bond instruments by specifying InstrumentType and sets the properties for the required name-value pair arguments CouponRate and Maturity.

The FixedBond instrument supports a vanilla bond, a stepped coupon bond, and an amortizing bond. For more information, see More About.

example

FixedBondObj = fininstrument(___,Name,Value) sets optional properties using additional name-value pairs in addition to the required arguments in the previous syntax. For example, FixedBondObj = fininstrument("FixedBond",'CouponRate',0.034,'Maturity',datetime(2019,1,30),'Period',4,'Basis',1,'Principal',100,'FirstCouponDate',datetime(2016,1,30),'EndMonthRule',true,'Name',"fixedbond_instrument") creates a FixedBond option with a coupon rate of 0.34 and a maturity of January 30, 2019. You can specify multiple name-value pair arguments.

Input Arguments

expand all

Instrument type, specified as a string with the value of "FixedBond", a character vector with the value of 'FixedBond', an NINST-by-1 string array with values of "FixedBond", or an NINST-by-1 cell array of character vectors with values of 'FixedBond'.

Data Types: char | cell | string

FixedBond 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: FixedBondObj = fininstrument("FixedBond",'CouponRate',0.034,'Maturity',datetime(2019,1,30),'Period',4,'Basis',1,'Principal',100,'FirstCouponDate',datetime(2016,1,30),'EndMonthRule',true,'Name',"fixedbond_instrument")
Required FixedBond Name-Value Pair Arguments

expand all

FixedBond coupon rate, specified as the comma-separated pair consisting of 'CouponRate' and a scalar decimal or an NINST-by-1 vector of decimals for an annual rate or a timetable where the first column is dates and the second column is associated rates. The date indicates the last day that the coupon rate is valid.

Note

If you are creating one or more FixedBond instruments and use a timetable, the timetable specification applies to all of the FixedBond instruments. CouponRate does not accept an NINST-by-1 cell array of timetables as input.

Data Types: double | timetable

FixedBond maturity date, specified as the comma-separated pair consisting of 'Maturity' and a scalar datetime, serial date number, date character vector, date string or an NINST-by-1 vector of datetimes, serial date numbers, cell array of date character vectors, or date string array.

If you use date character vectors or date strings, the format must be recognizable by datetime because the Maturity property is stored as a datetime.

Data Types: char | cell | double | string | datetime

Optional FixedBond Name-Value Pair Arguments

expand all

Frequency of payments, specified as the comma-separated pair consisting of 'Period' and a scalar integer or an NINST-by-1 vector of integers. Values for Period are 1, 2, 3, 4, 6, or 12.

Data Types: double

Day count basis, specified as the comma-separated pair consisting of 'Basis' and scalar integer or an NINST-by-1 vector of integers using the following values:

  • 0 — actual/actual

  • 1 — 30/360 (SIA)

  • 2 — actual/360

  • 3 — actual/365

  • 4 — 30/360 (PSA)

  • 5 — 30/360 (ISDA)

  • 6 — 30/360 (European)

  • 7 — actual/365 (Japanese)

  • 8 — actual/actual (ICMA)

  • 9 — actual/360 (ICMA)

  • 10 — actual/365 (ICMA)

  • 11 — 30/360E (ICMA)

  • 12 — actual/365 (ISDA)

  • 13 — BUS/252

For more information, see Basis.

Data Types: double

Principal amount or principal value schedule, specified as the comma-separated pair consisting of 'Principal' and a scalar numeric or an NINST-by-1 numeric vector or a timetable.

Principal accepts a timetable, where the first column is dates and the second column is the associated notional principal value. The date indicates the last day that the principal value is valid.

Note

If you are creating one or more FixedBond instruments and use a timetable, the timetable specification applies to all of the FixedBond instruments. Principal does not accept an NINST-by-1 cell array of timetables as input.

Data Types: double | timetable

Flag indicating whether cash flow is adjusted by day count convention, specified as the comma-separated pair consisting of 'DaycountAdjustedCashFlow' and a scalar logical or an NINST-by-1 vector of logicals with values of true or false.

Data Types: logical

Business day conventions for cash flow dates, specified as the comma-separated pair consisting of 'BusinessDayConvention' and a scalar string or character vector or an NINST-by-1 cell array of character vectors or string array. The selection for business day convention determines how nonbusiness days are treated. Nonbusiness days are defined as weekends plus any other date that businesses are not open (for example, statutory holidays). Values are:

  • "actual" — Nonbusiness days are effectively ignored. Cash flows that fall on nonbusiness days are assumed to be distributed on the actual date.

  • "follow" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the following business day.

  • "modifiedfollow" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the following business day. However, if the following business day is in a different month, the previous business day is adopted instead.

  • "previous" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the previous business day.

  • "modifiedprevious" — Cash flows that fall on a nonbusiness day are assumed to be distributed on the previous business day. However, if the previous business day is in a different month, the following business day is adopted instead.

Data Types: char | cell | string

Holidays used in computing business days, specified as the comma-separated pair consisting of 'Holidays' and dates using an NINST-by-1 vector of datetimes, serial date numbers, cell array of date character vectors, or date string array. For example:

H = holidays(datetime('today'),datetime(2025,12,15));
FixedBondObj = fininstrument("FixedBond",'CouponRate',0.34,'Maturity',datetime(2025,12,15),'Holidays',H)

Data Types: double | cell | datetime | string

End-of-month rule flag for generating dates when Maturity is an end-of-month date for a month with 30 or fewer days, specified as the comma-separated pair consisting of 'EndMonthRule' and a scalar logical value or an NINST-by-1 vector of logicals with values of true or false.

  • If you set EndMonthRule to false, the software ignores the rule, meaning that a payment date is always the same numerical day of the month.

  • If you set EndMonthRule to true, the software sets the rule on, meaning that a payment date is always the last actual day of the month.

Data Types: logical

Bond issue date, specified as the comma-separated pair consisting of 'IssueDate' and a scalar datetime, serial date number, date character vector, date string or an NINST-by-1 vector of datetimes, serial date numbers, cell array of date character vectors, or date string array.

If you use date character vectors or date strings, the format must be recognizable by datetime because the IssueDate property is stored as a datetime.

Data Types: double | char | cell | string | datetime

Irregular first coupon date, specified as the comma-separated pair consisting of 'FirstCouponDate' and a scalar datetime, serial date number, date character vector, date string or an NINST-by-1 vector of datetimes, serial date numbers, cell array of date character vectors, or date string array.

When FirstCouponDate and LastCouponDate are both specified, FirstCouponDate takes precedence in determining the coupon payment structure. If you do not specify FirstCouponDate, the cash flow payment dates are determined from other inputs.

If you use date character vectors or date strings, the format must be recognizable by datetime because the FirstCouponDate property is stored as a datetime.

Data Types: double | cell | char | string | datetime

Irregular last coupon date, specified as the comma-separated pair consisting of 'LastCouponDate' and a scalar datetime, serial date number, date character vector, date string or an NINST-by-1 vector of datetimes, serial date numbers, cell array of date character vectors, or date string array.

If you specify LastCouponDate but not FirstCouponDate, LastCouponDate determines the coupon structure of the bond. The coupon structure of a bond is truncated at LastCouponDate, regardless of where it falls, and is followed only by the bond's maturity cash flow date. If you do not specify LastCouponDate, the cash flow payment dates are determined from other inputs.

If you use date character vectors or date strings, the format must be recognizable by datetime because the LastCouponDate property is stored as a datetime.

Data Types: double | cell | char | string | datetime

Forward starting date of payments, specified as the comma-separated pair consisting of 'StartDate' and a scalar datetime, serial date number, date character vector, date string or an NINST-by-1 vector of datetimes, serial date numbers, cell array of date character vectors, or date string array.

If you use date character vectors or date strings, the format must be recognizable by datetime because the StartDate property is stored as a datetime.

Data Types: char | cell | double | string | datetime

User-defined name for one of more instruments, specified as the comma-separated pair consisting of 'Name' and a scalar string or character vector or an NINST-by-1 cell array of character vectors or string array.

Data Types: char | cell | string

Properties

expand all

FixedBond coupon annual rate, returned as a scalar decimal or an NINST-by-1 vector of decimals or a timetable.

Data Types: double | timetable

FixedBond maturity date, returned as a scalar datetime or NINST-by-1 vector of datetimes.

Data Types: datetime

Frequency of payments per year, returned as a scalar integer or an NINST-by-1 vector of integers.

Data Types: double

Day count basis, returned as a scalar integer or an NINST-by-1 vector of integers.

Data Types: double

Principal amount or principal value schedules, returned as a scalar numeric or an NINST-by-1 numeric vector or a timetable.

Data Types: double

Flag indicating whether cash flow adjusts for day count convention, returned as scalar logical or an NINST-by-1 vector of logicals with values of true or false.

Data Types: logical

Business day conventions, returned as a scalar string or an NINST-by-1 string array.

Data Types: string

Holidays used in computing business days, returned as an NINST-by-1 vector of datetimes.

Data Types: datetime

End-of-month rule flag for generating dates when Maturity is an end-of-month date for a month having 30 or fewer days, returned as a scalar logical or an NINST-by-1 vector of logical values.

Data Types: logical

Bond issue date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

Irregular first coupon date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

Irregular last coupon date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

Forward starting date of payments, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

User-defined name for the instrument, returned as a scalar string or an NINST-by-1 string array.

Data Types: string

Object Functions

cashflowsCompute cash flow for FixedBond, FloatBond, Swap, FRA, STIRFuture, OISFuture, OvernightIndexedSwap, or Deposit instrument

Examples

collapse all

This example shows the workflow to price a vanilla FixedBond instrument when you use a ratecurve and a Discount pricing method.

Create FixedBond Instrument Object

Use fininstrument to create a FixedBond instrument object.

FixB = fininstrument("FixedBond",'Maturity',datetime(2022,9,15),'CouponRate',0.021,'Period',2,'Basis',1,'Principal',100,'Name',"fixed_bond_instrument")
FixB = 
  FixedBond with properties:

                  CouponRate: 0.0210
                      Period: 2
                       Basis: 1
                EndMonthRule: 1
                   Principal: 100
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 15-Sep-2022
                        Name: "fixed_bond_instrument"

Create ratecurve Object

Create a ratecurve object using ratecurve.

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

Create Discount Pricer Object

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

outPricer = finpricer("Discount",'DiscountCurve',myRC)
outPricer = 
  Discount with properties:

    DiscountCurve: [1x1 ratecurve]

Price FixedBond Instrument

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

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

       Results: [1x2 table]
    PricerData: []

outPR.Results
ans=1×2 table
    Price       DV01  
    ______    ________

    104.57    0.040397

This example shows the workflow to price multiple vanilla FixedBond instruments when you use a ratecurve and a Discount pricing method.

Create FixedBond Instrument Object

Use fininstrument to create a FixedBond instrument object for three Fixed Bond instruments.

FixB = fininstrument("FixedBond",'Maturity',datetime([2022,9,15 ; 2022,10,15 ; 2022,11,15]),'CouponRate',0.021,'Period',2,'Basis',1,'Principal',[100 ; 250 ; 500],'Name',"fixed_bond_instrument")
FixB=3×1 object
  3x1 FixedBond array with properties:

    CouponRate
    Period
    Basis
    EndMonthRule
    Principal
    DaycountAdjustedCashFlow
    BusinessDayConvention
    Holidays
    IssueDate
    FirstCouponDate
    LastCouponDate
    StartDate
    Maturity
    Name

Create ratecurve Object

Create a ratecurve object using ratecurve.

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

Create Discount Pricer Object

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

outPricer = finpricer("Discount",'DiscountCurve',myRC)
outPricer = 
  Discount with properties:

    DiscountCurve: [1x1 ratecurve]

Price FixedBond Instruments

Use price to compute the prices and sensitivities for the FixedBond instruments.

[Price, outPR] = price(outPricer, FixB,["all"])
Price = 3×1

  104.5679
  261.4498
  522.9174

outPR=1×3 object
  1x3 priceresult array with properties:

    Results
    PricerData

outPR.Results
ans=1×2 table
    Price       DV01  
    ______    ________

    104.57    0.040397

ans=1×2 table
    Price     DV01 
    ______    _____

    261.45    0.103

ans=1×2 table
    Price      DV01  
    ______    _______

    522.92    0.21013

This example shows the workflow to price a stepped FixedBond instrument when you use a ratecurve and a Discount pricing method.

Create FixedBond Instrument Object

Use fininstrument to create a stepped FixedBond instrument object.

Maturity = datetime(2024,1,1);
Period = 1;
CDates = datetime([2020,1,1 ; 2024,1,1]);
CRates = [.025; .03];
CouponRate = timetable(CDates,CRates);

SBond = fininstrument("FixedBond",'Maturity',Maturity,'CouponRate',CouponRate,'Period',Period) 
SBond = 
  FixedBond with properties:

                  CouponRate: [2x1 timetable]
                      Period: 1
                       Basis: 0
                EndMonthRule: 1
                   Principal: 100
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 01-Jan-2024
                        Name: ""

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,1,1);
ZeroTimes = calyears(1:10)';
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
Compounding = 1;
ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates, "Compounding",Compounding)
ZeroCurve = 
  ratecurve with properties:

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

Create Discount Pricer Object

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

outPricer = finpricer("Discount",'DiscountCurve',ZeroCurve)
outPricer = 
  Discount with properties:

    DiscountCurve: [1x1 ratecurve]

Price FixedBond Instrument

Use price to compute the price and sensitivities for the vanilla FixedBond instrument.

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

       Results: [1x2 table]
    PricerData: []

outPR.Results
ans=1×2 table
    Price       DV01  
    ______    ________

    109.62    0.061108

This example shows the workflow to price a amortizing FixedBond instrument when you use a ratecurve and a Discount pricing method.

Create FixedBond Instrument Object

Use fininstrument to create a amortizing FixedBond instrument object.

Maturity = datetime(2024,1,1);
Period = 1;
ADates = datetime([2020,1,1 ; 2024,1,1]);
APrincipal = [100; 85];
Principal = timetable(ADates,APrincipal);
Bondamort = fininstrument("FixedBond",'Maturity',Maturity,'CouponRate',0.025,'Period',Period,'Principal',Principal)  
Bondamort = 
  FixedBond with properties:

                  CouponRate: 0.0250
                      Period: 1
                       Basis: 0
                EndMonthRule: 1
                   Principal: [2x1 timetable]
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 01-Jan-2024
                        Name: ""

Create ratecurve Object

Create a ratecurve object using ratecurve.

Settle = datetime(2018,1,1);
ZeroTimes = calyears(1:10)';
ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]';
ZeroDates = Settle + ZeroTimes;
Compounding = 1;
ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates, "Compounding",Compounding);

Create Discount Pricer Object

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

outPricer = finpricer("Discount",'DiscountCurve',ZeroCurve)
outPricer = 
  Discount with properties:

    DiscountCurve: [1x1 ratecurve]

Price FixedBond Instrument

Use price to compute the price and sensitivities for the vanilla FixedBond instrument.

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

       Results: [1x2 table]
    PricerData: []

outPR.Results
ans=1×2 table
    Price       DV01  
    ______    ________

    107.13    0.054279

This example shows the workflow to price a FixedBond instrument when using a HullWhite model and an IRMonteCarlo pricing method.

Create FixedBond Instrument Object

Use fininstrument to create a FixedBond instrument object.

FixB = fininstrument("FixedBond","Maturity",datetime(2022,9,15),"CouponRate",0.05,'Name',"fixed_bond")
FixB = 
  FixedBond with properties:

                  CouponRate: 0.0500
                      Period: 2
                       Basis: 0
                EndMonthRule: 1
                   Principal: 100
    DaycountAdjustedCashFlow: 0
       BusinessDayConvention: "actual"
                    Holidays: NaT
                   IssueDate: NaT
             FirstCouponDate: NaT
              LastCouponDate: NaT
                   StartDate: NaT
                    Maturity: 15-Sep-2022
                        Name: "fixed_bond"

Create HullWhite Model Object

Use finmodel to create a HullWhite model object.

HullWhiteModel = finmodel("HullWhite",'Alpha',0.32,'Sigma',0.49)
HullWhiteModel = 
  HullWhite with properties:

    Alpha: 0.3200
    Sigma: 0.4900

Create ratecurve Object

Create a ratecurve object using ratecurve.

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

Create IRMonteCarlo Pricer Object

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

outPricer = finpricer("IRMonteCarlo",'Model',HullWhiteModel,'DiscountCurve',myRC,'SimulationDates',ZeroDates)
outPricer = 
  HWMonteCarlo with properties:

          NumTrials: 1000
      RandomNumbers: []
      DiscountCurve: [1x1 ratecurve]
    SimulationDates: [01-Jul-2019    01-Jan-2020    01-Jan-2021    ...    ]
              Model: [1x1 finmodel.HullWhite]

Price FixedBond Instrument

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

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

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

outPR.Results
ans=1×4 table
    Price      Delta     Gamma     Vega
    ______    _______    ______    ____

    115.03    -397.13    1430.4     0  

More About

expand all

Introduced in R2020a