Login  Register

Schedule end of month business day convention

Posted by igitur on Jun 06, 2014; 8:56am
URL: http://quantlib.414.s1.nabble.com/Schedule-end-of-month-business-day-convention-tp15402.html

Hi,

In schedule.cpp, lines 349 - 355:
            if (convention == Unadjusted) {
                for (Size i=1; i<dates_.size()-1; ++i)
                    dates_[i] = Date::endOfMonth(dates_[i]);
            } else {
                for (Size i=1; i<dates_.size()-1; ++i)
                    dates_[i] = calendar_.endOfMonth(dates_[i]);
            }
And calendar.hpp: lines 207-209:
    inline Date Calendar::endOfMonth(const Date& d) const {
        return adjust(Date::endOfMonth(d), Preceding);
    }
This is applicable when the endOfMonth rule is true. If the business day convention is Unadjusted, it works fine, but if the business day convention is e.g. Modified Following, the second part of the code is executed. But calendar_.endOfMonth is hardcoded to use Preceding. The actual business day convention isn't passed through. Is this a bug or maybe I don't understand something?

regards
Francois Botha

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev