Re: Pricing fixed coupon bonds with odd first coupon (short/long first coupon)
Posted by
Luigi Ballabio on
Mar 30, 2017; 3:32pm
URL: http://quantlib.414.s1.nabble.com/Pricing-fixed-coupon-bonds-with-odd-first-coupon-short-long-first-coupon-tp18126p18162.html
Hey guys,
I've been working through QuantLib over the past few days and I've gotten a
decent handle on pricing bonds. I'm building a bond calculator and using
Excel's PRICE and ODDFPRICE functions as a point of reference. I'm able to
replicate PRICE with around 9 or 10 decimal places of accuracy, but I can
only get around 4 decimal places of accuracy when trying to replicate
ODDFPRICE. That's good enough for right now, but I'd like to improve that to
at least 6 or 7 decimals of accuracy, and I'm not sure where I might be
going wrong.
I'm using the following data:
Interest Accrual Date/Effective Date: 17-Jan-2017 (This goes into ODDFPRICE
as issue date)
1st Coupon Payment Date: 28-Feb-2017
Settlement Date: 29-Jan-2017
Maturity Date: 28-Feb-2026
Annual Coupon Rate: 4.000%
Yield to Maturity: 3.957%
Payment Frequency: Semiannual
Day Count Convention: Actual/Actual (ISMA)
These inputs give me the following prices...
ODDFPRICE: 100.327679342028
QuantLib: 100.32761767821234855
The same code is accurate to 9 or 10 decimal places when I give it a regular
coupon bond.
I found this discussion from 2009
<http://quantlib.10058.n7.nabble.com/Odd-coupon-periods-td7939.html> that
seems like it might be related to this discrepancy, but the thread seemed to
end without resolution. I've attached my code at the bottom, if anybody has
any ideas about replicating ODDFPRICE in QuantLib I would very much
appreciate it. Thanks a lot for your time!
Ryan
--
View this message in context: http://quantlib.10058.n7.nabble.com/Pricing-fixed-coupon-bonds-with-odd-first-coupon-short-long-first-coupon-tp18126.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org!
http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users