Financial Toolbox |
 |
Yield Functions
To illustrate toolbox yield functions, compute the yield of a bond that has odd first and last periods and settlement in the first period. First set up variables for settlement, maturity date, issue, first coupon, and a last coupon date.
Settle = '12-Jan-2000';
Maturity = '01-Oct-2001';
IssueDate = '01-Jan-2000';
FirstCouponDate = '15-Jan-2000';
LastCouponDate = '15-Apr-2000';
Assume a face value of $100. Specify a purchase price of $95.70, a coupon rate of 4%, quarterly coupon payments, and a 30/360 day-count convention (Basis = 1
).
Price = 95.7;
CouponRate = 0.04;
Period = 4;
Basis = 1;
EndMonthRule = 1;
Calling the function
Yield = bndyield(Price, CouponRate, Settle, Maturity, Period,...
Basis, EndMonthRule, IssueDate, FirstCouponDate, LastCouponDate)
returns
Yield = 0.0659
(6.60%).
| Pricing Functions | | Fixed-Income Sensitivities |  |