In this case you wouldn't use end-of-month = true.
On Fri, Jun 6, 2014 at 11:16 AM, Francois Botha <[hidden email]> wrote:
> Yes, that is what I want.
>
> This specific bond pays coupons on 31 March and 30 September each year, and
> if those days fall on a non-business day, the next business day is used. So
> instead 2017-09-30 falls on a Saturday, so the coupon will pay on
> 2017-10-02.
>
> I understood that I could use 'Following' instead of 'Modified Following' if
> I want to allow crossing over to the next month.
>
> Francois Botha
>
>
> On 6 June 2014 11:01, Luigi Ballabio <[hidden email]> wrote:
>>
>> You want the last business day of the month, so you take the last day
>> of the month and adjust it backwards. If you adjusted it forward,
>> you'd get the first business day of the following month instead.
>>
>> Luigi
>>
>> On Fri, Jun 6, 2014 at 10:56 AM, Francois Botha <[hidden email]> wrote:
>> > 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
>> >
>>
>>
>>
>> --
>> <https://implementingquantlib.blogspot.com>
>> <https://twitter.com/lballabio>
>
>
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>
Free forum by Nabble | Disable Popup Ads | Edit this page |