Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Functions
discountingswapenginedeltagamma.cpp File Reference
#include "toplevelfixture.hpp"
#include <boost/test/unit_test.hpp>
#include <qle/pricingengines/discountingswapenginedeltagamma.hpp>
#include <ql/indexes/ibor/euribor.hpp>
#include <ql/instruments/makevanillaswap.hpp>
#include <ql/pricingengines/swap/discountingswapengine.hpp>
#include <ql/quotes/simplequote.hpp>
#include <ql/termstructures/yield/flatforward.hpp>
#include <ql/termstructures/yield/piecewisezerospreadedtermstructure.hpp>
#include <boost/make_shared.hpp>
#include <boost/timer/timer.hpp>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (testNpvDeltasGammas)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( testNpvDeltasGammas  )

Definition at line 396 of file discountingswapenginedeltagamma.cpp.

396 {
397
398 TestData d;
399
400 QuantLib::ext::shared_ptr<PricingEngine> engine0 = QuantLib::ext::make_shared<DiscountingSwapEngine>(d.discountCurve);
401 QuantLib::ext::shared_ptr<PricingEngine> engine =
402 QuantLib::ext::make_shared<DiscountingSwapEngineDeltaGamma>(d.discountCurve, d.pillarTimes, true, true, true);
403
404 performTest(d, engine0, engine, false, 0.0, "payer, zero spread");
405 performTest(d, engine0, engine, true, 0.0, "receiver, zero spread");
406 performTest(d, engine0, engine, false, 0.01, "payer, positive spread");
407 performTest(d, engine0, engine, true, 0.01, "receiver, positive spread");
408 performTest(d, engine0, engine, false, -0.01, "payer, negative spread");
409 performTest(d, engine0, engine, true, -0.01, "receiver, negative spread");
410
411 BOOST_CHECK(true);
412}