@@ -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