Link to home
Start Free TrialLog in
Avatar of James Talvy
James TalvyFlag for United States of America

asked on

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
Avatar of F. Dominicus
F. Dominicus
Flag of Germany image

Could you point out what is not covered in
http://quantlib.org/docs.shtml

Thanks
ASKER CERTIFIED SOLUTION
Avatar of James Talvy
James Talvy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James Talvy

ASKER

self resolved
Avatar of Martin Ross
Martin Ross

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.