bndprice

Price fixed-income security from yield to maturity

In R2017b, the specification of optional input arguments has changed. While the previous ordered inputs syntax is still supported, it may no longer be supported in a future release. Use the optional name-value pair inputs: `Period`, `Basis`, `EndMonthRule`, `IssueDate`,`FirstCouponDate`, `LastCouponDate`, `StartDate`,`Face`, `CompoundingFrequency`, `DiscountBasis`, and `LastCouponInterest`.

Syntax

``[Price,AccruedInt] = bndprice(Yield,CouponRate,Settle,Maturity)``
``[Price,AccruedInt] = bndprice(___,Name,Value)``

Description

example

````[Price,AccruedInt] = bndprice(Yield,CouponRate,Settle,Maturity)` given bonds with SIA date parameters and yields to maturity, returns the clean prices and accrued interest due.```

example

````[Price,AccruedInt] = bndprice(___,Name,Value)` adds optional name-value pair arguments.```

Examples

collapse all

This example shows how to price a treasury bond at three different yield values.

```Yield = [0.04; 0.05; 0.06]; CouponRate = 0.05; Settle = '20-Jan-1997'; Maturity = '15-Jun-2002'; Period = 2; Basis = 0; [Price, AccruedInt] = bndprice(Yield, CouponRate, Settle,... Maturity, Period, Basis)```
```Price = 3×1 104.8106 99.9951 95.4384 ```
```AccruedInt = 3×1 0.4945 0.4945 0.4945 ```

This example shows how to use `datetime` inputs to price a treasury bond at three different yield values.

```Yield = [0.04; 0.05; 0.06]; CouponRate = 0.05; Settle = datetime('20-Jan-1997','Locale','en_US'); Maturity = datetime('15-Jun-2002','Locale','en_US'); Period = 2; Basis = 0; [Price, AccruedInt] = bndprice(Yield, CouponRate, Settle,... Maturity, Period, Basis)```
```Price = 3×1 104.8106 99.9951 95.4384 ```
```AccruedInt = 3×1 0.4945 0.4945 0.4945 ```

This example shows how to price a Treasury bond at two different yield values that include parameter/value pairs for `CompoundingFrequency`, `DiscountBasis`, and `LastCouponPeriodInterest`.

```bndprice(.04,0.08,'5/25/2004','4/21/2005','Period',1,'Basis',8, ... 'LastCouponInterest','simple')```
```ans = 103.4743 ```

Input Arguments

collapse all

Bond yield to maturity is specified as a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector. `Yield` is on a semiannual basis for `Basis` values `0` through `7` and `13` and an annual basis for `Basis` values `8` through `12`.

Data Types: `double`

Annual percentage rate used to determine the coupons payable on a bond, specified as decimal using a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector.

Data Types: `double`

Settlement date of the bond, specified as a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector using serial date numbers, date character vectors, or datetime arrays. The `Settle` date must be before the `Maturity` date.

Data Types: `double` | `char` | `datetime`

Maturity date of the bond, specified as a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector using serial date numbers, date character vectors, or datetime arrays.

Data Types: `double` | `char` | `datetime`

Name-Value Arguments

Specify 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: ```[Price,AccruedInt] = bndprice(Yield,CouponRate,Settle,Maturity, 'Period',4,'Basis',9)```

Number of coupon payments per year, specified as the comma-separated pair consisting of `'Period'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector using the values: `0`, `1`, `2`, `3`, `4`, `6`, or `12`.

Data Types: `double`

Day-count of the instrument, specified as the comma-separated pair consisting of `'Basis'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector using a supported value:

• 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

Data Types: `double`

End-of-month rule flag, specified as the comma-separated pair consisting of `'EndMonthRule'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector. This rule applies only when `Maturity` is an end-of-month date for a month having 30 or fewer days.

• `0` = Ignore rule, meaning that a bond coupon payment date is always the same numerical day of the month.

• `1` = Set rule on, meaning that a bond coupon 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 or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector using serial date numbers, date character vectors, or datetime arrays.

If you do not specify an `IssueDate`, the cash flow payment dates are determined from other inputs.

Data Types: `double` | `char` | `datetime`

Irregular or normal first coupon date, specified as the comma-separated pair consisting of `'FirstCouponDate'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector using serial date numbers, date character vectors, or datetime arrays.

If you do not specify a `FirstCouponDate`, the cash flow payment dates are determined from other inputs.

Data Types: `double` | `char` | `datetime`

