Skip to content

Commit 41fb46b

Browse files
author
jenkins
committed
git subrepo pull (merge) ore
subrepo: subdir: "ore" merged: "0085d00d15" upstream: origin: "git@gitlab.acadiasoft.net:qs/ore.git" branch: "master" commit: "05779607f9" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "73a0129"
2 parents 641b3de + 0577960 commit 41fb46b

2 files changed

Lines changed: 16 additions & 5 deletions

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

OREData/ored/portfolio/makenonstandardlegs.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,15 @@ Leg makeNonStandardIborLeg(const boost::shared_ptr<IborIndex>& index, const std:
156156
for (auto const& d : calcDates)
157157
effCalcDates.insert(d);
158158

159-
for (auto const& d : resetDates)
160-
effCalcDates.insert(d);
159+
for (auto const& d : resetDates) {
160+
if (d >= calcDates.front() && d < calcDates.back())
161+
effCalcDates.insert(d);
162+
}
161163

162164
if (strictNotionalDates) {
163165
for (auto const& d : notionalDates) {
164-
effCalcDates.insert(d);
166+
if (d >= calcDates.front() && d < calcDates.back())
167+
effCalcDates.insert(d);
165168
}
166169
}
167170

@@ -279,7 +282,8 @@ Leg makeNonStandardFixedLeg(const std::vector<Date>& calcDates, const std::vecto
279282

280283
if (strictNotionalDates)
281284
for (auto const& d : notionalDates) {
282-
effCalcDates.insert(d);
285+
if (d >= calcDates.front() && d < calcDates.back())
286+
effCalcDates.insert(d);
283287
}
284288

285289
// build coupons

0 commit comments

Comments
 (0)