Version: 0.3.14
File: cashflowvectors.cpp
Error if a forward starting bond is created and the start date is Saturday and the maturity date is on the following Monday. SCHEDULE only create one cash flow date. Routines ends with an error on row with
Date start = schedule.date(0), end = schedule.date(1);
My Fix:
int indxend = (schedule.size() <= 1) ? 0 : 1;
Date start = schedule.date(0), end = schedule.date(indxend);
Best regards
Thomas Karlström
EMAIL: thomas.karlstroem@freenet.de
Logged In: YES
user_id=75450
Originator: NO
The behavior is correct---If only one date is given, an error should be launched as the code does not make assumptions (such as the assumption that the given date is to be used twice.)
If you really want the bond to start on a Saturday, you'll probably want to use the Unadjusted convention when you instantiate the schedule. This will keep both dates and allow you to instantiate the bond.