Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Functions
discountingcurrencyswapenginedeltagamma.cpp File Reference
#include "toplevelfixture.hpp"
#include <boost/test/unit_test.hpp>
#include <qle/pricingengines/discountingcurrencyswapengine.hpp>
#include <qle/pricingengines/discountingcurrencyswapenginedeltagamma.hpp>
#include <ql/cashflows/iborcoupon.hpp>
#include <ql/indexes/ibor/euribor.hpp>
#include <ql/indexes/ibor/usdlibor.hpp>
#include <ql/math/matrix.hpp>
#include <ql/quotes/simplequote.hpp>
#include <ql/termstructures/yield/flatforward.hpp>
#include <ql/termstructures/yield/piecewisezerospreadedtermstructure.hpp>
#include <ql/time/calendars/target.hpp>
#include <ql/time/calendars/unitedstates.hpp>
#include <boost/make_shared.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 428 of file discountingcurrencyswapenginedeltagamma.cpp.

428 {
429
430 TestData d;
431
432 std::vector<Handle<YieldTermStructure>> discountCurves;
433 discountCurves.push_back(d.discountCurve);
434 discountCurves.push_back(d.discountCurveFor);
435 std::vector<Handle<Quote>> fx;
436 fx.push_back(Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(1.00)));
437 fx.push_back(Handle<Quote>(d.fxQuote));
438 std::vector<Currency> currencies;
439 currencies.push_back(EURCurrency());
440 currencies.push_back(USDCurrency());
441
442 QuantLib::ext::shared_ptr<PricingEngine> engine0 =
443 QuantLib::ext::make_shared<DiscountingCurrencySwapEngine>(discountCurves, fx, currencies, EURCurrency());
444 QuantLib::ext::shared_ptr<PricingEngine> engine = QuantLib::ext::make_shared<DiscountingCurrencySwapEngineDeltaGamma>(
445 discountCurves, fx, currencies, EURCurrency(), d.pillarTimes, true, true);
446
447 performTest(d, engine0, engine, false, 0.0, "payer, zero spread");
448 performTest(d, engine0, engine, true, 0.0, "receiver, zero spread");
449 performTest(d, engine0, engine, false, 0.01, "payer, positive spread");
450 performTest(d, engine0, engine, true, 0.01, "receiver, positive spread");
451 performTest(d, engine0, engine, false, -0.01, "payer, negative spread");
452 performTest(d, engine0, engine, true, -0.01, "receiver, negative spread");
453
454 BOOST_CHECK(true);
455}