//! \name InterestRateIndex interface public override Date maturityDate(Date valueDate) { Date fixingDate = fixingCalendar_.advance(valueDate, -1, TimeUnit.Days); Date nextWednesday = Utils.previousWednesday(fixingDate + 7); return(fixingCalendar_.advance(nextWednesday, 1, TimeUnit.Days)); }
//! \name Date calculations /*! This method returns a schedule of fixing dates between start and end. */ public Schedule fixingSchedule(Date start, Date end) { return(new MakeSchedule().from(Utils.previousWednesday(start)) .to(Utils.nextWednesday(end)) .withFrequency(Frequency.Weekly) .withCalendar(fixingCalendar_) .withConvention(BusinessDayConvention.Following) .forwards() .value()); }
public override bool isValidFixingDate(Date fixingDate) { // either the fixing date is last Wednesday, or all days // between last Wednesday included and the fixing date are // holidays for (Date d = Utils.previousWednesday(fixingDate); d < fixingDate; ++d) { if (fixingCalendar_.isBusinessDay(d)) { return(false); } } // also, the fixing date itself must be a business day return(fixingCalendar_.isBusinessDay(fixingDate)); }