Skip to content

Commit 6546b94

Browse files
NathanielVolfangojenkins
authored andcommitted
QPR-12513 skip spread imply when clean price is zero
1 parent 6baea70 commit 6546b94

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

OREData/ored/marketdata/bondspreadimply.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ Real BondSpreadImply::implySpread(const std::string& securityId, const Real clea
197197
return c - cleanPrice * inflationFactor * adj;
198198
};
199199

200+
// edge case: bond has a zero settlement value -> skip spread imply
201+
202+
if (QuantLib::close_enough(b.bond->cleanPrice(), 0.0)) {
203+
DLOG("bond has a theoretical clean price of zero (no outstanding flows as of settlement date) -> skip spread "
204+
"imply and continue with zero security spread.");
205+
return 0.0;
206+
}
207+
200208
// solve for spread and return result
201209

202210
Brent brent;

0 commit comments

Comments
 (0)