OLCFACTORS
Updated: 30 June 2014
Use the tablevalued function OLCFACTORS to return the components used in the calculation of price and yield for a bond with an odd last coupon. OLCFACTORS supports odd last coupon bonds with up to 2 quasicoupon periods.
Syntax
SELECT * FROM [wctFinancial].[wct].[OLCFACTORS](
<@Settlement, datetime,>
,<@Maturity, datetime,>
,<@LastCoupon, datetime,>
,<@Rate, float,>
,<@Price, float,>
,<@Yield, float,>
,<@Redemption, float,>
,<@Frequency, float,>
,<@Basis, nvarchar(4000),>)
Arguments
@Settlement
the settlement date of the security. @Settlement is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@Maturity
the maturity date of the security. @Maturity is an expression that returns a datetime or smalldatetime value, or a character string in date format.
@LastCoupon
the last coupon date of the security. The period from the last coupon date until the maturity date defines the odd interest period. All previous coupon dates 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.
@Rate
the security’s annual coupon rate. @Rate is an expression of type float or of a type that can be implicitly converted to float.
@Price
the price of the bond. @Price is an expression of type float or of a type that can be implicitly converted to float.
@Yield
the security’s annual yield. @Yld is an expression of type float or of a type that can be implicitly converted to float.
@Redemption
the security’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 semiannual, @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.
@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/364'

Actual/364

10, 'BOND NONEOM'

US (NASD) 30/360 nonendofmonth

11, 'ACTUAL NONEOM'

Actual/Actual nonendofmonth

12, 'A360 NONEOM'

Actual/360 nonendofmonth

13, 'A365 NONEOM'

Actual/365 nonendofmonth

14, '30E/360 NONEOM', '30E/360 ICMA NONEOM', 'EBOND NONEOM'

European 30/360 nonendofmonth

15, '30/360 NONEOM', '30/360 ISDA NONEOM', 'GERMAN NONEOM'

30/360 ISDA nonendofmonth

16, 'NL/ACT NONEOM'

No Leap Year/ACT nonendofmonth

17, 'NL/365 NONEOM'

No Leap Year/365 nonendofmonth

18, 'NL/360 NONEOM'

No Leap Year/360 nonendofmonth

19, 'A/364 NONEOM'

Actual/364 nonendofmonth

Return Type
RETURNS TABLE (
[A] [float] NULL,
[DSC] [float] NULL,
[E] [float] NULL,
[N] [int] NULL,
[NCL] [int] NULL,
[A1] [float] NULL,
[DSC1] [float] NULL,
[DLC1] [float] NULL,
[NLL1] [float] NULL,
[A2] [float] NULL,
[DSC2] [float] NULL,
[DLC2] [float] NULL,
[NLL2] [float] NULL,
[quasicoup] [datetime] NULL,
[quasimaturity] [datetime] NULL,
[C] [float] NULL,
[LC] [float] NULL,
[P] [float] NULL,
[AI] [float] NULL,
[Y] [float] NULL
)
Column

Description

A

Number of accrued days from the previous coupon date to the settlement date when the settlement date is less than the last coupon date.

DSC

Number of days from the settlement date to the next coupon date when the settlement date is less than the last coupon date.

E

Number of coupon days in the coupon period in which the settlement date falls when the settlement date is less than the last coupon date.

N

Number of coupons between the settlement date and the last coupon date. If the settlement date is greater than the last coupon date then N = 0.

NCL

Number of quasicoupon periods in the odd period (1 or 2).

A1

If N > 0 then NULL, else the number of accrued days in the first quasicoupon period. If the settlement date is in the first quasicoupon period then this the number of days from the last coupon date to the settlement date. If the settlement date is in the second coupon period then this is equal to NLL1

DLC1

Number of days in the first coupon period. If NCL is equal to 1 then this is the number of days from the last coupon date to the maturity date. If NCL = 2 then this is the number of days from the last coupon date to quasicoup.

DSC1

If N > 0 then NULL, else the number of days from the settlement date to the next quasicoupon or maturity date. If NCL = 1, the number of days from the settlement date to the maturity date. If NCL = 2 and settlement is in the first quasicoupon period then the number of days from settlement date to quasicoup, else 0.

NLL1

Normal length of the first quasicoupon period.

A2

Number of days from the quasicoupon date to the settlement date. If the quasicoupon date is NULL then A2 is NULL. If settlement date is less than or equal to the quasicoupon date then A2 = 0

DLC2

Number of days from quasicoup to maturity date. If quasicoup is NULL then NULL.

DSC2

Number of days from the greater of quasicoup and settlement date to the maturity date. If quasicoup is NULL then NULL.

NLL2

Normal length of the period from the quasicoup to quasimaturity.

