29Real
getOisAtmLevel(
const QuantLib::ext::shared_ptr<OvernightIndex>& on,
const Date& fixingDate,
30 const Period& rateComputationPeriod) {
31 Date today = Settings::instance().evaluationDate();
32 Date start = on->valueDate(fixingDate);
33 Date end = on->fixingCalendar().advance(start, rateComputationPeriod);
34 Date adjStart = std::max(start, today);
35 Date adjEnd = std::max(adjStart + 1, end);
37 cpn.setPricer(QuantLib::ext::make_shared<OvernightIndexedCouponPricer>());
41Real
getBMAAtmLevel(
const QuantLib::ext::shared_ptr<BMAIndex>& bma,
const Date& fixingDate,
42 const Period& rateComputationPeriod) {
43 Date today = Settings::instance().evaluationDate();
44 Date start = bma->fixingCalendar().advance(fixingDate, 1 * Days);
45 Date end = bma->fixingCalendar().advance(start, rateComputationPeriod);
46 Date adjStart = std::max(start, today);
47 Date adjEnd = std::max(adjStart + 1, end);
48 AverageBMACoupon cpn(end, 1.0, adjStart, adjEnd, bma);
Real getOisAtmLevel(const QuantLib::ext::shared_ptr< OvernightIndex > &on, const Date &fixingDate, const Period &rateComputationPeriod)
Real getBMAAtmLevel(const QuantLib::ext::shared_ptr< BMAIndex > &bma, const Date &fixingDate, const Period &rateComputationPeriod)
some cashflow related utilities.