25#ifndef quantext_currencyswap_hpp
26#define quantext_currencyswap_hpp
28#include <ql/cashflows/cashflows.hpp>
29#include <ql/currencies/europe.hpp>
30#include <ql/currency.hpp>
31#include <ql/indexes/iborindex.hpp>
32#include <ql/instruments/swap.hpp>
33#include <ql/money.hpp>
34#include <ql/time/daycounter.hpp>
35#include <ql/time/schedule.hpp>
55 CurrencySwap(
const std::vector<Leg>&
legs,
const std::vector<bool>& payer,
const std::vector<Currency>& currency,
56 const bool isPhysicallySettled =
true,
const bool isResettable =
false);
70 void fetchResults(
const PricingEngine::results*)
const override;
77 QL_REQUIRE(j <
legs_.size(),
"leg# " << j <<
" doesn't exist!");
82 QL_REQUIRE(j <
legs_.size(),
"leg #" << j <<
" doesn't exist!");
87 QL_REQUIRE(j <
legs_.size(),
"leg# " << j <<
" doesn't exist!");
92 QL_REQUIRE(j <
legs_.size(),
"leg #" << j <<
" doesn't exist!");
97 QL_REQUIRE(j <
legs_.size(),
"leg #" << j <<
" doesn't exist!");
102 QL_REQUIRE(j <
legs_.size(),
"leg #" << j <<
" doesn't exist!");
110 const Leg&
leg(Size j)
const {
111 QL_REQUIRE(j <
legs_.size(),
"leg #" << j <<
" doesn't exist!");
115 QL_REQUIRE(j <
legs_.size(),
"leg #" << j <<
" doesn't exist!");
161 void reset()
override;
176 Rate fixedRate,
const DayCounter& fixedDayCount, Currency floatCcy, Real floatNominal,
177 const Schedule& floatSchedule,
const QuantLib::ext::shared_ptr<IborIndex>& iborIndex,
178 Rate floatSpread, boost::optional<BusinessDayConvention> paymentConvention = boost::none,
179 const bool isPhysicallySettled =
true,
const bool isResettable =
false);
191 CrossCurrencySwap(
bool payFixed, Currency fixedCcy, std::vector<Real> fixedNominals,
const Schedule& fixedSchedule,
192 std::vector<Rate> fixedRates,
const DayCounter& fixedDayCount, Currency floatCcy,
193 std::vector<Real> floatNominals,
const Schedule& floatSchedule,
194 const QuantLib::ext::shared_ptr<IborIndex>& iborIndex, std::vector<Rate> floatSpreads,
195 boost::optional<BusinessDayConvention> paymentConvention = boost::none,
196 const bool isPhysicallySettled =
true,
const bool isResettable =
false);
199 CrossCurrencySwap(
bool pay1, Currency ccy1, std::vector<Real> nominals1,
const Schedule& schedule1,
200 std::vector<Rate> fixedRates1,
const DayCounter& fixedDayCount1, Currency ccy2,
201 std::vector<Real> nominals2,
const Schedule& schedule2, std::vector<Rate> fixedRates2,
202 const DayCounter& fixedDayCount2,
203 boost::optional<BusinessDayConvention> paymentConvention = boost::none,
204 const bool isPhysicallySettled =
true,
const bool isResettable =
false);
207 CrossCurrencySwap(
bool pay1, Currency ccy1, std::vector<Real> nominals1,
const Schedule& schedule1,
208 const QuantLib::ext::shared_ptr<IborIndex>& iborIndex1, std::vector<Rate> spreads1, Currency ccy2,
209 std::vector<Real> nominals2,
const Schedule& schedule2,
210 const QuantLib::ext::shared_ptr<IborIndex>& iborIndex2, std::vector<Rate> spreads2,
211 boost::optional<BusinessDayConvention> paymentConvention = boost::none,
212 const bool isPhysicallySettled =
true,
const bool isResettable =
false);
CrossCurrencySwap(bool pay1, Currency ccy1, std::vector< Real > nominals1, const Schedule &schedule1, std::vector< Rate > fixedRates1, const DayCounter &fixedDayCount1, Currency ccy2, std::vector< Real > nominals2, const Schedule &schedule2, std::vector< Rate > fixedRates2, const DayCounter &fixedDayCount2, boost::optional< BusinessDayConvention > paymentConvention=boost::none, const bool isPhysicallySettled=true, const bool isResettable=false)
std::vector< Currency > currency
void validate() const override
std::vector< Real > payer
std::vector< Real > legBPS
DiscountFactor npvDateDiscount
std::vector< DiscountFactor > endDiscounts
std::vector< DiscountFactor > startDiscounts
std::vector< Real > legNPV
std::vector< Real > inCcyLegNPV
std::vector< Real > inCcyLegBPS
Currency Interest Rate Swap
DiscountFactor endDiscounts(Size j) const
DiscountFactor npvDateDiscount_
std::vector< Real > inCcyLegNPV_
std::vector< Currency > currencies()
std::vector< Currency > currency_
void setupArguments(PricingEngine::arguments *) const override
bool isExpired() const override
Real inCcyLegNPV(Size j) const
Real legBPS(Size j) const
void deepUpdate() override
std::vector< Real > inCcyLegBPS_
std::vector< Real > legNPV_
const Leg & leg(Size j) const
DiscountFactor npvDateDiscount() const
std::vector< Real > legBPS_
bool isPhysicallySettled_
Date maturityDate() const
std::vector< DiscountFactor > startDiscounts_
Real legNPV(Size j) const
Real inCcyLegBPS(Size j) const
std::vector< Leg > legs()
void setupExpired() const override
DiscountFactor startDiscounts(Size j) const
void fetchResults(const PricingEngine::results *) const override
std::vector< DiscountFactor > endDiscounts_
void alwaysForwardNotifications() override
std::vector< Real > payer_
const Currency & legCurrency(Size j) const
Vanilla cross currency interest rate swap.