OFLFACTORS
Updated 2023-10-06 20:56:56.480000
Syntax
SELECT * FROM [westclintech].[wct].[OFLFACTORS](
<@Settlement, datetime,>
,<@Maturity, datetime,>
,<@Issue, datetime,>
,<@FirstCoupon, datetime,>
,<@LastCoupon, datetime,>
,<@Rate, float,>
,<@Price, float,>
,<@Yield, float,>
,<@Redemption, float,>
,<@Frequency, float,>
,<@Basis, nvarchar(4000),>)
Description
Use the table-valued function OFLFACTORS to return the components used in the calculation of price and yield for a bond with an odd first and odd last coupon. OFLFACTORS supports odd first and odd last coupon bonds with up to 2 quasi-coupon periods each.
Arguments
@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.
@Basis
is the type of day count to use. @Basis is an expression of the character string data type category.
{"columns":[{"field":"@Basis","width":313},{"field":"Day count basis","width":277}],"rows":[{"@Basis":"0 , 'BOND'","Day count basis":"US (NASD) 30/360"},{"@Basis":"1 , 'ACTUAL'","Day count basis":"Actual/Actual"},{"@Basis":"2 , 'A360'","Day count basis":"Actual/360"},{"@Basis":"3 , 'A365'","Day count basis":"Actual/365"},{"@Basis":"4 , '30E/360 (ISDA)' , '30E/360' , 'ISDA' , '30E/360 ISDA' , 'EBOND'","Day count basis":"European 30/360"},{"@Basis":"5 , '30/360' , '30/360 ISDA' , 'GERMAN'","Day count basis":"30/360 ISDA"},{"@Basis":"6 , 'NL/ACT'","Day count basis":"No Leap Year/ACT"},{"@Basis":"7 , 'NL/365'","Day count basis":"No Leap Year /365"},{"@Basis":"8 , 'NL/360'","Day count basis":"No Leap Year /360"},{"@Basis":"9 , 'A/364'","Day count basis":"Actual/364"},{"@Basis":"10 , 'BOND NON-EOM'","Day count basis":"US (NASD) 30/360 non-end-of-month"},{"@Basis":"11 , 'ACTUAL NON-EOM'","Day count basis":"Actual/Actual non-end-of-month"},{"@Basis":"12 , 'A360 NON-EOM'","Day count basis":"Actual/360 non-end-of-month"},{"@Basis":"13 , 'A365 NON-EOM'","Day count basis":"Actual/365 non-end-of-month"},{"@Basis":"14 , '30E/360 NON-EOM' , '30E/360 ICMA NON-EOM' , 'EBOND NON-EOM'","Day count basis":"European 30/360 non-end-of-month"},{"@Basis":"15 , '30/360 NON-EOM' , '30/360 ISDA NON-EOM' , 'GERMAN NON-EOM'","Day count basis":"30/360 ISDA non-end-of-month"},{"@Basis":"16 , 'NL/ACT NON-EOM'","Day count basis":"No Leap Year/ACT non-end-of-month"},{"@Basis":"17 , 'NL/365 NON-EOM'","Day count basis":"No Leap Year/365 non-end-of-month"},{"@Basis":"18 , 'NL/360 NON-EOM'","Day count basis":"No Leap Year/360 non-end-of-month"},{"@Basis":"19 , 'A/364 NON-EOM'","Day count basis":"Actual/364 non-end-of-month"}]}
@Frequency
the number of coupon payments per year. For annual payments, @Frequency = 1; for semi-annual, @Frequency = 2; for quarterly, @Frequency = 4; for bimonthly @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.
@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. @Yld 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.
@Issue
the issue date of the bond; the date from which the bond starts accruing interest. @Issue is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@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.
@Price
the price of the bond. @Price is an expression of type float or of a type that can be implicitly converted to float.
@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
table
{"columns": [{"field": "colName", "headerName": "Name", "header": "name"}, {"field": "colDatatype", "headerName": "Type", "header": "type"}, {"field": "colDesc", "headerName": "Description", "header": "description", "minWidth": 1000}], "rows": [{"id": "3d199324-5bf4-4cbf-b36f-b5fe6821a3b3", "colName": "A1", "colDatatype": "float", "colDesc": "If NCF = 1, the number of days from @Issue to the @Settlement. If NCF = 2 and @Settlement >= quasicoupfirst then DFC1 else the number of days from quasicoupfirst to @Settlement."}, {"id": "fe080e92-014d-4d15-832e-e7394d8b17fd", "colName": "A2", "colDatatype": "float", "colDesc": "If NCF = 1 then NULL. If NCF = 2 and @Settlement >= quasicoupfirst then the number of days from quasicoupfirst to @Settlement else 0."}, {"id": "7c545a56-0606-40ec-850d-681f9c536010", "colName": "DSC", "colDatatype": "float", "colDesc": "Number of days from the @Settlement to the next quasi-coupon date."}, {"id": "4d904e77-0696-4265-ae49-e02148b89419", "colName": "E", "colDatatype": "float", "colDesc": "Number of coupon days in the quasi-coupon period in which the settlement date falls."}, {"id": "c0dd9349-bc0d-4d4b-a8a2-9a00417e7c74", "colName": "N", "colDatatype": "int", "colDesc": "Number of coupons between @FirstCoupon and @LastCoupon."}, {"id": "7ef2e68f-2beb-41cc-b441-018fa2b5b8c3", "colName": "NCL", "colDatatype": "int", "colDesc": "\t Number of quasi-coupon periods in the odd last period (1 or 2)."}, {"id": "82afb8a4-f965-4827-9724-026bde10ec0a", "colName": "NCF", "colDatatype": "int", "colDesc": "\t Number of quasi-coupon periods in the odd first period (1 or 2)."}, {"id": "e3d8fa21-528d-483e-b870-64a2c2ca76c9", "colName": "DLC1", "colDatatype": "float", "colDesc": "\t If NCL = 1, the number of days from @LastCoupon to @Maturity else NLL1"}, {"id": "ebc02fd3-67a1-4e0c-a0c5-7e659841ee9f", "colName": "DLC2", "colDatatype": "float", "colDesc": "\t If NCL =2 then NULL else the number of days from quasicouplast to @Maturity."}, {"id": "d7aec651-3a4d-46b2-ac6d-88912f1b0bf5", "colName": "NLL1", "colDatatype": "float", "colDesc": "The normal length of the first quasi-coupon period in the last coupon period. If NCL = 1 the length of the period from @LastCoupon to quasimaturity else the length of the period from @LastCoupon to quasimaturity."}, {"id": "297855ad-2ab7-4c21-a0f8-f5dd4529f139", "colName": "NLL2", "colDatatype": "float", "colDesc": "\t If NCL = 1 then NULL else the normal length of the period from quasicouplast to quasimaturity."}, {"id": "a9ee3c92-05fb-44ff-b22f-4137472b9fa7", "colName": "DFC1", "colDatatype": "float", "colDesc": "The normal length of the first quasi-coupon period minus the number of days from quasistart to @Issue."}, {"id": "68c677b7-5459-4b75-8553-1772d780d222", "colName": "DFC2", "colDatatype": "float", "colDesc": "If NCF = 2 then NULL else NLF2"}, {"id": "eadb51d5-2faa-48ce-807e-ab0781e08c6f", "colName": "NLF1", "colDatatype": "float", "colDesc": "\t The normal length of the first quasi-coupon period in the odd first period. If NCF = 1 then number of days from quasistart to @FirstCoupon else the number of days from quasistart to quasicoupfirst."}, {"id": "fdd77c7d-ab49-4117-af92-723a46f904ce", "colName": "NLF2", "colDatatype": "float", "colDesc": "The normal length for the second quasi-coupon period in the odd first period. If NCF = 1 then NULL else the number of days from quasicoupfirst to @FirstCoupon."}, {"id": "29e1a574-c3f1-4641-a196-289bf35b0948", "colName": "Nqf", "colDatatype": "float", "colDesc": "Number of whole coupons between @Settlement and @FirstCoupon."}, {"id": "bc4dc25d-26e2-4b3e-8c2a-8f5cd874b499", "colName": "quasistart", "colDatatype": "datetime", "colDesc": "Implied previous coupon date with respect to @Issue."}, {"id": "d88c62f9-dd5d-4622-a5ec-9f0095db3d85", "colName": "quasicoupfirst", "colDatatype": "datetime", "colDesc": "If NCF = 1 then NULL else the implied next coupon date with respect to @Issue."}, {"id": "157e98cc-f3aa-431d-9a51-cf5ed601a420", "colName": "quasicouplast", "colDatatype": "datetime", "colDesc": "If NCL = 1 then NULL else the implied next coupon date with respect to @LastCoupon."}, {"id": "c1b4d1a1-a6e0-43a7-8a53-0f4e1074be50", "colName": "quasimaturity", "colDatatype": "datetime", "colDesc": "The implied next coupon date with respect to @Maturity."}, {"id": "ad50ca9e-41be-42e1-aeea-e3716dc61712", "colName": "C", "colDatatype": "float", "colDesc": "Coupon amount"}, {"id": "cab19365-2e4a-4a63-a018-3f26e4db81b7", "colName": "LC", "colDatatype": "float", "colDesc": "Last coupon amount"}, {"id": "5784ef52-a403-47a8-82c3-5c166a5b38ce", "colName": "FC", "colDatatype": "float", "colDesc": "First coupon amount"}, {"id": "a762d0c0-81ee-409a-b5c9-483c88bae892", "colName": "P", "colDatatype": "float", "colDesc": "Price. If @Yield is NOT NULL then P is calculated from the inputs otherwise P is the value entered in @Price."}, {"id": "3349179d-38b0-4739-83eb-1db4d78599e1", "colName": "AI", "colDatatype": "float", "colDesc": "\t Accrued interest as of the settlement date."}, {"id": "f3c4e073-b993-4e79-9bce-eca375776534", "colName": "Y", "colDatatype": "float", "colDesc": "Yield. If @Yield is NOT NULL then Y is the value entered in @Yield otherwise Y is calculated from the inputs."}]}
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 = 0.
If @Frequency is any number other than 1, 2, 4, 6 or 12, or for @Basis = 'A/364' any number other than 1, 2, 4, 6 or 12 as well as 7, 14, 28, 91, 182 or 364 OFLFACTORS returns an error.
If @Basis is invalid (see above list), OFLFACTORS returns an error.
If @Maturity is NULL then an error is returned.
If @Issue is NULL then an error is returned.
If @FirstCoupon is NULL then an error is returned.
If @LastCoupon is NULL then an error is returned.
If @Settlement >= @FirstCoupon then nothing is returned.
The first quasi-coupon period in the odd first period is always the quasi-coupon period in which @Issue occurs.
The first quasi-coupon in the odd last period is always the quasi-coupon period in which @LastCoupon occurs.
The previous coupon date for the first quasi-coupon period is calculated using @Frequency, @Basis, and @LastCoupon. This is the value returned in quasistart.
If there is only one quasi-coupon in the odd first period then quasicoupfirst is NULL. Otherwise the previous coupon date for the second quasi-coupon period is calculated using @Frequency, @Basis, and @LastCoupon.
If there is only on quasi-coupon period in the odd last period the quasicouplast is NULL.
Examples
This is a bond with an odd short first coupon and an odd short last coupon.
SELECT *
FROM wct.OFLFACTORS( '2013-03-04', --@Settlement
'2022-04-28', --@Maturity
'2012-12-07', --@Issue
'2013-03-15', --@FirstCoupon
'2022-03-15', --@LastCoupon
.03125, --@Rate
NULL, --@Price
.02875, --@Yield
100, --@Redemption
2, --@Frequency
1 --@Basis
);
This produces the following result.
{"columns":[{"field":"A1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"A2"},{"field":"DSC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"E","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"N","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCL","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCF","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC2"},{"field":"NLL1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLL2"},{"field":"DFC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DFC2"},{"field":"NLF1"},{"field":"NLF2"},{"field":"Nqf","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasistart","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasicoupfirst"},{"field":"quasicouplast"},{"field":"quasimaturity","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"C","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"LC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"FC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"P","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"AI","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Y","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"A1":"87","A2":"NULL","DSC":"11","E":"181","N":"18","NCL":"1","NCF":"1","DLC1":"44","DLC2":"NULL","NLL1":"184","NLL2":"NULL","DFC1":"98","DFC2":"NULL","NLF1":"NULL","NLF2":"NULL","Nqf":"0","quasistart":"2012-09-15 00:00:00.000","quasicoupfirst":"NULL","quasicouplast":"NULL","quasimaturity":"2022-09-15 00:00:00.000","C":"1.5625","LC":"0.373641304347826","FC":"0.845994475138122","P":"102.00036224598","AI":"0.75103591160221","Y":"0.02875"}]}
This is a bond with an odd long first coupon and an odd long last coupon.
SELECT *
FROM wct.OFLFACTORS( '2013-03-04', --@Settlement
'2022-11-28', --@Maturity
'2012-06-07', --@Issue
'2013-03-15', --@FirstCoupon
'2022-03-15', --@LastCoupon
.03125, --@Rate
NULL, --@Price
.02875, --@Yield
100, --@Redemption
2, --@Frequency
1 --@Basis
);
This produces the following result.
{"columns":[{"field":"A1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"A2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DSC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"E","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"N","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCL","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCF","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLL1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLL2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DFC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DFC2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLF1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLF2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Nqf","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasistart","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasicoupfirst","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasicouplast","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasimaturity","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"C","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"LC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"FC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"P","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"AI","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Y","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"A1":"100","A2":"170","DSC":"11","E":"181","N":"18","NCL":"2","NCF":"2","DLC1":"184","DLC2":"74","NLL1":"184","NLL2":"181","DFC1":"100","DFC2":"181","NLF1":"184","NLF2":"181","Nqf":"0","quasistart":"2012-03-15 00:00:00.000","quasicoupfirst":"2012-09-15 00:00:00.000","quasicouplast":"2022-09-15 00:00:00.000","quasimaturity":"2023-03-15 00:00:00.000","C":"1.5625","LC":"2.20131215469613","FC":"2.4116847826087","P":"102.103433425767","AI":"2.31672621907278","Y":"0.02875"}]}
This is a bond with an odd long first coupon and an odd short last coupon.
SELECT *
FROM wct.OFLFACTORS( '2013-03-04', --@Settlement
'2022-04-28', --@Maturity
'2012-06-07', --@Issue
'2013-03-15', --@FirstCoupon
'2022-03-15', --@LastCoupon
.03125, --@Rate
101.999004756314, --@Price
NULL, --@Yield
100, --@Redemption
2, --@Frequency
1 --@Basis
);
This produces the following result.
{"columns":[{"field":"A1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"A2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DSC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"E","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"N","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCL","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCF","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC2"},{"field":"NLL1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLL2"},{"field":"DFC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DFC2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLF1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLF2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Nqf","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasistart","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasicoupfirst","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasicouplast"},{"field":"quasimaturity","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"C","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"LC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"FC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"P","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"AI","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Y","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"A1":"100","A2":"170","DSC":"11","E":"181","N":"18","NCL":"1","NCF":"2","DLC1":"44","DLC2":"NULL","NLL1":"184","NLL2":"NULL","DFC1":"100","DFC2":"181","NLF1":"184","NLF2":"181","Nqf":"0","quasistart":"2012-03-15 00:00:00.000","quasicoupfirst":"2012-09-15 00:00:00.000","quasicouplast":"NULL","quasimaturity":"2022-09-15 00:00:00.000","C":"1.5625","LC":"0.373641304347826","FC":"2.4116847826087","P":"101.999004756314","AI":"2.31672621907278","Y":"0.0287500000072949"}]}
This is a bond with an odd short first coupon and an odd long last coupon.
SELECT *
FROM wct.OFLFACTORS( '2013-03-04', --@Settlement
'2022-11-28', --@Maturity
'2012-12-07', --@Issue
'2013-03-15', --@FirstCoupon
'2022-03-15', --@LastCoupon
.03125, --@Rate
102.104790915433, --@Price
NULL, --@Yield
100, --@Redemption
2, --@Frequency
1 --@Basis
);
This produces the following result.
{"columns":[{"field":"A1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"A2"},{"field":"DSC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"E","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"N","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCL","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCF","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLL1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLL2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DFC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DFC2"},{"field":"NLF1"},{"field":"NLF2"},{"field":"Nqf","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasistart","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasicoupfirst"},{"field":"quasicouplast","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasimaturity","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"C","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"LC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"FC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"P","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"AI","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Y","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"A1":"87","A2":"NULL","DSC":"11","E":"181","N":"18","NCL":"2","NCF":"1","DLC1":"184","DLC2":"74","NLL1":"184","NLL2":"181","DFC1":"98","DFC2":"NULL","NLF1":"NULL","NLF2":"NULL","Nqf":"0","quasistart":"2012-09-15 00:00:00.000","quasicoupfirst":"NULL","quasicouplast":"2022-09-15 00:00:00.000","quasimaturity":"2023-03-15 00:00:00.000","C":"1.5625","LC":"2.20131215469613","FC":"0.845994475138122","P":"102.104790915433","AI":"0.75103591160221","Y":"0.0287500000109004"}]}
This is an example of a bond paying interest every 26 weeks.
SELECT *
FROM wct.OFLFACTORS( '2014-10-04', --@Settlement
'2029-12-12', --@Maturity
'2014-07-30', --@Issue
'2015-03-18', --@First_coupon
'2029-02-28', --@Last_coupon
.1250, --@Rate
NULL, --@Price
.1100, --@Yld
100, --@Redemption
182, --@Frequency
9 --@Basis
);
This produces the following result.
{"columns":[{"field":"A1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"A2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DSC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"E","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"N","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCL","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NCF","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DLC2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLL1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLL2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DFC1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"DFC2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLF1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"NLF2","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Nqf","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasistart","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasicoupfirst","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasicouplast","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"quasimaturity","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"C","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"LC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"FC","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"P","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"AI","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"},{"field":"Y","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"A1":"49","A2":"17","DSC":"165","E":"182","N":"28","NCL":"2","NCF":"2","DLC1":"182","DLC2":"105","NLL1":"182","NLL2":"182","DFC1":"49","DFC2":"182","NLF1":"182","NLF2":"182","Nqf":"0","quasistart":"2014-03-19 00:00:00.000","quasicoupfirst":"2014-09-17 00:00:00.000","quasicouplast":"2029-08-29 00:00:00.000","quasimaturity":"2030-02-27 00:00:00.000","C":"6.25","LC":"9.85576923076923","FC":"7.93269230769231","P":"110.846098828263","AI":"2.26648351648352","Y":"0.11"}]}
See Also
ODDFINT - Accrued interest for a bond with an odd first coupon
OFCFACTORS - Returns the components of the ODDFPRICE equation
OFLCONVEXITY - Convexity of a bond with an odd first and odd last coupon
OFLDURATION - Duration of a bond with an odd first and odd last coupon
OFCMDURATION - Modified duration of a bond with an odd first coupon
OFLPRICE - Price of a security with an odd last coupon.
OFLYIELD - Yield of a bond with an odd first and an odd last coupon
OLCFACTORS - Returns the components of the ODDLPRICE equation
RPIFACTORS - Factors for the calculation of the price of a bond that pays regular periodic interest