@@ -2156,11 +2156,15 @@ void YieldCurve::addFutures(const std::size_t index, const QuantLib::ext::shared
21562156 Leg l{QuantLib::ext::make_shared<FixedRateCoupon>(
21572157 helper->future ()->maturityDate (), 1.0 , 1.0 - helper->impliedQuote () / 100.0 ,
21582158 helper->future ()->overnightIndex ()->dayCounter (), helper->future ()->valueDate (),
2159- helper->future ()->maturityDate ())};
2159+ helper->future ()->maturityDate ()),
2160+ QuantLib::ext::make_shared<SimpleCashFlow>(1.0 , helper->future ()->maturityDate ()),
2161+ QuantLib::ext::make_shared<SimpleCashFlow>(-1.0 , helper->future ()->valueDate ())};
21602162 Leg m{QuantLib::ext::make_shared<FixedRateCoupon>(
21612163 helper->future ()->maturityDate (), 1.0 , 1.0 - r / 100.0 ,
21622164 helper->future ()->overnightIndex ()->dayCounter (), helper->future ()->valueDate (),
2163- helper->future ()->maturityDate ())};
2165+ helper->future ()->maturityDate ()),
2166+ QuantLib::ext::make_shared<SimpleCashFlow>(1.0 , helper->future ()->maturityDate ()),
2167+ QuantLib::ext::make_shared<SimpleCashFlow>(-1.0 , helper->future ()->valueDate ())};
21642168 return getCashflowReportData ({l, m}, {false , true }, {1.0E6 , 1.0E6 }, currency_[index].code (),
21652169 {currency_[index].code (), currency_[index].code ()}, asofDate_,
21662170 {*helper->future ()->overnightIndex ()->forwardingTermStructure (),
@@ -2202,10 +2206,14 @@ void YieldCurve::addFutures(const std::size_t index, const QuantLib::ext::shared
22022206 r = marketQuote->quote ()->value (), this ]() {
22032207 Leg l{QuantLib::ext::make_shared<FixedRateCoupon>(
22042208 helper->maturityDate (), 1.0 , 1.0 - helper->impliedQuote () / 100.0 , helper->dayCounter (),
2205- helper->earliestDate (), helper->maturityDate ())};
2209+ helper->earliestDate (), helper->maturityDate ()),
2210+ QuantLib::ext::make_shared<SimpleCashFlow>(1.0 , helper->maturityDate ()),
2211+ QuantLib::ext::make_shared<SimpleCashFlow>(-1.0 , helper->earliestDate ())};
22062212 Leg m{QuantLib::ext::make_shared<FixedRateCoupon>(
22072213 helper->maturityDate (), 1.0 , 1.0 - r / 100.0 , helper->dayCounter (),
2208- helper->earliestDate (), helper->maturityDate ())};
2214+ helper->earliestDate (), helper->maturityDate ()),
2215+ QuantLib::ext::make_shared<SimpleCashFlow>(1.0 , helper->maturityDate ()),
2216+ QuantLib::ext::make_shared<SimpleCashFlow>(-1.0 , helper->earliestDate ())};
22092217 ext::shared_ptr<YieldTermStructure> ts (helper->termStructure (), QuantLib::null_deleter ());
22102218 return getCashflowReportData ({l, m}, {false , true }, {1.0E6 , 1.0E6 }, currency_[index].code (),
22112219 {currency_[index].code (), currency_[index].code ()}, asofDate_,
0 commit comments