Solved

Price and Yield calculations in QuantLib vs Bloomberg

Posted on 2013-11-05
4
932 Views
Last Modified: 2016-10-14
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
0
Comment
Question by:James Talvy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 24

Expert Comment

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

Thanks
0
 
LVL 1

Accepted Solution

by:
James Talvy earned 0 total points
ID: 39627499
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
 
LVL 1

Author Closing Comment

by:James Talvy
ID: 39885071
self resolved
0
 

Expert Comment

by:Martin Ross
ID: 41843560
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question