SQL Server BONDCF Function
Updated 2023-10-06 13:39:08.400000
Description
Use the table-valued function BONDCF to return the cash flows of a bond with regular periodic coupon payments. BONDCF also supports odd first and odd last coupon bonds with up to 2 quasi-coupon periods each.
The first row in the resultant table is dated with settlement date passed into the function and is for the amount of the accrued interest. All the remaining rows are dated for the subsequent coupon dates and the amounts are the coupon amount. The row for the maturity date includes the coupon amount and the redemption amount.
The resultant table also includes the discount factor for each period as will as the discounted cash flow value for each period. The sum of the discounted cash flow values across all the periods is equal to the clean price of the bond.
Syntax
SELECT * FROM [[westclintech].wct].[BONDCF](
<@Settlement, datetime,>
,<@Maturity, datetime,>
,<@Rate, float,>
,<@Yield, float,>
,<@Redemption, float,>
,<@Frequency, float,>
,<@Basis, nvarchar(4000),>
,<@Issue, datetime,>
,<@FirstCoupon, datetime,>
,<@LastCoupon, datetime,>)
Arguments
@Settlement
the settlement date of the bond. @Settlement is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@Maturity
the maturity date of the bond. @Maturity is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@Rate
the bond's annual coupon rate. @Rate is an expression of type float or of a type that can be implicitly converted to float.
@Yield
the bond's annual yield. @Yield is an expression of type float or of a type that can be implicitly converted to float.
@Redemption
the bond's redemption value per 100 face value. @Redemption is an expression of type float or of a type that can be implicitly converted to float.
@Frequency
the number of coupon payments per year. For annual payments, @Frequency = 1; for semi-annual, @Frequency = 2; for quarterly, @Frequency = 4; for bi-monthly, @Frequency = 6; for monthly, @Frequency = 12. For bonds with @Basis = 'A/364' or 9, you can enter 364 for payments made every 52 weeks, 182 for payments made every 26 weeks, 91 for payments made every 13 weeks, 28 for payments made every 4 weeks, 14 for payments made every 2 weeks, and 7 for weekly payments. @Frequency is an expression of type float or of a type that can be implicitly converted to float.
@Basis
is the type of day count to use. @Basis is an expression of the character string data type category.
| @Basis | Day count basis |
|---|---|
| 0 , 'BOND' | US (NASD) 30/360 |
| 1 , 'ACTUAL' | Actual/Actual |
| 2 , 'A360' | Actual/360 |
| 3 , 'A365' | Actual/365 |
| 4 , '30E/360 (ISDA)' , '30E/360' , 'ISDA' , '30E/360 ISDA' , 'EBOND' | European 30/360 |
| 5 , '30/360' , '30/360 ISDA' , 'GERMAN' | 30/360 ISDA |
| 6 , 'NL/ACT' | No Leap Year/ACT |
| 7 , 'NL/365' | No Leap Year /365 |
| 8 , 'NL/360' | No Leap Year /360 |
| 9 , 'A/365' | Actual/365 |
| 10 , 'BOND NON-EOM' | US (NASD) 30/360 non-end-of-month |
| 11 , 'ACTUAL NON-EOM' | Actual/Actual non-end-of-month |
| 12 , 'A360 NON-EOM' | Actual/360 non-end-of-month |
| 13 , 'A365 NON-EOM' | Actual/365 non-end-of-month |
| 14 , '30E/360 NON-EOM' , '30E/360 ICMA NON-EOM' , 'EBOND NON-EOM' | European 30/360 non-end-of-month |
| 15 , '30/360 NON-EOM' , '30/360 ISDA NON-EOM' , 'GERMAN NON-EOM' | 30/360 ISDA non-end-of-month |
| 16 , 'NL/ACT NON-EOM' | No Leap Year/ACT non-end-of-month |
| 17 , 'NL/365 NON-EOM' | No Leap Year/365 non-end-of-month |
| 18 , 'NL/360 NON-EOM' | No Leap Year/360 non-end-of-month |
| 19 , 'A/365 NON-EOM' | Actual/365 non-end-of-month |
@Issue
the first coupon date of the bond. The period from the issue date until the first coupon date defines the odd interest period. All subsequent coupon dates are assumed to occur at regular periodic intervals as defined by @Frequency. @FirstCoupon is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@FirstCoupon
the first coupon date of the bond. The period from the issue date until the first coupon date defines the odd interest period. All subsequent coupon dates are assumed to occur at regular periodic intervals as defined by @Frequency. @FirstCoupon is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@LastCoupon
the last coupon date of the bond prior to the maturity. The period from the last interest date until the maturity date defines the odd interest period. All coupon dates from @FirstCoupon to @LastCoupon are assumed to occur at regular periodic intervals as defined by @Frequency. @LastCoupon is an expression that returns a datetime or smalldatetime value, or a character string in date format.
Return Type
Remarks
If @Settlement is NULL then @Settlement = GETDATE().
If @Rate is NULL then @Rate = 0.
If @Redemption is NULL then @Redemption = 100.
If @Frequency is NULL then @Frequency = 2.
If @Basis is NULL then @Basis = 1.
If @Maturity <= @Settlement then no rows are returned.
If @Frequency invalid BONDCF returns an error.
If @Basis invalid (see above list), BONDCF returns an error.
If @Maturity is NULL then no rows are returned.
To calculate the cash flows for a bond paying regular periodic interest just enter @Maturity and @Settlement.
To calculate the cash flows for bond with an odd first coupon where the settlement date is before the first coupon date, enter @Issue, @FirstCoupon, @Settlement, and @Maturity. If the settlement date is on or after the first coupon date just enter @Maturity and @Settlement.
To calculate the cash flows for bond with an odd first coupon and an odd last coupon where the settlement date is before the first coupon date, enter @Issue, @FirstCoupon, @LastCoupon, @Settlement, and @Maturity. If the settlement date is on or after the first coupon date just enter @LastCoupon, @Maturity and @Settlement.
To calculate the cash flows for a bond with an odd last coupon enter @LastCoupon, @Settlement, and @Maturity.
Examples
In this example we generate the cash flows for bond which pays regular period interest and is maturing on 2034-06-15. The settlement date is 2014-05-01, the yield is 2.76%, the coupon rate is 2.50%, the redemption value is 100, the coupon is paid twice-yearly and the day-count convention is actual/actual.
SELECT *
FROM wct.BONDCF( '2014-05-01', --@Settlement
'2034-06-15', --@Maturity
0.025, --@Rate
0.0276, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
NULL --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-05-01 | -0.940934065934066 | 0 | 1 | -0.940934065934066 | -0.940934065934066 |
| 2014-06-15 | 1.25 | 0.247252747252747 | 0.996616976475482 | 1.24577122059435 | 0.304837154660287 |
| 2014-12-15 | 1.25 | 1.24725274725275 | 0.983050874408643 | 1.2288135930108 | 1.53365074767109 |
| 2015-06-15 | 1.25 | 2.24725274725275 | 0.969669436189231 | 1.21208679523654 | 2.74573754290763 |
| 2015-12-15 | 1.25 | 3.24725274725275 | 0.956470148144833 | 1.19558768518104 | 3.94132522808867 |
| 2016-06-15 | 1.25 | 4.24725274725275 | 0.943450530819523 | 1.1793131635244 | 5.12063839161307 |
| 2016-12-15 | 1.25 | 5.24725274725275 | 0.930608138508111 | 1.16326017313514 | 6.28389856474821 |
| 2017-06-15 | 1.25 | 6.24725274725275 | 0.917940558796717 | 1.1474256984959 | 7.43132426324411 |
| 2017-12-15 | 1.25 | 7.24725274725275 | 0.905445412109604 | 1.131806765137 | 8.56313102838111 |
| 2018-06-15 | 1.25 | 8.24725274725275 | 0.893120351262186 | 1.11640043907773 | 9.67953146745885 |
| 2018-12-15 | 1.25 | 9.24725274725275 | 0.880963061020108 | 1.10120382627514 | 10.780735293734 |
| 2019-06-15 | 1.25 | 10.2472527472527 | 0.86897125766434 | 1.08621407208043 | 11.8669493658144 |
| 2019-12-15 | 1.25 | 11.2472527472527 | 0.857142688562182 | 1.07142836070273 | 12.9383777265171 |
| 2020-06-15 | 1.25 | 12.2472527472527 | 0.845475131744113 | 1.05684391468014 | 13.9952216411973 |
| 2020-12-15 | 1.25 | 13.2472527472527 | 0.833966395486401 | 1.042457994358 | 15.0376796355553 |
| 2021-06-15 | 1.25 | 14.2472527472527 | 0.822614317899389 | 1.02826789737424 | 16.0659475329295 |
| 2021-12-15 | 1.25 | 15.2472527472527 | 0.811416766521394 | 1.01427095815174 | 17.0802184910813 |
| 2022-06-15 | 1.25 | 16.2472527472527 | 0.800371637918124 | 1.00046454739766 | 18.0806830384789 |
| 2022-12-15 | 1.25 | 17.2472527472527 | 0.789476857287556 | 0.986846071609445 | 19.0675291100884 |
| 2023-06-15 | 1.25 | 18.2472527472527 | 0.778730378070187 | 0.973412972587734 | 20.0409420826761 |
| 2023-12-15 | 1.25 | 19.2472527472527 | 0.768130181564596 | 0.960162726955745 | 21.0011048096318 |
| 2024-06-15 | 1.25 | 20.2472527472527 | 0.75767427654823 | 0.947092845685288 | 21.9481976553171 |
| 2024-12-15 | 1.25 | 21.2472527472527 | 0.747360698903364 | 0.934200873629205 | 22.8823985289463 |
| 2025-06-15 | 1.25 | 22.2472527472527 | 0.737187511248139 | 0.921484389060174 | 23.8038829180065 |
| 2025-12-15 | 1.25 | 23.2472527472527 | 0.727152802572637 | 0.908941003215796 | 24.7128239212223 |
| 2026-06-15 | 1.25 | 24.2472527472527 | 0.717254687879894 | 0.896568359849868 | 25.6093922810722 |
| 2026-12-15 | 1.25 | 25.2472527472527 | 0.707491307831815 | 0.884364134789769 | 26.4937564158619 |
| 2027-06-15 | 1.25 | 26.2472527472527 | 0.697860828399897 | 0.872326035499871 | 27.3660824513618 |
| 2027-12-15 | 1.25 | 27.2472527472527 | 0.688361440520711 | 0.860451800650889 | 28.2265342520127 |
| 2028-06-15 | 1.25 | 28.2472527472527 | 0.678991359756077 | 0.848739199695096 | 29.0752734517078 |
| 2028-12-15 | 1.25 | 29.2472527472527 | 0.669748825957859 | 0.837186032447323 | 29.9124594841551 |
| 2029-06-15 | 1.25 | 30.2472527472527 | 0.660632102937323 | 0.825790128671654 | 30.7382496128268 |
| 2029-12-15 | 1.25 | 31.2472527472527 | 0.651639478139005 | 0.814549347673756 | 31.5527989605005 |
| 2030-06-15 | 1.25 | 32.2472527472527 | 0.642769262319003 | 0.803461577898754 | 32.3562605383993 |
| 2030-12-15 | 1.25 | 33.2472527472527 | 0.634019789227661 | 0.792524736534576 | 33.1487852749339 |
| 2031-06-15 | 1.25 | 34.2472527472527 | 0.625389415296568 | 0.781736769120711 | 33.9305220440546 |
| 2031-12-15 | 1.25 | 35.2472527472527 | 0.616876519329817 | 0.771095649162271 | 34.7016176932168 |
| 2032-06-15 | 1.25 | 36.2472527472527 | 0.608479502199464 | 0.76059937774933 | 35.4622170709662 |
| 2032-12-15 | 1.25 | 37.2472527472527 | 0.600196786545141 | 0.750245983181427 | 36.2124630541476 |
| 2033-06-15 | 1.25 | 38.2472527472527 | 0.592026816477748 | 0.740033520597185 | 36.9524965747448 |
| 2033-12-15 | 1.25 | 39.2472527472527 | 0.583968057287185 | 0.729960071608981 | 37.6824566463538 |
| 2034-06-15 | 101.25 | 40.2472527472527 | 0.576018995154059 | 58.3219232593485 | 96.0043799057023 |
In this example we generate the cash flows for a zero-coupon bond.
SELECT *
FROM wct.BONDCF( '2014-05-01', --@Settlement
'2044-06-15', --@Maturity
0.0000, --@Rate
0.0301, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
NULL --@LastCoupon
)
WHERE amt_cashflow != 0;
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2044-06-15 | 100 | 60.2472527472527 | 0.40658357611314 | 40.658357611314 | 40.658357611314 |
In this example we generate the cash flow of a bond paying regular periodic interest settling in the final coupon period.
SELECT *
FROM wct.BONDCF( '2014-05-01', --@Settlement
'2014-07-15', --@Maturity
0.0190, --@Rate
0.0005, --@Yield
100, --@Redemption
2, --@Frequency
0, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
NULL --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-05-01 | -0.559444444444444 | 0 | 1 | -0.559444444444444 | -0.559444444444444 |
| 2014-07-15 | 100.95 | 0.411111111111111 | 0.999897232784408 | 100.939625649586 | 100.380181205142 |
Here we generate the cash flows for a bond paying regular periodic interest which matures on the 30th of September 2034, with semi-annual coupons payable on March 30th and September 30th.
SELECT *
FROM wct.BONDCF( '2014-05-01', --@Settlement
'2034-09-30', --@Maturity
0.0257, --@Rate
0.0269, --@Yield
100, --@Redemption
2, --@Frequency
11, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
NULL --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-05-01 | -0.223478260869565 | 0 | 1 | -0.223478260869565 | -0.223478260869565 |
| 2014-09-30 | 1.285 | 0.826086956521739 | 0.989023869886121 | 1.27089567280367 | 1.0474174119341 |
| 2015-03-30 | 1.285 | 1.82608695652174 | 0.975898041231556 | 1.25402898298255 | 2.30144639491665 |
| 2015-09-30 | 1.285 | 2.82608695652174 | 0.962946411990287 | 1.23738613940752 | 3.53883253432417 |
| 2016-03-30 | 1.285 | 3.82608695652174 | 0.950166670275087 | 1.22096417130349 | 4.75979670562766 |
| 2016-09-30 | 1.285 | 4.82608695652174 | 0.937556534880938 | 1.20476014732201 | 5.96455685294966 |
| 2017-03-30 | 1.285 | 5.82608695652174 | 0.925113754877832 | 1.18877117501801 | 7.15332802796767 |
| 2017-09-30 | 1.285 | 6.82608695652174 | 0.912836109208971 | 1.17299440033353 | 8.3263224283012 |
| 2018-03-30 | 1.285 | 7.82608695652174 | 0.900721406294312 | 1.15742700708819 | 9.48374943538939 |
| 2018-09-30 | 1.285 | 8.82608695652174 | 0.888767483639363 | 1.14206621647658 | 10.625815651866 |
| 2019-03-30 | 1.285 | 9.82608695652174 | 0.876972207449172 | 1.12690928657219 | 11.7527249384382 |
| 2019-09-30 | 1.285 | 10.8260869565217 | 0.865333472247444 | 1.11195351183797 | 12.8646784502761 |
| 2020-03-30 | 1.285 | 11.8260869565217 | 0.853849200500709 | 1.09719622264341 | 13.9618746729195 |
| 2020-09-30 | 1.285 | 12.8260869565217 | 0.84251734224748 | 1.08263478478801 | 15.0445094577076 |
| 2021-03-30 | 1.285 | 13.8260869565217 | 0.831335874732331 | 1.06826659903104 | 16.1127760567386 |
| 2021-09-30 | 1.285 | 14.8260869565217 | 0.820302802044828 | 1.0540891006276 | 17.1668651573662 |
| 2022-03-30 | 1.285 | 15.8260869565217 | 0.809416154763262 | 1.04009975887079 | 18.206964916237 |
| 2022-09-30 | 1.285 | 16.8260869565217 | 0.7986739896031 | 1.02629607663998 | 19.233260992877 |
| 2023-03-30 | 1.285 | 17.8260869565217 | 0.788074389070107 | 1.01267558995509 | 20.2459365828321 |
| 2023-09-30 | 1.285 | 18.8260869565217 | 0.777615461118069 | 0.999235867536719 | 21.2451724503688 |
| 2024-03-30 | 1.285 | 19.8260869565217 | 0.76729533881106 | 0.985974510372213 | 22.231146960741 |
| 2024-09-30 | 1.285 | 20.8260869565217 | 0.757112179990192 | 0.972889151287397 | 23.2040361120284 |
| 2025-03-30 | 1.285 | 21.8260869565217 | 0.747064166944785 | 0.959977454524049 | 24.1640135665524 |
| 2025-09-30 | 1.285 | 22.8260869565217 | 0.737149506087903 | 0.947237115322955 | 25.1112506818754 |
| 2026-03-30 | 1.285 | 23.8260869565217 | 0.727366427636196 | 0.934665859512512 | 26.0459165413879 |
| 2026-09-30 | 1.285 | 24.8260869565217 | 0.717713185293992 | 0.922261443102779 | 26.9681779844907 |
| 2027-03-30 | 1.285 | 25.8260869565217 | 0.708188055941578 | 0.910021651884927 | 27.8781996363756 |
| 2027-09-30 | 1.285 | 26.8260869565217 | 0.698789339327621 | 0.897944301035993 | 28.7761439374116 |
| 2028-03-30 | 1.285 | 27.8260869565217 | 0.689515357765673 | 0.88602723472889 | 29.6621711721405 |
| 2028-09-30 | 1.285 | 28.8260869565217 | 0.680364455834696 | 0.874268325747585 | 30.5364394978881 |
| 2029-03-30 | 1.285 | 29.8260869565217 | 0.671335000083572 | 0.86266547510739 | 31.3991049729955 |
| 2029-09-30 | 1.285 | 30.8260869565217 | 0.662425378739525 | 0.85121661168029 | 32.2503215846758 |
| 2030-03-30 | 1.285 | 31.8260869565217 | 0.653634001420421 | 0.839919691825241 | 33.090241276501 |
| 2030-09-30 | 1.285 | 32.8260869565217 | 0.644959298850877 | 0.828772699023376 | 33.9190139755244 |
| 2031-03-30 | 1.285 | 33.8260869565217 | 0.636399722582147 | 0.817773643518059 | 34.7367876190424 |
| 2031-09-30 | 1.285 | 34.8260869565217 | 0.62795374471572 | 0.806920561959701 | 35.5437081810021 |
| 2032-03-30 | 1.285 | 35.8260869565217 | 0.619619857630589 | 0.796211517055307 | 36.3399196980575 |
| 2032-09-30 | 1.285 | 36.8260869565217 | 0.611396573714134 | 0.785644597222662 | 37.1255642952801 |
| 2033-03-30 | 1.285 | 37.8260869565217 | 0.603282425096585 | 0.775217916249112 | 37.9007822115292 |
| 2033-09-30 | 1.285 | 38.8260869565217 | 0.595275963389003 | 0.764929612954869 | 38.6657118244841 |
| 2034-03-30 | 1.285 | 39.8260869565217 | 0.58737575942474 | 0.754777850860791 | 39.4204896753449 |
| 2034-09-30 | 101.285 | 40.8260869565217 | 0.579580403004332 | 58.7028011182937 | 98.1232907936386 |
Here's an example with a negative yield.
SELECT *
FROM wct.BONDCF( '2014-05-01', --@Settlement
'2014-09-30', --@Maturity
0.0257, --@Rate
-0.046219, --@Yield
98, --@Redemption
2, --@Frequency
0, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
NULL --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-05-01 | -0.221305555555556 | 0 | 1 | -0.221305555555556 | -0.221305555555556 |
| 2014-09-30 | 99.285 | 0.827777777777778 | 1.01950260625788 | 101.221316262313 | 101.000010706758 |
This is an example of bond paying interest every 26 weeks.
SELECT *
FROM wct.BONDCF( '2014-10-01', --@Settlement
'2023-03-13', --@Maturity
0.1250, --@Rate
0.1100, --@Yield
100, --@Redemption
182, --@Frequency
9, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
NULL --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-10-01 | -0.309065934065934 | 0 | 1 | -0.309065934065934 | -0.309065934065934 |
| 2015-03-23 | 6.25 | 0.950549450549451 | 0.950380216478331 | 5.93987635298957 | 5.63081041892363 |
| 2015-09-21 | 6.25 | 1.95054945054945 | 0.900834328415479 | 5.63021455259675 | 11.2610249715204 |
| 2016-03-21 | 6.25 | 2.95054945054945 | 0.853871401341687 | 5.33669625838554 | 16.5977212299059 |
| 2016-09-19 | 6.25 | 3.95054945054945 | 0.809356778522926 | 5.05847986576829 | 21.6562010956742 |
| 2017-03-20 | 6.25 | 4.95054945054945 | 0.767162823244479 | 4.794767645278 | 26.4509687409522 |
| 2017-09-18 | 6.25 | 5.95054945054945 | 0.727168552838369 | 4.54480345523981 | 30.995772196192 |
| 2018-03-19 | 6.25 | 6.95054945054945 | 0.689259291789923 | 4.30787057368702 | 35.303642769879 |
| 2018-09-17 | 6.25 | 7.95054945054945 | 0.653326342928837 | 4.08328964330523 | 39.3869324131843 |
| 2019-03-18 | 6.25 | 8.95054945054945 | 0.619266675761931 | 3.87041672351207 | 43.2573491366963 |
| 2019-09-16 | 6.25 | 9.95054945054945 | 0.586982631053963 | 3.66864144408727 | 46.9259905807836 |
| 2020-03-16 | 6.25 | 10.9505494505495 | 0.556381640809444 | 3.47738525505902 | 50.4033758358426 |
| 2020-09-14 | 6.25 | 11.9505494505495 | 0.527375962852553 | 3.29609976782846 | 53.6994756036711 |
| 2021-03-15 | 6.25 | 12.9505494505495 | 0.499882429244126 | 3.12426518277579 | 56.8237407864469 |
| 2021-09-13 | 6.25 | 13.9505494505495 | 0.473822207814338 | 2.96138879883961 | 59.7851295852865 |
| 2022-03-14 | 6.25 | 14.9505494505495 | 0.449120576127334 | 2.80700360079584 | 62.5921331860823 |
| 2022-09-12 | 6.25 | 15.9505494505495 | 0.425706707229701 | 2.66066692018563 | 65.252800106268 |
| 2023-03-13 | 106.25 | 16.9505494505495 | 0.403513466568437 | 42.8733058228964 | 108.126105929164 |
Here's an example of a bond with odd short first coupon settling on the issue date of the bond.
SELECT *
FROM wct.BONDCF( '2014-05-01', --@Settlement
'2034-06-15', --@Maturity
0.0250, --@Rate
0.0276, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
'2014-05-01', --@Issue
'2014-06-15', --@FirstCoupon
NULL --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-05-01 | 0 | 0 | 1 | 0 | 0 |
| 2014-06-15 | 0.309065934065934 | 0.247252747252747 | 0.996616976475482 | 0.308020356740362 | 0.308020356740362 |
| 2014-12-15 | 1.25 | 1.24725274725275 | 0.983050874408643 | 1.2288135930108 | 1.53683394975117 |
| 2015-06-15 | 1.25 | 2.24725274725275 | 0.969669436189231 | 1.21208679523654 | 2.7489207449877 |
| 2015-12-15 | 1.25 | 3.24725274725275 | 0.956470148144833 | 1.19558768518104 | 3.94450843016875 |
| 2016-06-15 | 1.25 | 4.24725274725275 | 0.943450530819523 | 1.1793131635244 | 5.12382159369315 |
| 2016-12-15 | 1.25 | 5.24725274725275 | 0.930608138508111 | 1.16326017313514 | 6.28708176682829 |
| 2017-06-15 | 1.25 | 6.24725274725275 | 0.917940558796717 | 1.1474256984959 | 7.43450746532418 |
| 2017-12-15 | 1.25 | 7.24725274725275 | 0.905445412109604 | 1.131806765137 | 8.56631423046119 |
| 2018-06-15 | 1.25 | 8.24725274725275 | 0.893120351262186 | 1.11640043907773 | 9.68271466953892 |
| 2018-12-15 | 1.25 | 9.24725274725275 | 0.880963061020108 | 1.10120382627514 | 10.7839184958141 |
| 2019-06-15 | 1.25 | 10.2472527472527 | 0.86897125766434 | 1.08621407208043 | 11.8701325678945 |
| 2019-12-15 | 1.25 | 11.2472527472527 | 0.857142688562182 | 1.07142836070273 | 12.9415609285972 |
| 2020-06-15 | 1.25 | 12.2472527472527 | 0.845475131744113 | 1.05684391468014 | 13.9984048432774 |
| 2020-12-15 | 1.25 | 13.2472527472527 | 0.833966395486401 | 1.042457994358 | 15.0408628376354 |
| 2021-06-15 | 1.25 | 14.2472527472527 | 0.822614317899389 | 1.02826789737424 | 16.0691307350096 |
| 2021-12-15 | 1.25 | 15.2472527472527 | 0.811416766521394 | 1.01427095815174 | 17.0834016931613 |
| 2022-06-15 | 1.25 | 16.2472527472527 | 0.800371637918124 | 1.00046454739766 | 18.083866240559 |
| 2022-12-15 | 1.25 | 17.2472527472527 | 0.789476857287556 | 0.986846071609445 | 19.0707123121684 |
| 2023-06-15 | 1.25 | 18.2472527472527 | 0.778730378070187 | 0.973412972587734 | 20.0441252847562 |
| 2023-12-15 | 1.25 | 19.2472527472527 | 0.768130181564596 | 0.960162726955745 | 21.0042880117119 |
| 2024-06-15 | 1.25 | 20.2472527472527 | 0.75767427654823 | 0.947092845685288 | 21.9513808573972 |
| 2024-12-15 | 1.25 | 21.2472527472527 | 0.747360698903364 | 0.934200873629205 | 22.8855817310264 |
| 2025-06-15 | 1.25 | 22.2472527472527 | 0.737187511248139 | 0.921484389060174 | 23.8070661200866 |
| 2025-12-15 | 1.25 | 23.2472527472527 | 0.727152802572637 | 0.908941003215796 | 24.7160071233024 |
| 2026-06-15 | 1.25 | 24.2472527472527 | 0.717254687879894 | 0.896568359849868 | 25.6125754831522 |
| 2026-12-15 | 1.25 | 25.2472527472527 | 0.707491307831815 | 0.884364134789769 | 26.496939617942 |
| 2027-06-15 | 1.25 | 26.2472527472527 | 0.697860828399897 | 0.872326035499871 | 27.3692656534419 |
| 2027-12-15 | 1.25 | 27.2472527472527 | 0.688361440520711 | 0.860451800650889 | 28.2297174540928 |
| 2028-06-15 | 1.25 | 28.2472527472527 | 0.678991359756077 | 0.848739199695096 | 29.0784566537879 |
| 2028-12-15 | 1.25 | 29.2472527472527 | 0.669748825957859 | 0.837186032447323 | 29.9156426862352 |
| 2029-06-15 | 1.25 | 30.2472527472527 | 0.660632102937323 | 0.825790128671654 | 30.7414328149068 |
| 2029-12-15 | 1.25 | 31.2472527472527 | 0.651639478139005 | 0.814549347673756 | 31.5559821625806 |
| 2030-06-15 | 1.25 | 32.2472527472527 | 0.642769262319003 | 0.803461577898754 | 32.3594437404794 |
| 2030-12-15 | 1.25 | 33.2472527472527 | 0.634019789227661 | 0.792524736534576 | 33.1519684770139 |
| 2031-06-15 | 1.25 | 34.2472527472527 | 0.625389415296568 | 0.781736769120711 | 33.9337052461346 |
| 2031-12-15 | 1.25 | 35.2472527472527 | 0.616876519329817 | 0.771095649162271 | 34.7048008952969 |
| 2032-06-15 | 1.25 | 36.2472527472527 | 0.608479502199464 | 0.76059937774933 | 35.4654002730462 |
| 2032-12-15 | 1.25 | 37.2472527472527 | 0.600196786545141 | 0.750245983181427 | 36.2156462562277 |
| 2033-06-15 | 1.25 | 38.2472527472527 | 0.592026816477748 | 0.740033520597185 | 36.9556797768249 |
| 2033-12-15 | 1.25 | 39.2472527472527 | 0.583968057287185 | 0.729960071608981 | 37.6856398484338 |
| 2034-06-15 | 101.25 | 40.2472527472527 | 0.576018995154059 | 58.3219232593485 | 96.0075631077823 |
This is a bond with an odd long first coupon, also settling on the issue date.
SELECT *
FROM wct.BONDCF( '2014-05-01', --@Settlement
'2034-06-15', --@Maturity
0.0250, --@Rate
0.0276, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
'2014-05-01', --@Issue
'2014-12-15', --@FirstCoupon
NULL --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-05-01 | 0 | 0 | 1 | 0 | 0 |
| 2014-12-15 | 1.55906593406593 | 1.24725274725275 | 0.983050874408643 | 1.53264112974424 | 1.53264112974424 |
| 2015-06-15 | 1.25 | 2.24725274725275 | 0.969669436189231 | 1.21208679523654 | 2.74472792498078 |
| 2015-12-15 | 1.25 | 3.24725274725275 | 0.956470148144833 | 1.19558768518104 | 3.94031561016182 |
| 2016-06-15 | 1.25 | 4.24725274725275 | 0.943450530819523 | 1.1793131635244 | 5.11962877368623 |
| 2016-12-15 | 1.25 | 5.24725274725275 | 0.930608138508111 | 1.16326017313514 | 6.28288894682137 |
| 2017-06-15 | 1.25 | 6.24725274725275 | 0.917940558796717 | 1.1474256984959 | 7.43031464531726 |
| 2017-12-15 | 1.25 | 7.24725274725275 | 0.905445412109604 | 1.131806765137 | 8.56212141045427 |
| 2018-06-15 | 1.25 | 8.24725274725275 | 0.893120351262186 | 1.11640043907773 | 9.678521849532 |
| 2018-12-15 | 1.25 | 9.24725274725275 | 0.880963061020108 | 1.10120382627514 | 10.7797256758071 |
| 2019-06-15 | 1.25 | 10.2472527472527 | 0.86897125766434 | 1.08621407208043 | 11.8659397478876 |
| 2019-12-15 | 1.25 | 11.2472527472527 | 0.857142688562182 | 1.07142836070273 | 12.9373681085903 |
| 2020-06-15 | 1.25 | 12.2472527472527 | 0.845475131744113 | 1.05684391468014 | 13.9942120232704 |
| 2020-12-15 | 1.25 | 13.2472527472527 | 0.833966395486401 | 1.042457994358 | 15.0366700176284 |
| 2021-06-15 | 1.25 | 14.2472527472527 | 0.822614317899389 | 1.02826789737424 | 16.0649379150027 |
| 2021-12-15 | 1.25 | 15.2472527472527 | 0.811416766521394 | 1.01427095815174 | 17.0792088731544 |
| 2022-06-15 | 1.25 | 16.2472527472527 | 0.800371637918124 | 1.00046454739766 | 18.0796734205521 |
| 2022-12-15 | 1.25 | 17.2472527472527 | 0.789476857287556 | 0.986846071609445 | 19.0665194921615 |
| 2023-06-15 | 1.25 | 18.2472527472527 | 0.778730378070187 | 0.973412972587734 | 20.0399324647492 |
| 2023-12-15 | 1.25 | 19.2472527472527 | 0.768130181564596 | 0.960162726955745 | 21.000095191705 |
| 2024-06-15 | 1.25 | 20.2472527472527 | 0.75767427654823 | 0.947092845685288 | 21.9471880373903 |
| 2024-12-15 | 1.25 | 21.2472527472527 | 0.747360698903364 | 0.934200873629205 | 22.8813889110195 |
| 2025-06-15 | 1.25 | 22.2472527472527 | 0.737187511248139 | 0.921484389060174 | 23.8028733000797 |
| 2025-12-15 | 1.25 | 23.2472527472527 | 0.727152802572637 | 0.908941003215796 | 24.7118143032955 |
| 2026-06-15 | 1.25 | 24.2472527472527 | 0.717254687879894 | 0.896568359849868 | 25.6083826631453 |
| 2026-12-15 | 1.25 | 25.2472527472527 | 0.707491307831815 | 0.884364134789769 | 26.4927467979351 |
| 2027-06-15 | 1.25 | 26.2472527472527 | 0.697860828399897 | 0.872326035499871 | 27.365072833435 |
| 2027-12-15 | 1.25 | 27.2472527472527 | 0.688361440520711 | 0.860451800650889 | 28.2255246340859 |
| 2028-06-15 | 1.25 | 28.2472527472527 | 0.678991359756077 | 0.848739199695096 | 29.0742638337809 |
| 2028-12-15 | 1.25 | 29.2472527472527 | 0.669748825957859 | 0.837186032447323 | 29.9114498662283 |
| 2029-06-15 | 1.25 | 30.2472527472527 | 0.660632102937323 | 0.825790128671654 | 30.7372399948999 |
| 2029-12-15 | 1.25 | 31.2472527472527 | 0.651639478139005 | 0.814549347673756 | 31.5517893425737 |
| 2030-06-15 | 1.25 | 32.2472527472527 | 0.642769262319003 | 0.803461577898754 | 32.3552509204724 |
| 2030-12-15 | 1.25 | 33.2472527472527 | 0.634019789227661 | 0.792524736534576 | 33.147775657007 |
| 2031-06-15 | 1.25 | 34.2472527472527 | 0.625389415296568 | 0.781736769120711 | 33.9295124261277 |
| 2031-12-15 | 1.25 | 35.2472527472527 | 0.616876519329817 | 0.771095649162271 | 34.70060807529 |
| 2032-06-15 | 1.25 | 36.2472527472527 | 0.608479502199464 | 0.76059937774933 | 35.4612074530393 |
| 2032-12-15 | 1.25 | 37.2472527472527 | 0.600196786545141 | 0.750245983181427 | 36.2114534362208 |
| 2033-06-15 | 1.25 | 38.2472527472527 | 0.592026816477748 | 0.740033520597185 | 36.9514869568179 |
| 2033-12-15 | 1.25 | 39.2472527472527 | 0.583968057287185 | 0.729960071608981 | 37.6814470284269 |
| 2034-06-15 | 101.25 | 40.2472527472527 | 0.576018995154059 | 58.3219232593485 | 96.0033702877754 |
In this example, the settlement date of the bond is after the issue date and the coupon payments are due on the 30th of March and the 30th of September.
SELECT *
FROM wct.BONDCF( '2014-03-15', --@Settlement
'2034-09-30', --@Maturity
0.0257, --@Rate
0.0269, --@Yield
100, --@Redemption
2, --@Frequency
11, --@Basis
'2014-03-01', --@Issue
'2014-03-30', --@FirstCoupon
NULL --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-03-15 | -0.0993922651933702 | 0 | 1 | -0.0993922651933702 | -0.0993922651933702 |
| 2014-03-30 | 0.205883977900552 | 0.0828729281767956 | 0.998893401265451 | 0.205656146951144 | 0.106263881757774 |
| 2014-09-30 | 1.285 | 1.0828729281768 | 0.985636589141498 | 1.26654301704682 | 1.3728068988046 |
| 2015-03-30 | 1.285 | 2.0828729281768 | 0.972555714777737 | 1.24973409348939 | 2.62254099229399 |
| 2015-09-30 | 1.285 | 3.0828729281768 | 0.959648443216476 | 1.23314824953317 | 3.85568924182716 |
| 2016-03-30 | 1.285 | 4.0828729281768 | 0.946912470488407 | 1.2167825245776 | 5.07247176640476 |
| 2016-09-30 | 1.285 | 5.0828729281768 | 0.934345523201348 | 1.20063399731373 | 6.2731057637185 |
| 2017-03-30 | 1.285 | 6.0828729281768 | 0.92194535813444 | 1.18469978520276 | 7.45780554892125 |
| 2017-09-30 | 1.285 | 7.0828729281768 | 0.909709761837723 | 1.16897704396147 | 8.62678259288273 |
| 2018-03-30 | 1.285 | 8.0828729281768 | 0.897636550237035 | 1.15346296705459 | 9.78024555993732 |
| 2018-09-30 | 1.285 | 9.0828729281768 | 0.885723568244151 | 1.13815478519373 | 10.9184003451311 |
| 2019-03-30 | 1.285 | 10.0828729281768 | 0.873968689372096 | 1.12304976584314 | 12.0414501109742 |
| 2019-09-30 | 1.285 | 11.0828729281768 | 0.862369815355564 | 1.1081452127319 | 13.1495953237061 |
| 2020-03-30 | 1.285 | 12.0828729281768 | 0.850924875776372 | 1.09343846537264 | 14.2430337890787 |
| 2020-09-30 | 1.285 | 13.0828729281768 | 0.839631827693889 | 1.07892689858665 | 15.3219606876654 |
| 2021-03-30 | 1.285 | 14.0828729281768 | 0.828488655280368 | 1.06460792203527 | 16.3865686097007 |
| 2021-09-30 | 1.285 | 15.0828729281768 | 0.817493369461116 | 1.05047897975753 | 17.4370475894582 |
| 2022-03-30 | 1.285 | 16.0828729281768 | 0.806644007559442 | 1.03653754971388 | 18.4735851391721 |
| 2022-09-30 | 1.285 | 17.0828729281768 | 0.795938632946314 | 1.02278114333601 | 19.4963662825081 |
| 2023-03-30 | 1.285 | 18.0828729281768 | 0.78537533469467 | 1.00920730508265 | 20.5055735875907 |
| 2023-09-30 | 1.285 | 19.0828729281768 | 0.774952227238315 | 0.995813612001235 | 21.501387199592 |
| 2024-03-30 | 1.285 | 20.0828729281768 | 0.76466745003534 | 0.982597673295412 | 22.4839848728874 |
| 2024-09-30 | 1.285 | 21.0828729281768 | 0.754519167236015 | 0.96955712989828 | 23.4535420027857 |
| 2025-03-30 | 1.285 | 22.0828729281768 | 0.744505567355089 | 0.95668965405129 | 24.410231656837 |
| 2025-09-30 | 1.285 | 23.0828729281768 | 0.734624862948433 | 0.943992948888737 | 25.3542246057257 |
| 2026-03-30 | 1.285 | 24.0828729281768 | 0.724875290293979 | 0.931464748027763 | 26.2856893537535 |
| 2026-09-30 | 1.285 | 25.0828729281768 | 0.715255109076895 | 0.91910281516381 | 27.2047921689173 |
| 2027-03-30 | 1.285 | 26.0828729281768 | 0.705762602078933 | 0.906904943671429 | 28.1116971125887 |
| 2027-09-30 | 1.285 | 27.0828729281768 | 0.696396074871906 | 0.894868956210399 | 29.0065660687991 |
| 2028-03-30 | 1.285 | 28.0828729281768 | 0.687153855515226 | 0.882992704337066 | 29.8895587731362 |
| 2028-09-30 | 1.285 | 29.0828729281768 | 0.678034294257463 | 0.87127406812084 | 30.760832841257 |
| 2029-03-30 | 1.285 | 30.0828729281768 | 0.66903576324186 | 0.859710955765791 | 31.6205437970228 |
| 2029-09-30 | 1.285 | 31.0828729281768 | 0.660156656215758 | 0.84830130323725 | 32.46884510026 |
| 2030-03-30 | 1.285 | 32.0828729281768 | 0.651395388243878 | 0.837043073893384 | 33.3058881741534 |
| 2030-09-30 | 1.285 | 33.0828729281768 | 0.642750395425406 | 0.825934258121647 | 34.1318224322751 |
| 2031-03-30 | 1.285 | 34.0828729281768 | 0.634220134614837 | 0.814972872980066 | 34.9467953052551 |
| 2031-09-30 | 1.285 | 35.0828729281768 | 0.625803083146516 | 0.804156961843274 | 35.7509522670984 |
| 2032-03-30 | 1.285 | 36.0828729281768 | 0.617497738562846 | 0.793484594053257 | 36.5444368611517 |
| 2032-09-30 | 1.285 | 37.0828729281768 | 0.609302618346091 | 0.782953864574727 | 37.3273907257264 |
| 2033-03-30 | 1.285 | 38.0828729281768 | 0.601216259653748 | 0.772562893655067 | 38.0999536193815 |
| 2033-09-30 | 1.285 | 39.0828729281768 | 0.593237219057426 | 0.762309826488792 | 38.8622634458703 |
| 2034-03-30 | 1.285 | 40.0828729281768 | 0.58536407228519 | 0.752192832886469 | 39.6144562787567 |
| 2034-09-30 | 101.285 | 41.0828729281768 | 0.57759541396733 | 58.501751503681 | 98.1162077824377 |
This is an example of bond paying interest every 26 weeks.
SELECT *
FROM wct.BONDCF( '2014-10-04', --@Settlement
'2029-12-12', --@Maturity
0.1250, --@Rate
0.1100, --@Yield
100, --@Redemption
182, --@Frequency
9, --@Basis
'2014-03-26', --@Issue
'2014-12-31', --@FirstCoupon
NULL --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-10-04 | -6.59340659340659 | 0 | 1 | -6.59340659340659 | -6.59340659340659 |
| 2014-12-31 | 9.61538461538462 | 0.483516483516484 | 0.974444373896921 | 9.36965744131655 | 2.77625084790996 |
| 2015-07-01 | 6.25 | 1.48351648351648 | 0.923643956300399 | 5.7727747268775 | 8.54902557478745 |
| 2015-12-30 | 6.25 | 2.48351648351648 | 0.87549190170654 | 5.47182438566587 | 14.0208499604533 |
| 2016-06-29 | 6.25 | 3.48351648351648 | 0.829850143797668 | 5.18656339873542 | 19.2074133591887 |
| 2016-12-28 | 6.25 | 4.48351648351648 | 0.786587814026226 | 4.91617383766391 | 24.1235871968527 |
| 2017-06-28 | 6.25 | 5.48351648351648 | 0.745580866375569 | 4.65988041484731 | 28.7834676117 |
| 2017-12-27 | 6.25 | 6.48351648351648 | 0.706711721683004 | 4.41694826051878 | 33.2004158722187 |
| 2018-06-27 | 6.25 | 7.48351648351648 | 0.669868930505217 | 4.18668081565761 | 37.3870966878764 |
| 2018-12-26 | 6.25 | 8.48351648351648 | 0.634946853559448 | 3.96841783474655 | 41.3555145226229 |
| 2019-06-26 | 6.25 | 9.48351648351648 | 0.601845358824121 | 3.76153349265076 | 45.1170480152737 |
| 2019-12-25 | 6.25 | 10.4835164835165 | 0.570469534430446 | 3.56543459019029 | 48.6824826054639 |
| 2020-06-24 | 6.25 | 11.4835164835165 | 0.54072941652175 | 3.37955885326094 | 52.0620414587249 |
| 2020-12-23 | 6.25 | 12.4835164835165 | 0.512539731300237 | 3.20337332062648 | 55.2654147793514 |
| 2021-06-23 | 6.25 | 13.4835164835165 | 0.485819650521552 | 3.0363728157597 | 58.3017875951111 |
| 2021-12-22 | 6.25 | 14.4835164835165 | 0.460492559736068 | 2.87807849835043 | 61.1798660934615 |
| 2022-06-22 | 6.25 | 15.4835164835165 | 0.436485838612387 | 2.72803649132742 | 63.9079025847889 |
| 2022-12-21 | 6.25 | 16.4835164835165 | 0.413730652713163 | 2.58581657945727 | 66.4937191642462 |
| 2023-06-21 | 6.25 | 17.4835164835165 | 0.392161756126221 | 2.45101097578888 | 68.944730140035 |
| 2023-12-20 | 6.25 | 18.4835164835165 | 0.371717304385043 | 2.32323315240652 | 71.2679632924416 |
| 2024-06-19 | 6.25 | 19.4835164835165 | 0.352338677142221 | 2.20211673213888 | 73.4700800245804 |
| 2024-12-18 | 6.25 | 20.4835164835165 | 0.333970310087414 | 2.08731443804633 | 75.5573944626268 |
| 2025-06-18 | 6.25 | 21.4835164835165 | 0.31655953562788 | 1.97849709767425 | 77.535891560301 |
| 2025-12-17 | 6.25 | 22.4835164835165 | 0.300056431874768 | 1.8753526992173 | 79.4112442595183 |
| 2026-06-17 | 6.25 | 23.4835164835165 | 0.28441367950215 | 1.77758549688844 | 81.1888297564068 |
| 2026-12-16 | 6.25 | 24.4835164835165 | 0.269586426068388 | 1.68491516292743 | 82.8737449193342 |
| 2027-06-16 | 6.25 | 25.4835164835165 | 0.255532157410795 | 1.59707598381747 | 84.4708209031516 |
| 2027-12-15 | 6.25 | 26.4835164835165 | 0.242210575744829 | 1.51381609840518 | 85.9846370015568 |
| 2028-06-14 | 6.25 | 27.4835164835165 | 0.229583484118321 | 1.43489677573951 | 87.4195337772963 |
| 2028-12-13 | 6.25 | 28.4835164835165 | 0.217614676889404 | 1.36009173055878 | 88.7796255078551 |
| 2029-06-13 | 6.25 | 29.4835164835165 | 0.206269835914127 | 1.28918647446329 | 90.0688119823184 |
| 2029-12-12 | 106.25 | 30.4835164835165 | 0.195516432146092 | 20.7736209155223 | 110.842432897841 |
This is a bond with an odd short last coupon settling in the last coupon period.
SELECT *
FROM wct.BONDCF( '2014-10-01', --@Settlement
'2014-12-15', --@Maturity
0.0225, --@Rate
0.0010, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
'2014-09-15' --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-10-01 | -0.0994475138121547 | 0 | 1 | -0.0994475138121547 | -0.0994475138121547 |
| 2014-12-15 | 100.565607734807 | 0.414364640883978 | 0.999792860595181 | 100.544776634675 | 100.445329120863 |
This is a bond with an odd long last coupon settling in the final period.
SELECT *
FROM wct.BONDCF( '2014-10-01', --@Settlement
'2014-12-15', --@Maturity
0.0225, --@Rate
0.0010, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
'2014-03-15' --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-10-01 | -1.22444751381215 | 0 | 1 | -1.22444751381215 | -1.22444751381215 |
| 2014-12-15 | 101.690607734807 | 0.414364640883978 | 0.999792860595181 | 101.669543602845 | 100.445096089033 |
This is a bond with an odd short last coupon settling before the last coupon date.
SELECT *
FROM wct.BONDCF( '2014-10-01', --@Settlement
'2034-12-15', --@Maturity
0.0425, --@Rate
0.0400, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
'2034-09-15' --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-10-01 | -0.187845303867403 | 0 | 1 | -0.187845303867403 | -0.187845303867403 |
| 2015-03-15 | 2.125 | 0.911602209944751 | 0.982109844632016 | 2.08698341984303 | 1.89913811597563 |
| 2015-09-15 | 2.125 | 1.91160220994475 | 0.962852788854918 | 2.0460621763167 | 3.94520029229233 |
| 2016-03-15 | 2.125 | 2.91160220994475 | 0.943973322406782 | 2.00594331011441 | 5.95114360240675 |
| 2016-09-15 | 2.125 | 3.91160220994475 | 0.925464041575277 | 1.96661108834746 | 7.91775469075421 |
| 2017-03-15 | 2.125 | 4.91160220994475 | 0.907317687818899 | 1.92805008661516 | 9.84580477736937 |
| 2017-09-15 | 2.125 | 5.91160220994475 | 0.889527144920489 | 1.89024518295604 | 11.7360499603254 |
| 2018-03-15 | 2.125 | 6.91160220994475 | 0.872085436196558 | 1.85318155191769 | 13.5892315122431 |
| 2018-09-15 | 2.125 | 7.91160220994475 | 0.854985721761331 | 1.81684465874283 | 15.4060761709859 |
| 2019-03-15 | 2.125 | 8.91160220994475 | 0.838221295844442 | 1.78122025366944 | 17.1872964246554 |
| 2019-09-15 | 2.125 | 9.91160220994475 | 0.821785584161218 | 1.74629436634259 | 18.933590790998 |
| 2020-03-15 | 2.125 | 10.9116022099448 | 0.805672141334527 | 1.71205330033587 | 20.6456440913338 |
| 2020-09-15 | 2.125 | 11.9116022099448 | 0.789874648367184 | 1.67848362778027 | 22.3241277191141 |
| 2021-03-15 | 2.125 | 12.9116022099448 | 0.774386910163905 | 1.6455721840983 | 23.9696999032124 |
| 2021-09-15 | 2.125 | 13.9116022099448 | 0.759202853101868 | 1.61330606284147 | 25.5830059660539 |
| 2022-03-15 | 2.125 | 14.9116022099448 | 0.74431652264889 | 1.58167261062889 | 27.1646785766828 |
| 2022-09-15 | 2.125 | 15.9116022099448 | 0.729722081028324 | 1.55065942218519 | 28.7153379988679 |
| 2023-03-15 | 2.125 | 16.9116022099448 | 0.715413804929729 | 1.52025433547567 | 30.2355923343436 |
| 2023-09-15 | 2.125 | 17.9116022099448 | 0.70138608326444 | 1.49044542693694 | 31.7260377612805 |
| 2024-03-15 | 2.125 | 18.9116022099448 | 0.687633414965137 | 1.46122100680092 | 33.1872587680815 |
| 2024-09-15 | 2.125 | 19.9116022099448 | 0.674150406828566 | 1.4325696145107 | 34.6198283825922 |
| 2025-03-15 | 2.125 | 20.9116022099448 | 0.660931771400555 | 1.40448001422618 | 36.0243083968183 |
| 2025-09-15 | 2.125 | 21.9116022099448 | 0.647972324902505 | 1.37694119041782 | 37.4012495872362 |
| 2026-03-15 | 2.125 | 22.9116022099448 | 0.635266985198534 | 1.34994234354688 | 38.7511919307831 |
| 2026-09-15 | 2.125 | 23.9116022099448 | 0.622810769802484 | 1.32347288583028 | 40.0746648166133 |
| 2027-03-15 | 2.125 | 24.9116022099448 | 0.610598793924004 | 1.29752243708851 | 41.3721872537018 |
| 2027-09-15 | 2.125 | 25.9116022099448 | 0.598626268552945 | 1.27208082067501 | 42.6442680743769 |
| 2028-03-15 | 2.125 | 26.9116022099448 | 0.586888498581319 | 1.2471380594853 | 43.8914061338622 |
| 2028-09-15 | 2.125 | 27.9116022099448 | 0.575380880962077 | 1.22268437204441 | 45.1140905059066 |
| 2029-03-15 | 2.125 | 28.9116022099448 | 0.564098902903997 | 1.19871016867099 | 46.3128006745776 |
| 2029-09-15 | 2.125 | 29.9116022099448 | 0.553038140101958 | 1.17520604771666 | 47.4880067222942 |
| 2030-03-15 | 2.125 | 30.9116022099448 | 0.54219425500192 | 1.15216279187908 | 48.6401695141733 |
| 2030-09-15 | 2.125 | 31.9116022099448 | 0.531562995099921 | 1.12957136458733 | 49.7697408787606 |
| 2031-03-15 | 2.125 | 32.9116022099448 | 0.521140191274433 | 1.10742290645817 | 50.8771637852188 |
| 2031-09-15 | 2.125 | 33.9116022099448 | 0.510921756151405 | 1.08570873182173 | 51.9628725170405 |
| 2032-03-15 | 2.125 | 34.9116022099448 | 0.500903682501377 | 1.06442032531543 | 53.027292842356 |
| 2032-09-15 | 2.125 | 35.9116022099448 | 0.491082041668017 | 1.04354933854454 | 54.0708421809005 |
| 2033-03-15 | 2.125 | 36.9116022099448 | 0.481452982027467 | 1.02308758680837 | 55.0939297677089 |
| 2033-09-15 | 2.125 | 37.9116022099448 | 0.472012727477909 | 1.00302704589056 | 56.0969568135994 |
| 2034-03-15 | 2.125 | 38.9116022099448 | 0.462757575958734 | 0.98335984891231 | 57.0803166625117 |
| 2034-09-15 | 2.125 | 39.9116022099448 | 0.453683897998759 | 0.964078283247363 | 58.0443949457591 |
| 2034-12-15 | 101.068370165746 | 40.414364640884 | 0.449189424035058 | 45.3988429829134 | 103.443237928672 |
This is a bond with an odd long last coupon settling before the last coupon date.
SELECT *
FROM wct.BONDCF( '2014-10-01', --@Settlement
'2034-12-15', --@Maturity
0.0425, --@Rate
0.0400, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
NULL, --@Issue
NULL, --@FirstCoupon
'2034-03-15' --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2014-10-01 | -0.187845303867403 | 0 | 1 | -0.187845303867403 | -0.187845303867403 |
| 2015-03-15 | 2.125 | 0.911602209944751 | 0.982109844632016 | 2.08698341984303 | 1.89913811597563 |
| 2015-09-15 | 2.125 | 1.91160220994475 | 0.962852788854918 | 2.0460621763167 | 3.94520029229233 |
| 2016-03-15 | 2.125 | 2.91160220994475 | 0.943973322406782 | 2.00594331011441 | 5.95114360240675 |
| 2016-09-15 | 2.125 | 3.91160220994475 | 0.925464041575277 | 1.96661108834746 | 7.91775469075421 |
| 2017-03-15 | 2.125 | 4.91160220994475 | 0.907317687818899 | 1.92805008661516 | 9.84580477736937 |
| 2017-09-15 | 2.125 | 5.91160220994475 | 0.889527144920489 | 1.89024518295604 | 11.7360499603254 |
| 2018-03-15 | 2.125 | 6.91160220994475 | 0.872085436196558 | 1.85318155191769 | 13.5892315122431 |
| 2018-09-15 | 2.125 | 7.91160220994475 | 0.854985721761331 | 1.81684465874283 | 15.4060761709859 |
| 2019-03-15 | 2.125 | 8.91160220994475 | 0.838221295844442 | 1.78122025366944 | 17.1872964246554 |
| 2019-09-15 | 2.125 | 9.91160220994475 | 0.821785584161218 | 1.74629436634259 | 18.933590790998 |
| 2020-03-15 | 2.125 | 10.9116022099448 | 0.805672141334527 | 1.71205330033587 | 20.6456440913338 |
| 2020-09-15 | 2.125 | 11.9116022099448 | 0.789874648367184 | 1.67848362778027 | 22.3241277191141 |
| 2021-03-15 | 2.125 | 12.9116022099448 | 0.774386910163905 | 1.6455721840983 | 23.9696999032124 |
| 2021-09-15 | 2.125 | 13.9116022099448 | 0.759202853101868 | 1.61330606284147 | 25.5830059660539 |
| 2022-03-15 | 2.125 | 14.9116022099448 | 0.74431652264889 | 1.58167261062889 | 27.1646785766828 |
| 2022-09-15 | 2.125 | 15.9116022099448 | 0.729722081028324 | 1.55065942218519 | 28.7153379988679 |
| 2023-03-15 | 2.125 | 16.9116022099448 | 0.715413804929729 | 1.52025433547567 | 30.2355923343436 |
| 2023-09-15 | 2.125 | 17.9116022099448 | 0.70138608326444 | 1.49044542693694 | 31.7260377612805 |
| 2024-03-15 | 2.125 | 18.9116022099448 | 0.687633414965137 | 1.46122100680092 | 33.1872587680815 |
| 2024-09-15 | 2.125 | 19.9116022099448 | 0.674150406828566 | 1.4325696145107 | 34.6198283825922 |
| 2025-03-15 | 2.125 | 20.9116022099448 | 0.660931771400555 | 1.40448001422618 | 36.0243083968183 |
| 2025-09-15 | 2.125 | 21.9116022099448 | 0.647972324902505 | 1.37694119041782 | 37.4012495872362 |
| 2026-03-15 | 2.125 | 22.9116022099448 | 0.635266985198534 | 1.34994234354688 | 38.7511919307831 |
| 2026-09-15 | 2.125 | 23.9116022099448 | 0.622810769802484 | 1.32347288583028 | 40.0746648166133 |
| 2027-03-15 | 2.125 | 24.9116022099448 | 0.610598793924004 | 1.29752243708851 | 41.3721872537018 |
| 2027-09-15 | 2.125 | 25.9116022099448 | 0.598626268552945 | 1.27208082067501 | 42.6442680743769 |
| 2028-03-15 | 2.125 | 26.9116022099448 | 0.586888498581319 | 1.2471380594853 | 43.8914061338622 |
| 2028-09-15 | 2.125 | 27.9116022099448 | 0.575380880962077 | 1.22268437204441 | 45.1140905059066 |
| 2029-03-15 | 2.125 | 28.9116022099448 | 0.564098902903997 | 1.19871016867099 | 46.3128006745776 |
| 2029-09-15 | 2.125 | 29.9116022099448 | 0.553038140101958 | 1.17520604771666 | 47.4880067222942 |
| 2030-03-15 | 2.125 | 30.9116022099448 | 0.54219425500192 | 1.15216279187908 | 48.6401695141733 |
| 2030-09-15 | 2.125 | 31.9116022099448 | 0.531562995099921 | 1.12957136458733 | 49.7697408787606 |
| 2031-03-15 | 2.125 | 32.9116022099448 | 0.521140191274433 | 1.10742290645817 | 50.8771637852188 |
| 2031-09-15 | 2.125 | 33.9116022099448 | 0.510921756151405 | 1.08570873182173 | 51.9628725170405 |
| 2032-03-15 | 2.125 | 34.9116022099448 | 0.500903682501377 | 1.06442032531543 | 53.027292842356 |
| 2032-09-15 | 2.125 | 35.9116022099448 | 0.491082041668017 | 1.04354933854454 | 54.0708421809005 |
| 2033-03-15 | 2.125 | 36.9116022099448 | 0.481452982027467 | 1.02308758680837 | 55.0939297677089 |
| 2033-09-15 | 2.125 | 37.9116022099448 | 0.472012727477909 | 1.00302704589056 | 56.0969568135994 |
| 2034-03-15 | 2.125 | 38.9116022099448 | 0.462757575958734 | 0.98335984891231 | 57.0803166625117 |
| 2034-12-15 | 103.193370165746 | 40.414364640884 | 0.449189424035058 | 46.3533705089879 | 103.4336871715 |
This is a bond with an odd long first coupon and an odd long last coupon.
SELECT *
FROM wct.BONDCF( '2013-03-04', --@Settlement
'2022-11-28', --@Maturity
0.03125, --@Rate
0.02875, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
'2012-06-07', --@Issue
'2013-03-15', --@FirstCoupon
'2022-03-15' --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2013-03-04 | -2.31672621907278 | 0 | 1 | -2.31672621907278 | -2.31672621907278 |
| 2013-03-15 | 2.4116847826087 | 0.0607734806629834 | 0.999132976898755 | 2.40959379618925 | 0.0928675771164698 |
| 2013-09-15 | 1.5625 | 1.06077348066298 | 0.984973975993844 | 1.53902183749038 | 1.63188941460685 |
| 2014-03-15 | 1.5625 | 2.06077348066298 | 0.971015626364849 | 1.51721191619508 | 3.14910133080193 |
| 2014-09-15 | 1.5625 | 3.06077348066298 | 0.957255084524805 | 1.49571106957001 | 4.64481240037193 |
| 2015-03-15 | 1.5625 | 4.06077348066298 | 0.943689547282617 | 1.47451491762909 | 6.11932731800102 |
| 2015-09-15 | 1.5625 | 5.06077348066298 | 0.930316251172019 | 1.45361914245628 | 7.5729464604573 |
| 2016-03-15 | 1.5625 | 6.06077348066298 | 0.91713247188862 | 1.43301948732597 | 9.00596594778327 |
| 2016-09-15 | 1.5625 | 7.06077348066298 | 0.904135523734931 | 1.41271175583583 | 10.4186777036191 |
| 2017-03-15 | 1.5625 | 8.06077348066298 | 0.891322759073253 | 1.39269181105196 | 11.8113695146711 |
| 2017-09-15 | 1.5625 | 9.06077348066298 | 0.878691567786324 | 1.37295557466613 | 13.1843250893372 |
| 2018-03-15 | 1.5625 | 10.060773480663 | 0.866239376745606 | 1.35349902616501 | 14.5378241155022 |
| 2018-09-15 | 1.5625 | 11.060773480663 | 0.853963649287104 | 1.3343182020111 | 15.8721423175133 |
| 2019-03-15 | 1.5625 | 12.060773480663 | 0.841861884694619 | 1.31540919483534 | 17.1875515123486 |
| 2019-09-15 | 1.5625 | 13.060773480663 | 0.829931617690321 | 1.29676815264113 | 18.4843196649898 |
| 2020-03-15 | 1.5625 | 14.060773480663 | 0.81817041793254 | 1.27839127801959 | 19.7627109430094 |
| 2020-09-15 | 1.5625 | 15.060773480663 | 0.80657588952068 | 1.26027482737606 | 21.0229857703854 |
| 2021-03-15 | 1.5625 | 16.060773480663 | 0.79514567050714 | 1.24241511016741 | 22.2654008805528 |
| 2021-09-15 | 1.5625 | 17.060773480663 | 0.783877432416158 | 1.22480848815025 | 23.4902093687031 |
| 2022-03-15 | 1.5625 | 18.060773480663 | 0.772768879769472 | 1.2074513746398 | 24.6976607433429 |
| 2022-11-28 | 102.201312154696 | 19.4696132596685 | 0.757385311895596 | 77.4057726824236 | 102.103433425767 |
This is a bond with an odd long first coupon and an odd short last coupon.
SELECT *
FROM wct.BONDCF( '2013-03-04', --@Settlement
'2022-04-28', --@Maturity
0.03125, --@Rate
0.02875, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
'2012-06-07', --@Issue
'2013-03-15', --@FirstCoupon
'2022-03-15' --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2013-03-04 | -2.31672621907278 | 0 | 1 | -2.31672621907278 | -2.31672621907278 |
| 2013-03-15 | 2.4116847826087 | 0.0607734806629834 | 0.999132976898755 | 2.40959379618925 | 0.0928675771164698 |
| 2013-09-15 | 1.5625 | 1.06077348066298 | 0.984973975993844 | 1.53902183749038 | 1.63188941460685 |
| 2014-03-15 | 1.5625 | 2.06077348066298 | 0.971015626364849 | 1.51721191619508 | 3.14910133080193 |
| 2014-09-15 | 1.5625 | 3.06077348066298 | 0.957255084524805 | 1.49571106957001 | 4.64481240037193 |
| 2015-03-15 | 1.5625 | 4.06077348066298 | 0.943689547282617 | 1.47451491762909 | 6.11932731800102 |
| 2015-09-15 | 1.5625 | 5.06077348066298 | 0.930316251172019 | 1.45361914245628 | 7.5729464604573 |
| 2016-03-15 | 1.5625 | 6.06077348066298 | 0.91713247188862 | 1.43301948732597 | 9.00596594778327 |
| 2016-09-15 | 1.5625 | 7.06077348066298 | 0.904135523734931 | 1.41271175583583 | 10.4186777036191 |
| 2017-03-15 | 1.5625 | 8.06077348066298 | 0.891322759073253 | 1.39269181105196 | 11.8113695146711 |
| 2017-09-15 | 1.5625 | 9.06077348066298 | 0.878691567786324 | 1.37295557466613 | 13.1843250893372 |
| 2018-03-15 | 1.5625 | 10.060773480663 | 0.866239376745606 | 1.35349902616501 | 14.5378241155022 |
| 2018-09-15 | 1.5625 | 11.060773480663 | 0.853963649287104 | 1.3343182020111 | 15.8721423175133 |
| 2019-03-15 | 1.5625 | 12.060773480663 | 0.841861884694619 | 1.31540919483534 | 17.1875515123486 |
| 2019-09-15 | 1.5625 | 13.060773480663 | 0.829931617690321 | 1.29676815264113 | 18.4843196649898 |
| 2020-03-15 | 1.5625 | 14.060773480663 | 0.81817041793254 | 1.27839127801959 | 19.7627109430094 |
| 2020-09-15 | 1.5625 | 15.060773480663 | 0.80657588952068 | 1.26027482737606 | 21.0229857703854 |
| 2021-03-15 | 1.5625 | 16.060773480663 | 0.79514567050714 | 1.24241511016741 | 22.2654008805528 |
| 2021-09-15 | 1.5625 | 17.060773480663 | 0.783877432416158 | 1.22480848815025 | 23.4902093687031 |
| 2022-03-15 | 1.5625 | 18.060773480663 | 0.772768879769472 | 1.2074513746398 | 24.6976607433429 |
| 2022-04-28 | 100.373641304348 | 18.2999039154456 | 0.770135894328887 | 77.3013440129708 | 101.999004756314 |
This is a bond with an odd short first coupon and an odd long last coupon.
SELECT *
FROM wct.BONDCF( '2013-03-04', --@Settlement
'2022-11-28', --@Maturity
0.03125, --@Rate
0.02875, --@Yield
100, --@Redemption
2, --@Frequency
1, --@Basis
'2012-12-07', --@Issue
'2013-03-15', --@FirstCoupon
'2022-03-15' --@LastCoupon
);
This produces the following result.
| date_pmt | amt_cashflow | N | PVF | PVCF | cumPVCF |
|---|---|---|---|---|---|
| 2013-03-04 | -0.75103591160221 | 0 | 1 | -0.75103591160221 | -0.75103591160221 |
| 2013-03-15 | 0.845994475138122 | 0.0607734806629834 | 0.999132976898755 | 0.845260978384651 | 0.0942250667824414 |
| 2013-09-15 | 1.5625 | 1.06077348066298 | 0.984973975993844 | 1.53902183749038 | 1.63324690427282 |
| 2014-03-15 | 1.5625 | 2.06077348066298 | 0.971015626364849 | 1.51721191619508 | 3.1504588204679 |
| 2014-09-15 | 1.5625 | 3.06077348066298 | 0.957255084524805 | 1.49571106957001 | 4.64616989003791 |
| 2015-03-15 | 1.5625 | 4.06077348066298 | 0.943689547282617 | 1.47451491762909 | 6.120684807667 |
| 2015-09-15 | 1.5625 | 5.06077348066298 | 0.930316251172019 | 1.45361914245628 | 7.57430395012328 |
| 2016-03-15 | 1.5625 | 6.06077348066298 | 0.91713247188862 | 1.43301948732597 | 9.00732343744924 |
| 2016-09-15 | 1.5625 | 7.06077348066298 | 0.904135523734931 | 1.41271175583583 | 10.4200351932851 |
| 2017-03-15 | 1.5625 | 8.06077348066298 | 0.891322759073253 | 1.39269181105196 | 11.812727004337 |
| 2017-09-15 | 1.5625 | 9.06077348066298 | 0.878691567786324 | 1.37295557466613 | 13.1856825790032 |
| 2018-03-15 | 1.5625 | 10.060773480663 | 0.866239376745606 | 1.35349902616501 | 14.5391816051682 |
| 2018-09-15 | 1.5625 | 11.060773480663 | 0.853963649287104 | 1.3343182020111 | 15.8734998071793 |
| 2019-03-15 | 1.5625 | 12.060773480663 | 0.841861884694619 | 1.31540919483534 | 17.1889090020146 |
| 2019-09-15 | 1.5625 | 13.060773480663 | 0.829931617690321 | 1.29676815264113 | 18.4856771546557 |
| 2020-03-15 | 1.5625 | 14.060773480663 | 0.81817041793254 | 1.27839127801959 | 19.7640684326753 |
| 2020-09-15 | 1.5625 | 15.060773480663 | 0.80657588952068 | 1.26027482737606 | 21.0243432600514 |
| 2021-03-15 | 1.5625 | 16.060773480663 | 0.79514567050714 | 1.24241511016741 | 22.2667583702188 |
| 2021-09-15 | 1.5625 | 17.060773480663 | 0.783877432416158 | 1.22480848815025 | 23.491566858369 |
| 2022-03-15 | 1.5625 | 18.060773480663 | 0.772768879769472 | 1.2074513746398 | 24.6990182330088 |
| 2022-11-28 | 102.201312154696 | 19.4696132596685 | 0.757385311895596 | 77.4057726824236 | 102.104790915432 |
See Also
BONDINT - Accrued interest on a bond paying regular, periodic interest
ODDFINT - Accrued interest for a bond with an odd first coupon
ODDFPRICE - Price of a security with an odd first coupon
ODDFYIELD - Calculate the YIELD with an odd first period
ODDLINT - Accrued interest for a bond with an odd last coupon
ODDLPRICE - Price of a bond with an odd last coupon
ODDLYIELD - Calculate the YIELD with an odd last period
OFLPRICE - Price of a security with an odd last coupon.
OFLYIELD - Yield of a bond with an odd first and an odd last coupon