Accelerating the pace of engineering and science

# bndprice

Price fixed-income security from yield to maturity

## Syntax

[Price, AccruedInt] = bndprice(Yield, CouponRate, Settle,
Maturity)
[Price, AccruedInt] = bndprice(Yield, CouponRate, Settle,
Maturity, Period, Basis, EndMonthRule, IssueDate,
FirstCouponDate, LastCouponDate, StartDate, Face)
[Price, AccruedInt] = bndprice(Yield, CouponRate, Settle,
Maturity, 'ParameterName', 'ParameterValue ...)

## Description

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

[Price, AccruedInt] = bndprice(Yield, CouponRate, Settle,
Maturity, Period, Basis, EndMonthRule, IssueDate,
FirstCouponDate, LastCouponDate, StartDate, Face)
given bonds with SIA date parameters and semiannual yields to maturity and optional inputs, returns the clean prices and accrued interest due.

[Price, AccruedInt] = bndprice(Yield, CouponRate, Settle,
Maturity, 'ParameterName', 'ParameterValue ...)
accepts optional inputs as one or more comma-separated parameter/value pairs. 'ParameterName' is the name of the parameter inside single quotes. ParameterValue is the value corresponding to 'ParameterName'. Specify parameter/value pairs in any order. Names are case-insensitive.

## Input Arguments

 Yield Bond yield to maturity is on a semiannual basis for basis values 0 through 7 and an annual basis for basis values 8 through 12. CouponRate Decimal number indicating the annual percentage rate used to determine the coupons payable on a bond. Settle Settlement date. A vector of serial date numbers or date strings. Settle must be earlier than Maturity. Maturity Maturity date. A vector of serial date numbers or date strings.

### Ordered Input or Parameter–Value Pairs

Enter the following inputs using an ordered syntax or as parameter value pairs. You cannot mix ordered syntax with parameter value pairs.

 Period Coupons per year of the bond. A vector of integers. Values are 0, 1, 2 , 3, 4, 6, and 12. Default: 2 Basis Day-count basis of the instrument. A vector of integers. 0 = actual/actual1 = 30/360 (SIA)2 = actual/3603 = actual/3654 = 30/360 (PSA)5 = 30/360 (ISDA)6 = 30/360 (European)7 = actual/365 (Japanese)8 = actual/actual (ISMA)9 = actual/360 (ISMA)10 = actual/365 (ISMA)11 = 30/360E (ISMA) 12 = actual/365 (ISDA)13 = BUS/252For more information, see basis. Default: 0 EndMonthRule End-of-month rule. A 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. Default: 1 IssueDate Issue date for a bond. Default: If you do not specify an IssueDate, the cash flow payment dates are determined from other inputs. FirstCouponDate Date when a bond makes its first coupon payment; used when bond has an irregular first coupon period. When FirstCouponDate and LastCouponDate are both specified, FirstCouponDate takes precedence in determining the coupon payment structure. Default: If you do not specify a FirstCouponDate, the cash flow payment dates are determined from other inputs. LastCouponDate Last coupon date of a bond before the maturity date; used when bond has an irregular last coupon period. In the absence of a specified FirstCouponDate, a specified LastCouponDate determines the coupon structure of the bond. The coupon structure of a bond is truncated at the LastCouponDate, regardless of where it falls, and is followed only by the bond's maturity cash flow date. Default: If you do not specify a LastCouponDate, the cash flow payment dates are determined from other inputs. StartDate Date when a bond actually starts (the date from which a bond cash flow is considered). To make an instrument forward-starting, specify this date as a future date. If you do not specify StartDate, the effective start date is the Settle date. Default: If you do not specify StartDate, the effective start date is the Settle date. Face Face or par value. Default: 100

### Parameter–Value Pairs

Enter the following inputs only as parameter/value pairs.

 CompoundingFrequency Compounding frequency for yield calculation. By default, SIA bases (0-7) and BUS/252 use a semiannual compounding convention and ISMA bases (8-12) use an annual compounding convention. Default: SIA bases (0-7) and BUS/252 use a semiannual compounding convention and ISMA bases (8-12) use an annual compounding convention. DiscountBasis Basis used to compute the discount factors for computing the yield. The default behavior is for SIA bases to use the actual/actual day count to compute discount factors. If you use ISMA day counts and BUS/252, the specified bases are used. Default: SIA bases use the actual/actual day count to compute discount factors. LastCouponInterest Compounding convention for computing the yield of a bond in the last coupon period. This is based on only the last coupon and the face value to be repaid. Acceptable values are simple or compound. Default: compound

## Output Arguments

 Price NUMBONDS-by-1 vector for the clean price of the bond. 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. AccruedInt NUMBONDS-by-1 vector for the accrued interest payable at settlement.

## Definitions

Given NBONDS with date parameters and yields to maturity, bndprice returns the clean prices and the accrued interest due.

All nonscalar or empty matrix input arguments must be either NUMBONDS-by-1 or 1-by-NUMBONDS conforming vectors. Fill in unspecified entries input vectors with NaNs. Dates can be serial date numbers or date strings.

## Examples

expand all

### Price a Treasury Bond from Yield to Maturity

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 =

104.8106
99.9951
95.4384

AccruedInt =

0.4945
0.4945
0.4945

```

### Price a Treasury Bond with Different Yield Values

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

```

expand all

### 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 ISMA conventions, the frequency of annual coupon payments determines bond price and yield.

## References

Krgin, Dragomir, Handbook of Global Fixed Income Calculations, John Wiley & Sons, 2002.

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

Stigum, Marcia, and Franklin Robinson, Money Market and Bond Calculations, McGraw-Hill, 1996.