-
Notifications
You must be signed in to change notification settings - Fork 298
Description
Here is an example bond.
Cusip: 52107QAG0
ISIN: US52107QAG01
Dated Date: 02/13/2015
First Coupon Date: 09/01/2015
Maturity Date: 02/13/2015
Coupon: 3.75
Coupon Frequency: Semi-Annual
Day Count Convention: 30/360
This bond has long first coupon (02/13/2015 to 09/01/2015) and short last coupon (09/01/2024 to 02/13/2025)
In DiscountingFixedCouponBondProductPricer, inside method dirtyPriceFromYieldStandard, the last coupon and principal are discounted back to the first coupon date. It uses variable called pvAtFirstCoupon.
The problem appears to be with Math.pow(factorOnPeriod, (double)pow), where pow is assumed to be an integer. When a bond has short/long last coupon, that last period will not be 1. For a short last coupon, the last period is less than one. For a long last coupon, the last period is greater than one.
This incorrect discounting of the last coupon and principal results in the yield calculation being incorrect for bonds with short/long last coupon.›