Irregular or normal last coupon date, specified as the comma-separated pair consisting of `'LastCouponDate'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector using serial date numbers, date character vectors, or datetime arrays.

If you do not specify a `LastCouponDate`, the cash flow payment dates are determined from other inputs.

Data Types: `double` | `char` | `datetime`

Forward starting date of payments, specified as the comma-separated pair consisting of `'StartDate'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector using serial date numbers, date character vectors, or datetime arrays.

If you do not specify a `StartDate`, the effective start date is the `Settle` date.

Data Types: `double` | `char` | `datetime`

Face value of the bond, specified as the comma-separated pair consisting of `'Face'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector.

Data Types: `double`

Compounding frequency for yield calculation, specified as the comma-separated pair consisting of `'CompoundingFrequency'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector.

• `1` — Annual compounding

• `2` — Semiannual compounding

• `3` — Compounding three times per year

• `4` — Quarterly compounding

• `6` — Bimonthly compounding

• `12` — Monthly compounding

Note

By default, SIA bases (`0`-`7`) and `BUS/252` use a semiannual compounding convention and ICMA bases (`8`-`12`) use an annual compounding convention.

Data Types: `double`

Basis used to compute the discount factors for computing the yield, specified as the comma-separated pair consisting of `'DiscountBasis'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector. Values are:

• 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

Note

If a SIA day-count basis is defined in the `Basis` input argument and there is no value assigned for `DiscountBasis`, the default behavior is for SIA bases to use the actual/actual day count to compute discount factors.

If an ICMA day-count basis or BUS/252 is defined in the `Basis` input argument and there is no value assigned for `DiscountBasis`, the specified bases from the `Basis` input argument are used.

Data Types: `double`

Compounding convention for computing the yield of a bond in the last coupon period, specified as the comma-separated pair consisting of `'LastCouponInterest'` and a scalar or a `NUMBONDS`-by-`1` or `1`-by-`NUMBONDS` vector. `LastCouponInterest` is based on only the last coupon and the face value to be repaid. Acceptable values are:

• `simple`

• `compound`

Data Types: `char` | `cell`

Output Arguments

collapse all

Clean price of bond, returned as a `NUMBONDS`-by-`1` vector. The dirty price of the bond is the clean price plus the accrued interest. It equals the present value of the bond cash flows of the yield to maturity with semiannual compounding.

accrued interest payable at settlement, returned as a `NUMBONDS`-by-`1` vector.

collapse all

Price and Yield Conventions

The `Price` and `Yield` are related to different formulae for SIA and ICMA conventions.

For SIA conventions, `Price` and `Yield` are related by the formula:

` Price + Accrued Interest = sum(Cash_Flow*(1+Yield/2)^(-Time)) `
where the sum is over the bond's cash flows and corresponding times in units of semiannual coupon periods.

For ICMA conventions, the `Price` and `Yield` are related by the formula:

` Price + Accrued Interest = sum(Cash_Flow*(1+Yield)^(-Time))`

Algorithms

For SIA conventions, the following formula defines bond price and yield:

`$PV=\sum _{i=1}^{n}\left(\frac{CF}{{\left(1+\frac{z}{f}\right)}^{TF}}\right),$`

where:

 PV = Present value of a cash flow. CF = Cash flow amount. z = Risk-adjusted annualized rate or yield corresponding to a given cash flow. The yield is quoted on a semiannual basis. f = Frequency of quotes for the yield. Default is `2` for `Basis` values `0` to `7` and `13` and `1` for `Basis` values `8` to `12`. The default can be overridden by specifying the `CompoundingFrequency` name-value pair. TF = Time factor for a given cash flow. The time factor is computed using the compounding frequency and the discount basis. If these values are not specified, then the defaults are as follows: `CompoundingFrequency` default is `2` for `Basis` values `0` to `7` and `13` and `1` for `Basis` values `8` to `12`. `DiscountBasis` is `0` for `Basis` values `0` to `7` and `13` and the input `Basis` for `Basis` values `8` to `12`.

Note

The `Basis` is always used to compute accrued interest.

For ICMA conventions, the frequency of annual coupon payments determines bond price and yield.

References

[1] Krgin, D. Handbook of Global Fixed Income Calculations. Wiley, 2002.

[2] Mayle, J. "Standard Securities Calculations Methods: Fixed Income Securities Formulas for Analytic Measures." SIA, Vol 2, Jan 1994.

[3] Stigum, M., Robinson, F. Money Market and Bond Calculation. McGraw-Hill, 1996.

Version History

Introduced before R2006a