Skip to content

Commit 22d2f1b

Browse files
rolandlichtersjenkins
authored andcommitted
Merge remote-tracking branch 'origin/master' into QPR-12022_QPR-12087_QPR-11778
1 parent 2c0f71c commit 22d2f1b

18 files changed

Lines changed: 1877 additions & 1880 deletions

Examples/Example_26/ExpectedOutput/EUR_xois_curves.csv

Lines changed: 167 additions & 167 deletions
Large diffs are not rendered by default.

Examples/Example_26/ExpectedOutput/EUR_xois_flows.csv

Lines changed: 165 additions & 165 deletions
Large diffs are not rendered by default.

Examples/Example_26/ExpectedOutput/USD_xois_curves.csv

Lines changed: 167 additions & 167 deletions
Large diffs are not rendered by default.

Examples/Example_26/ExpectedOutput/USD_xois_flows.csv

Lines changed: 728 additions & 728 deletions
Large diffs are not rendered by default.

Examples/Example_26/ExpectedOutput/curves.csv

Lines changed: 167 additions & 167 deletions
Large diffs are not rendered by default.

Examples/Example_26/ExpectedOutput/flows.csv

Lines changed: 411 additions & 411 deletions
Large diffs are not rendered by default.

Examples/Example_26/TradeGenerator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ def CreateFloatingLeg(legroot, tradeType, tradeQuote, curve, details, basis=Fals
259259
else:
260260
spotLag = details[3][0:-1]
261261
currency = details[2]
262+
dayCounter = currencyDaycountConvention(currency)
262263
if tradeType == "Swap":
263264
convention = swapConventions[curve]
264265
calendar = convention.find("FixedCalendar").text
@@ -267,6 +268,8 @@ def CreateFloatingLeg(legroot, tradeType, tradeQuote, curve, details, basis=Fals
267268
elif tradeType == "OIS":
268269
if currency == "USD":
269270
calendar = "US-FED"
271+
if currency == "JPY":
272+
dayCounter = "A365F"
270273
convention = oisConventions[curve]
271274
rule = convention.find("Rule").text
272275
spotLag = convention.find("SpotLag").text
@@ -279,7 +282,6 @@ def CreateFloatingLeg(legroot, tradeType, tradeQuote, curve, details, basis=Fals
279282
return False
280283
index = convention.find("Index").text
281284

282-
dayCounter = currencyDaycountConvention(currency)
283285
payer = True
284286

285287
payConvention = convention.find("FixedConvention").text

OREData/ored/portfolio/builders/convertiblebond.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ boost::shared_ptr<QuantLib::PricingEngine> ConvertibleBondFDDefaultableEquityJum
224224
<< ", EQ-" << equity->name() << " not found, fall back to zero correlation.");
225225
}
226226
equity = boost::make_shared<CompoEquityIndex>(equity, fx, startDate);
227-
volatility = Handle<BlackVolTermStructure>(
228-
boost::make_shared<BlackTriangulationATMVolTermStructure>(volatility, fxVol, corrCurve));
227+
volatility = Handle<BlackVolTermStructure>(boost::make_shared<BlackTriangulationATMVolTermStructure>(
228+
volatility, fxVol, corrCurve, parseBool(engineParameter("FxVolIsStatic", {}, false, "false"))));
229229
}
230230

231231
// set up calibration grid

