Skip to content

Commit dbee85d

Browse files
committed
Deprecate Italy::Exchange, adjust MakeVanillaSwap
1 parent f2635ed commit dbee85d

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

‎src/calendars.cpp‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ QuantLib::ext::shared_ptr<QuantLib::Calendar> getCalendar(const std::string &cal
173173
calstr == "Italy/Settlement" ||
174174
calstr == "Italy::Settlement") {
175175
pcal.reset(new QuantLib::Italy(QuantLib::Italy::Settlement));
176+
#if QL_HEX_VERSION < 0x014400c0
176177
} else if (calstr == "Italy/Exchange" ||
177-
calstr == "Italy::Exchange") {
178-
pcal.reset(new QuantLib::Italy(QuantLib::Italy::Exchange));
178+
calstr == "Italy::Exchange") {
179+
pcal.reset(new QuantLib::Italy(QuantLib::Italy::Exchange));
180+
#endif
179181

180182
} else if (calstr == "Japan" || calstr == "Japan/Settlement") {
181183
pcal.reset(new QuantLib::Japan());

‎src/sabr.cpp‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,14 @@ Rcpp::List sabrengine(Rcpp::List rparam,
204204

205205
// create swaps for european swaption here to get atm fwd rate, these are ignored for bermudan //
206206
QuantLib::ext::shared_ptr<VanillaSwap> underlyingCall =
207-
MakeVanillaSwap(Years*(((maturity-expiryDate)/365.0)), iborIndex1, strike)
207+
MakeVanillaSwap(Years*(((maturity-expiryDate)/365.0)), iborIndex1)
208+
.withFixedRate(strike)
208209
.withEffectiveDate(expiryDate)
209210
.receiveFixed(false);
210211

211212
QuantLib::ext::shared_ptr<VanillaSwap> underlyingPut =
212-
MakeVanillaSwap(Years*((maturity-expiryDate)/365.0), iborIndex1, strike)
213+
MakeVanillaSwap(Years*((maturity-expiryDate)/365.0), iborIndex1)
214+
.withFixedRate(strike)
213215
.withEffectiveDate(expiryDate)
214216
.receiveFixed(true);
215217
QuantLib::ext::shared_ptr<PricingEngine> swapEngine(new DiscountingSwapEngine(yldCrv));
@@ -223,12 +225,14 @@ Rcpp::List sabrengine(Rcpp::List rparam,
223225
// calculate if bermudan here //
224226
if(!european) {
225227
QuantLib::ext::shared_ptr<VanillaSwap> underlyingCall2 =
226-
MakeVanillaSwap(Years*(((maturity-startDate)/365.0)), iborIndex1, strike)
228+
MakeVanillaSwap(Years*(((maturity-startDate)/365.0)), iborIndex1)
229+
.withFixedRate(strike)
227230
.withEffectiveDate(startDate)
228231
.receiveFixed(false);
229232

230233
QuantLib::ext::shared_ptr<VanillaSwap> underlyingPut2 =
231-
MakeVanillaSwap(Years*((maturity-startDate)/365.0), iborIndex1, strike)
234+
MakeVanillaSwap(Years*((maturity-startDate)/365.0), iborIndex1)
235+
.withFixedRate(strike)
232236
.withEffectiveDate(startDate)
233237
.receiveFixed(true);
234238
QuantLib::ext::shared_ptr<PricingEngine> swapEngine(new DiscountingSwapEngine(yldCrv));

0 commit comments

Comments
 (0)