Skip to content

Commit 35bb9ad

Browse files
damienbarkerjenkins
authored andcommitted
QPR-12250 catch zero fixing in equity variance swap
1 parent 48956a9 commit 35bb9ad

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

QuantExt/qle/pricingengines/varianceswapgeneralreplicationengine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Real GeneralisedReplicatingVarianceSwapEngine::calculateAccruedVariance(const Ca
138138
d = jointCal.advance(d, 1, Days)) {
139139
Real price = index_->fixing(d);
140140
QL_REQUIRE(price != Null<Real>(), "No fixing for " << index_->name() << " on date " << d);
141+
QL_REQUIRE(price > 0.0, "Fixing for " << index_->name() << " on date " << d << " must be greater than zero.");
141142
// Add historical dividend payment back to price
142143
Real dividend = dividends[d] != Null<Real>() ? dividends[d] : 0;
143144
Real move = log((price + dividend) / last);

0 commit comments

Comments
 (0)