Skip to content

Commit b9dd8c9

Browse files
author
Sebastien Bouvard
committed
Merge branch 'feature/QPR-13674' into 'master'
QPR-13674 init notional and catch failing ref data call Closes QPR-13674 See merge request qs/oreplus!3052
2 parents 2c77a16 + 1867e4b commit b9dd8c9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

OREData/ored/portfolio/bondtotalreturnswap.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ void BondTRS::build(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactor
8383

8484
QuantLib::ext::shared_ptr<BondIndex> bondIndex;
8585

86-
auto bondType = getBondReferenceDatumType(bondData_.securityId(), engineFactoryOverride->referenceData());
87-
8886
BondIndexBuilder bondIndexBuilder;
8987

9088
Real bondNotional = bondData_.bondNotional();
9189

9290
try {
9391

92+
auto bondType = getBondReferenceDatumType(bondData_.securityId(), engineFactoryOverride->referenceData());
93+
9494
if (bondType.empty() || bondType == BondReferenceDatum::TYPE) {
9595

9696
// vanilla bond underlying
@@ -123,6 +123,7 @@ void BondTRS::build(const QuantLib::ext::shared_ptr<EngineFactory>& engineFactor
123123
// try to fill some fields for trade matching purposes although the trade build itself failed already
124124
npvCurrency_ = fundingLegData_.currency();
125125
notionalCurrency_ = bondData_.currency();
126+
notional_ = 1.0;
126127
for (auto const& d : bondData_.coupons()) {
127128
try {
128129
auto s = makeSchedule(d.schedule());

0 commit comments

Comments
 (0)