Skip to content

Commit 0577960

Browse files
author
jenkins
committed
git subrepo pull (merge) ore
subrepo: subdir: "ore" merged: "097ea2adc8" upstream: origin: "git@gitlab.acadiasoft.net:qs/ore.git" branch: "master" commit: "61faab37e6" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "73a0129"
2 parents 42cd87d + 61faab3 commit 0577960

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

OREData/ored/portfolio/builders/capfloorediborleg.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include <ored/portfolio/builders/capfloorediborleg.hpp>
20+
#include <ql/termstructures/volatility/optionlet/constantoptionletvol.hpp>
2021
#include <ored/utilities/log.hpp>
2122

2223
#include <boost/make_shared.hpp>
@@ -28,7 +29,13 @@ boost::shared_ptr<FloatingRateCouponPricer> CapFlooredIborLegEngineBuilder::engi
2829

2930
std::string ccyCode = parseIborIndex(index)->currency().code();
3031
Handle<YieldTermStructure> yts = market_->discountCurve(ccyCode, configuration(MarketContext::pricing));
31-
Handle<OptionletVolatilityStructure> ovs = market_->capFloorVol(index, configuration(MarketContext::pricing));
32+
Handle<OptionletVolatilityStructure> ovs;
33+
if (parseBool(engineParameter("ZeroVolatility", {}, false, "false"))) {
34+
ovs = Handle<OptionletVolatilityStructure>(boost::make_shared<ConstantOptionletVolatility>(
35+
0, NullCalendar(), Unadjusted, 0.0, Actual365Fixed(), Normal));
36+
} else {
37+
ovs = market_->capFloorVol(index, configuration(MarketContext::pricing));
38+
}
3239
BlackIborCouponPricer::TimingAdjustment timingAdjustment = BlackIborCouponPricer::Black76;
3340
boost::shared_ptr<SimpleQuote> correlation = boost::make_shared<SimpleQuote>(1.0);
3441
// for backwards compatibility we do not require the additional timing adjustment fields

0 commit comments

Comments
 (0)