Skip to content

Commit b0b994e

Browse files
pcaspersjenkins
authored andcommitted
Merge branch 'QPR-11765' of gitlab.acadiasoft.net:qs/oreplus into QPR-11765
1 parent c1b2f83 commit b0b994e

3 files changed

Lines changed: 13 additions & 14 deletions

File tree

OREData/ored/portfolio/legdata.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ Leg makeIborLeg(const LegData& data, const boost::shared_ptr<IborIndex>& index,
12851285
resetSchedule.dates(), fixingDays, data.notionals(), notionalDatesAsDates,
12861286
floatData->spreads(), spreadDatesAsDates, floatData->gearings(),
12871287
gearingDatesAsDates, data.strictNotionalDates(), dc, paymentCalendar, bdc,
1288-
boost::apply_visitor(PaymentLagPeriod(), paymentLag));
1288+
boost::apply_visitor(PaymentLagPeriod(), paymentLag), isInArrears);
12891289

12901290
isNonStandard = true;
12911291
}

OREData/ored/portfolio/makenonstandardlegs.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Leg makeNonStandardIborLeg(const boost::shared_ptr<IborIndex>& index, const std:
3232
const std::vector<Real>& spreads, const std::vector<Date>& spreadDatesInput,
3333
const std::vector<Real>& gearings, const std::vector<Date>& gearingDatesInput,
3434
const bool strictNotionalDates, const DayCounter& dayCounter, const Calendar& payCalendar,
35-
const BusinessDayConvention payConv, const Period& payLag) {
35+
const BusinessDayConvention payConv, const Period& payLag, const bool isInArrears) {
3636

3737
// checks
3838

@@ -67,8 +67,8 @@ Leg makeNonStandardIborLeg(const boost::shared_ptr<IborIndex>& index, const std:
6767
if (resetDates.empty() && fixingDates.empty()) {
6868
for (Size i = 0; i < calcDates.size() - 1; ++i) {
6969
resetDates.push_back(calcDates[i]);
70-
fixingDates.push_back(
71-
index->fixingCalendar().advance(resetDates.back(), -static_cast<int>(fixingDays) * Days, Preceding));
70+
fixingDates.push_back(index->fixingCalendar().advance(isInArrears ? calcDates[i + 1] : calcDates[i],
71+
-static_cast<int>(fixingDays) * Days, Preceding));
7272
}
7373
} else if (resetDates.empty()) {
7474
for (Size i = 0; i < fixingDates.size(); ++i) {

OREData/ored/portfolio/makenonstandardlegs.hpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,15 @@
2828

2929
namespace ore::data {
3030

31-
QuantLib::Leg
32-
makeNonStandardIborLeg(const boost::shared_ptr<QuantLib::IborIndex>& index,
33-
const std::vector<QuantLib::Date>& calcDates, const std::vector<QuantLib::Date>& payDates,
34-
const std::vector<QuantLib::Date>& fixingDates, const std::vector<QuantLib::Date>& resetDates,
35-
const QuantLib::Size fixingDays, const std::vector<QuantLib::Real>& notionals,
36-
const std::vector<QuantLib::Date>& notionalDates, const std::vector<QuantLib::Real>& spreads,
37-
const std::vector<QuantLib::Date>& spreadDates, const std::vector<QuantLib::Real>& gearings,
38-
const std::vector<QuantLib::Date>& gearingDates, const bool strictNotionalDates,
39-
const QuantLib::DayCounter& dayCounter, const QuantLib::Calendar& payCalendar,
40-
const QuantLib::BusinessDayConvention payConv, const QuantLib::Period& payLag);
31+
QuantLib::Leg makeNonStandardIborLeg(
32+
const boost::shared_ptr<QuantLib::IborIndex>& index, const std::vector<QuantLib::Date>& calcDates,
33+
const std::vector<QuantLib::Date>& payDates, const std::vector<QuantLib::Date>& fixingDates,
34+
const std::vector<QuantLib::Date>& resetDates, const QuantLib::Size fixingDays,
35+
const std::vector<QuantLib::Real>& notionals, const std::vector<QuantLib::Date>& notionalDates,
36+
const std::vector<QuantLib::Real>& spreads, const std::vector<QuantLib::Date>& spreadDates,
37+
const std::vector<QuantLib::Real>& gearings, const std::vector<QuantLib::Date>& gearingDates,
38+
const bool strictNotionalDates, const QuantLib::DayCounter& dayCounter, const QuantLib::Calendar& payCalendar,
39+
const QuantLib::BusinessDayConvention payConv, const QuantLib::Period& payLag, const bool isInArrears);
4140

4241
QuantLib::Leg makeNonStandardFixedLeg(const std::vector<QuantLib::Date>& calcDates,
4342
const std::vector<QuantLib::Date>& payDates,

0 commit comments

Comments
 (0)