Price and Yield calculations in QuantLib vs Bloomberg

I am trying to use QuantLib library in order to calculate prices given the yield for US Treasury Notes and Bonds.

When calculating the present values in Bloomberg, it discounts future cash flows in compound method except when the settlement is in the last coupon period where Bloomberg discounts the cash flows using simple method instead of compounding.

However in QuantLib, I am unable to find a compounding method to support the above discounting. QuantLib has the following compounding methods.

Simple
Compounded
Continuous
SimpleThenCompounded

If I use 'Compounded', QuantLib price matches with Bloomberg  only when the settlement is before the final coupon period. On the other hand, if I use 'SimpleThenCompounded', QuantLib price matches Bloomberg only when the settlement is in the final coupon period.

I appreciate if someone can help me to resolve this.

Thanks
-James
LVL 1
James TalvyAsked:
Who is Participating?
 
James TalvyConnect With a Mentor Author Commented:
Friedrich,

I appreciate your reply but it really is not that helpful.

Of course I am aware of the documentation and if I was able to ascertain from it how to calculate US Treasury Notes/Bonds I would not be asking the question.

I am hoping to find someone with experience with this library that can shed some light on how to solve this problem.

-James
0
 
fridomCEO/ProgrammerCommented:
Could you point out what is not covered in
http://quantlib.org/docs.shtml

Thanks
0
 
James TalvyAuthor Commented:
self resolved
0
 
Martin RossCommented:
I added a pull request to support the Street convention. https://github.com/lballabio/QuantLib/pull/143  .  Still need to handle single period with special case though.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.