OREData/ored/scripting/engines/numericlgmriskparticipationagreementengine.cpp

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ Real NumericLgmRiskParticipationAgreementEngine::protectionLegNpv() const {
439439
std::vector<std::vector<Size>> onRateCutoff(eventDates.size());
440440
std::vector<std::vector<bool>> onIncludeSpread(eventDates.size());
441441
std::vector<std::vector<Period>> onLookback(eventDates.size());
442-
std::vector<std::vector<DayCounter>> onAccrualDayCounter(eventDates.size());
443442
std::vector<std::vector<bool>> onLocalCapFloor(eventDates.size());
444443
std::vector<std::vector<int>> floatingCouponsLatestRelevantCallEventIndex(eventDates.size());
445444

@@ -572,7 +571,6 @@ Real NumericLgmRiskParticipationAgreementEngine::protectionLegNpv() const {
572571
onRateCutoff[i].push_back(0);
573572
onIncludeSpread[i].push_back(false);
574573
onLookback[i].push_back(0 * Days);
575-
onAccrualDayCounter[i].push_back(DayCounter());
576574
onLocalCapFloor[i].push_back(false);
577575
onIsAveraging[i].push_back(false);
578576
floatingCouponsLatestRelevantCallEventIndex[i].push_back(getLatestRelevantCallIndex(
@@ -598,7 +596,6 @@ Real NumericLgmRiskParticipationAgreementEngine::protectionLegNpv() const {
598596
onRateCutoff[i].push_back(onCouponAnalyzer.rateCutoff());
599597
onIncludeSpread[i].push_back(onCouponAnalyzer.includeSpread());
600598
onLookback[i].push_back(onCouponAnalyzer.lookback());
601-
onAccrualDayCounter[i].push_back(onCouponAnalyzer.dayCounter());
602599
onIsAveraging[i].push_back(onCouponAnalyzer.isAveraging());
603600
payTimes[i].push_back(discountCurves_[baseCcy_]->timeFromReference(c->date()));
604601
floatingCouponsLatestRelevantCallEventIndex[i].push_back(
@@ -675,17 +672,17 @@ Real NumericLgmRiskParticipationAgreementEngine::protectionLegNpv() const {
675672
RandomVariable rate;
676673
if (auto on = boost::dynamic_pointer_cast<OvernightIndex>(floatingIndices[i][k])) {
677674
if (onIsAveraging[i][k]) {
678-
rate = lgm.averagedOnRate(on, onFixingDates[i][k], onValueDates[i][k], onDt[i][k],
679-
onRateCutoff[i][k], onIncludeSpread[i][k], floatingSpreads[i][k],
680-
floatingGearings[i][k], onLookback[i][k], onAccrualDayCounter[i][k],
681-
floatingCaps[i][k], floatingFloors[i][k], onLocalCapFloor[i][k],
682-
nakedOption[i][k], eventTimes[i], states);
675+
rate =
676+
lgm.averagedOnRate(on, onFixingDates[i][k], onValueDates[i][k], onDt[i][k], onRateCutoff[i][k],
677+
onIncludeSpread[i][k], floatingSpreads[i][k], floatingGearings[i][k],
678+
onLookback[i][k], floatingCaps[i][k], floatingFloors[i][k],
679+
onLocalCapFloor[i][k], nakedOption[i][k], eventTimes[i], states);
683680
} else {
684681
rate = lgm.compoundedOnRate(on, onFixingDates[i][k], onValueDates[i][k], onDt[i][k],
685682
onRateCutoff[i][k], onIncludeSpread[i][k], floatingSpreads[i][k],
686-
floatingGearings[i][k], onLookback[i][k], onAccrualDayCounter[i][k],
687-
floatingCaps[i][k], floatingFloors[i][k], onLocalCapFloor[i][k],
688-
nakedOption[i][k], eventTimes[i], states);
683+
floatingGearings[i][k], onLookback[i][k], floatingCaps[i][k],
684+
floatingFloors[i][k], onLocalCapFloor[i][k], nakedOption[i][k],
685+
eventTimes[i], states);
689686
}
690687
} else if (auto ibor = boost::dynamic_pointer_cast<IborIndex>(floatingIndices[i][k])) {
691688
rate = computeIborRate(lgm.fixing(ibor, eventDates[i], eventTimes[i], states), floatingSpreads[i][k],
@@ -720,16 +717,14 @@ Real NumericLgmRiskParticipationAgreementEngine::protectionLegNpv() const {
720717
rate = lgm.averagedOnRate(
721718
on, onFixingDates[t][k], onValueDates[t][k], onDt[t][k], onRateCutoff[t][k],
722719
onIncludeSpread[t][k], floatingSpreads[t][k], floatingGearings[t][k],
723-
onLookback[t][k], onAccrualDayCounter[t][k], floatingCaps[t][k],
724-
floatingFloors[t][k], onLocalCapFloor[t][k], nakedOption[t][k], eventTimes[i],
725-
states);
720+
onLookback[t][k], floatingCaps[t][k], floatingFloors[t][k], onLocalCapFloor[t][k],
721+
nakedOption[t][k], eventTimes[i], states);
726722
} else {
727723
rate = lgm.compoundedOnRate(
728724
on, onFixingDates[t][k], onValueDates[t][k], onDt[t][k], onRateCutoff[t][k],
729725
onIncludeSpread[t][k], floatingSpreads[t][k], floatingGearings[t][k],
730-
onLookback[t][k], onAccrualDayCounter[t][k], floatingCaps[t][k],
731-
floatingFloors[t][k], onLocalCapFloor[t][k], nakedOption[t][k], eventTimes[i],
732-
states);
726+
onLookback[t][k], floatingCaps[t][k], floatingFloors[t][k], onLocalCapFloor[t][k],
727+
nakedOption[t][k], eventTimes[i], states);
733728
}
734729
} else if (auto ibor = boost::dynamic_pointer_cast<IborIndex>(floatingIndices[t][k])) {
735730
rate = computeIborRate(
@@ -758,16 +753,14 @@ Real NumericLgmRiskParticipationAgreementEngine::protectionLegNpv() const {
758753
rate = lgm.averagedOnRate(
759754
on, onFixingDates[t][k], onValueDates[t][k], onDt[t][k], onRateCutoff[t][k],
760755
onIncludeSpread[t][k], floatingSpreads[t][k], floatingGearings[t][k],
761-
onLookback[t][k], onAccrualDayCounter[t][k], floatingCaps[t][k],
762-
floatingFloors[t][k], onLocalCapFloor[t][k], nakedOption[t][k], eventTimes[i],
763-
states);
756+
onLookback[t][k], floatingCaps[t][k], floatingFloors[t][k], onLocalCapFloor[t][k],
757+
nakedOption[t][k], eventTimes[i], states);
764758
} else {
765759
rate = lgm.compoundedOnRate(
766760
on, onFixingDates[t][k], onValueDates[t][k], onDt[t][k], onRateCutoff[t][k],
767761
onIncludeSpread[t][k], floatingSpreads[t][k], floatingGearings[t][k],
768-
onLookback[t][k], onAccrualDayCounter[t][k], floatingCaps[t][k],
769-
floatingFloors[t][k], onLocalCapFloor[t][k], nakedOption[t][k], eventTimes[i],
770-
states);
762+
onLookback[t][k], floatingCaps[t][k], floatingFloors[t][k], onLocalCapFloor[t][k],
763+
nakedOption[t][k], eventTimes[i], states);
771764
}
772765
} else if (auto ibor = boost::dynamic_pointer_cast<IborIndex>(floatingIndices[t][k])) {
773766
rate = computeIborRate(

OREData/ored/scripting/models/gaussiancam.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,12 +522,12 @@ RandomVariable GaussianCam::fwdCompAvg(const bool isAvg, const std::string& inde
522522
const auto& modelTime = curves_.front()->timeFromReference(effobsdate);
523523
if (isAvg) {
524524
return lgmv.averagedOnRate(on, coupon->fixingDates(), coupon->valueDates(), coupon->dt(), rateCutoff,
525-
includeSpread, spread, gearing, lookback * Days, on->dayCounter(), cap, floor,
526-
localCapFloor, nakedOption, modelTime, modelState);
525+
includeSpread, spread, gearing, lookback * Days, cap, floor, localCapFloor,
526+
nakedOption, modelTime, modelState);
527527
} else {
528528
return lgmv.compoundedOnRate(on, coupon->fixingDates(), coupon->valueDates(), coupon->dt(), rateCutoff,
529-
includeSpread, spread, gearing, lookback * Days, on->dayCounter(), cap, floor,
530-
localCapFloor, nakedOption, modelTime, modelState);
529+
includeSpread, spread, gearing, lookback * Days, cap, floor, localCapFloor,
530+
nakedOption, modelTime, modelState);
531531
}
532532
}
533533

0 commit comments

Comments
 (0)