24#include <ql/cashflows/cashflows.hpp>
25#include <ql/utilities/dataformatters.hpp>
34 const Handle<YieldTermStructure>& ts2,
36 const Handle<Quote>& fx)
37 : ts1_(ts1), ccy1_(ccy1), ts2_(ts2), ccy2_(ccy2), fx_(fx) {
45 results_.errorEstimate = Null<Real>();
47 QL_REQUIRE(!
fx_.empty(),
"fx handle not set");
48 QL_REQUIRE(!
ts1_.empty(),
"ts1 handle not set");
49 QL_REQUIRE(!
ts2_.empty(),
"ts2 handle not set");
51 QL_REQUIRE(
ts1_->referenceDate() ==
ts2_->referenceDate(),
"reference dates do not match");
53 Date npvDate = Settings::instance().evaluationDate();
60 bool includeRefDateFlows = Settings::instance().includeReferenceDateEvents();
62 for (Size i = 0; i <
arguments_.legs.size(); ++i) {
64 Handle<YieldTermStructure> yts;
74 CashFlows::npv(
arguments_.legs[i], **yts, includeRefDateFlows, npvDate, npvDate);
76 CashFlows::bps(
arguments_.legs[i], **yts, includeRefDateFlows, npvDate, npvDate);
77 }
catch (std::exception& e) {
78 QL_FAIL(io::ordinal(i + 1) <<
" leg: " << e.what());
83 static Spread basisPoint = 1.0e-4;
const Instrument::results * results_
Handle< YieldTermStructure > ts1_
void calculate() const override
Handle< YieldTermStructure > ts2_
OvernightIndexedCrossCcyBasisSwapEngine(const Handle< YieldTermStructure > &ts1, const Currency &ccy1, const Handle< YieldTermStructure > &ts2, const Currency &ccy2, const Handle< Quote > &fx)
Overnight Indexed Cross Currency Basis Swap Engine.
Swap::arguments * arguments_