Serving the Quantitative Finance Community

 
User avatar
Antoshka
Topic Author
Posts: 0
Joined: January 31st, 2003, 3:41 pm

C++: getting an array of coupon dates

February 24th, 2003, 7:50 pm

Has anyone come accross a routine in C++ that would create an array of coupon payment dates based on the next coupon date, maturity date, and frequency. Something more robust than a naive approach of assuming that there are 365/Frequency days between coupon payments.For instance if the next coupon date is Mar 15, 2003 and Frequency is 2, then next coupons would be Sep 15, 2003; Mar 15, 2004; Sep 15, 2004, etc.Also, I would like to stay away from MFC.Thanks.
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

C++: getting an array of coupon dates

February 25th, 2003, 9:47 am

For the full thing, some work.Coupons have rules about how business days are handled since (year convention)/2 is quite likely to be a weekend or holiday. If you're to be properly generic, this has to cope with holidays outside your home country.Evading MFC is of course a laudable goal, however one would not want to code holiday conventions into the base class. Ideally, they'd be sucked out of a database or similar. If one forswears MFC, the internicine strife of ODBC waves its bloody claw.
 
User avatar
Patrik
Posts: 1
Joined: April 15th, 2002, 9:18 am

C++: getting an array of coupon dates

February 25th, 2003, 10:15 am

I think QuantLib implements most of the common trading calendars (and possibly the routine you are searching for).It is located at QuantLib
 
User avatar
Antoshka
Topic Author
Posts: 0
Joined: January 31st, 2003, 3:41 pm

C++: getting an array of coupon dates

February 25th, 2003, 2:54 pm

QuoteI think QuantLib implements most of the common trading calendars (and possibly the routine you are searching for).This is wonderful! Thanks!QuoteCoupons have rules about how business days are handled since (year convention)/2 is quite likely to be a weekend or holiday. Do you know if Bloomberg, when calculating yields and prices, determines whether the cashflows fall on the weekend, holiday, etc. or if it uses generic interpolation (e.g., 365/2 etc.)? What is the standard convention for this type of calculations?
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

C++: getting an array of coupon dates

February 26th, 2003, 7:51 am

Do you know if Bloomberg, when calculating yields and prices, determines whether the cashflows fall on the weekend, holiday, etc. or if it uses generic interpolation (e.g., 365/2 etc.)? What is the standard convention for this type of calculations?In my experience, Bloomberg follw othe appropriate convention for that bond. As far as I know, there is no "standard" for how coupons should go. I recall some bonds even work on the more accurate 365.25 basis.