342 {
343
344 TestData d;
345
346 QuantLib::ext::shared_ptr<PricingEngine> engineLn0 =
347 QuantLib::ext::make_shared<BlackSwaptionEngine>(d.discountCurve, Handle<Quote>(d.lnVol));
348 QuantLib::ext::shared_ptr<PricingEngine> engineSln0 =
349 QuantLib::ext::make_shared<BlackSwaptionEngine>(d.discountCurve, Handle<Quote>(d.slnVol), Actual365Fixed(), d.slnShift);
350 QuantLib::ext::shared_ptr<PricingEngine> engineN0 =
351 QuantLib::ext::make_shared<BachelierSwaptionEngine>(d.discountCurve, Handle<Quote>(d.nVol));
352
353 QuantLib::ext::shared_ptr<PricingEngine> engineLn =
354 QuantLib::ext::make_shared<BlackSwaptionEngineDeltaGamma>(d.discountCurve, Handle<Quote>(d.lnVol), Actual365Fixed(),
355 0.0, d.pillarTimes, d.pillarTimes, d.pillarTimes, true, true);
356 QuantLib::ext::shared_ptr<PricingEngine> engineSln = QuantLib::ext::make_shared<BlackSwaptionEngineDeltaGamma>(
357 d.discountCurve, Handle<Quote>(d.slnVol), Actual365Fixed(), d.slnShift, d.pillarTimes, d.pillarTimes,
358 d.pillarTimes, true, true);
359 QuantLib::ext::shared_ptr<PricingEngine> engineN =
360 QuantLib::ext::make_shared<BachelierSwaptionEngineDeltaGamma>(d.discountCurve, Handle<Quote>(d.nVol), Actual365Fixed(),
361 d.pillarTimes, d.pillarTimes, d.pillarTimes, true, true);
362
363 performTest(d, engineLn0, engineLn, false, 0.0, "lognormal model, payer");
364 performTest(d, engineSln0, engineSln, false, 0.0, "shifted lognormal model, payer");
365 performTest(d, engineN0, engineN, false, 0.0, "normal model, payer");
366
367 performTest(d, engineLn0, engineLn, true, 0.0, "lognormal model, receiver");
368 performTest(d, engineSln0, engineSln, true, 0.0, "shifted lognormal model, receiver");
369 performTest(d, engineN0, engineN, true, 0.0, "normal model, receiver");
370
371
372
373
374
375
376
377
378
379
380
381 BOOST_CHECK(true);
382}