quasimaturity

Implied maturity date with respect to the last coupon date.

quasicoup

Implied next coupon date with respect to the last coupon date when NCL = 2.

C

Coupon amount

LC

Last coupon amount

P

Price. If @Yield is NOT NULL then P is calculated from the inputs otherwise P is the value entered in @Price.

AI

Accrued interest as of the settlement date.

Y

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 OLCFACTORS returns an error.
· If @Basis is invalid (see above list), OLCFACTORS returns an error.
· If @Maturity is NULL then an error is returned.
· If @Issue is NULL then an error is returned.
· If @LastCoupon is NULL then an error is returned.
· If there is only one quasicoupon period then quasicoup is NULL. Otherwise the next coupon date is calculated using @Frequency, @Basis, and @Maturity.
· If there are 2 quasicoupon periods then DLC1 = NLL1.
Examples
This is a bond with odd short last coupon periods where the settlement date is in the last coupon period.
SELECT
*
FROM
wct.OLCFACTORS(
'20141001', @Settlement
'20141215', @Maturity
'20140915', @Last_interest
0.0225, @Rate
NULL, @Price
0.0010, @Yield
100, @Redemption
2, @Frequency
1 @Basis
)
This produces the following result (which has been reformatted for ease of viewing).
A

DSC

E

N

NCL

A1

DSC1

DLC1

NLL1

A2

DSC2

DLC2

NLL2

NULL

NULL

NULL

0

1

16

75

91

181

NULL

NULL

NULL

NULL

quasicoup

quasimaturity

C

LC

P

AI

Y

NULL

3/15/2015

1.125

0.565607735

100.4453291

0.099447514

0.001

This is a bond with an odd long last coupon period with a settlement date in the last coupon period.
SELECT
*
FROM
wct.OLCFACTORS(
'20141001', @Settlement
'20141215', @Maturity
'20140315', @Last_interest
0.0225, @Rate
NULL, @Price
0.0010, @Yield
100, @Redemption
2, @Frequency
1 @Basis
)
This produces the following result (which has been reformatted for ease of viewing).
A

DSC

E

N

NCL

A1

DSC1

DLC1

NLL1

A2

DSC2

DLC2

NLL2

NULL

NULL

NULL

0

2

184

0

184

184

16

75

91

181

quasicoup

quasimaturity

C

LC

P

AI

Y

9/15/2014

3/15/2015

1.125

1.690607735

100.4450961

1.224447514

0.001

This is a bond with an odd short last coupon with a settlement date prior to the last coupon date.
SELECT
*
FROM
wct.OLCFACTORS(
'20141001', @Settlement
'20341215', @Maturity
'20340315', @Last_interest
0.0425, @Rate
NULL, @Price
0.0400, @Yield
100, @Redemption
2, @Frequency
1 @Basis
)
This produces the following result.
A

DSC

E

N

NCL

A1

DSC1

DLC1

NLL1

A2

DSC2

DLC2

NLL2

16

165

181

39

2

NULL

NULL

184

184

NULL

NULL

91

181

quasicoup

quasimaturity

C

LC

P

AI

Y

9/15/2034

3/15/2035

2.125

3.193370166

103.4336872

0.187845304

0.04

This is a bond with odd long last coupon period with a settlement date prior to the last coupon date.
SELECT
*
FROM
wct.OLCFACTORS(
'20141001', @Settlement
'20341215', @Maturity
'20340315', @Last_interest
0.0425, @Rate
103.4336872, @Price
NULL, @Yield
100, @Redemption
2, @Frequency
1 @Basis
)
This produces the following result.
A

DSC

E

N

NCL

A1

DSC1

DLC1

NLL1

A2

DSC2

DLC2

NLL2

16

165

181

39

2

NULL

NULL

184

184

NULL

NULL

91

181

quasicoup

quasimaturity

C

LC

P

AI

Y

9/15/2034

3/15/2035

2.125

3.193370166

103.4336872

0.187845304

0.04

This is an example of a bond paying interest every 26 weeks.
SELECT
*
FROM
wct.OLCFACTORS(
'20141004', @Settlement
'20141215', @Maturity
'20140601', @Last_interest
0.1250, @Rate
NULL, @Price
0.1100, @Yield
100, @Redemption
182, @Frequency
9 @Basis
)
This produces the following result.
A

DSC

E

N

NCL

A1

DSC1

DLC1

NLL1

A2

DSC2

DLC2

NLL2

NULL

NULL

NULL

0

2

125

57

182

182

0

15

15

182

quasicoup

quasimaturity

C

LC

P

AI

Y

20141130

20150531

6.25

6.76510989

100.1989749

4.292582418

0.11

See Also