21#include <boost/make_shared.hpp>
22#include <ql/cashflows/fixedratecoupon.hpp>
23#include <ql/cashflows/iborcoupon.hpp>
24#include <ql/cashflows/simplecashflow.hpp>
29 Type type, Real fixedNominal,
const Currency& fixedCurrency,
const Schedule& fixedSchedule, Rate fixedRate,
30 const DayCounter& fixedDayCount, BusinessDayConvention fixedPaymentBdc, Natural fixedPaymentLag,
31 const Calendar& fixedPaymentCalendar, Real floatNominal,
const Currency& floatCurrency,
32 const Schedule& floatSchedule,
const QuantLib::ext::shared_ptr<IborIndex>& floatIndex, Spread floatSpread,
33 BusinessDayConvention floatPaymentBdc, Natural floatPaymentLag,
const Calendar& floatPaymentCalendar)
34 :
CrossCcySwap(2), type_(type), fixedNominal_(fixedNominal), fixedCurrency_(fixedCurrency),
35 fixedSchedule_(fixedSchedule), fixedRate_(fixedRate), fixedDayCount_(fixedDayCount),
36 fixedPaymentBdc_(fixedPaymentBdc), fixedPaymentLag_(fixedPaymentLag), fixedPaymentCalendar_(fixedPaymentCalendar),
37 floatNominal_(floatNominal), floatCurrency_(floatCurrency), floatSchedule_(floatSchedule),
38 floatIndex_(floatIndex), floatSpread_(floatSpread), floatPaymentBdc_(floatPaymentBdc),
39 floatPaymentLag_(floatPaymentLag), floatPaymentCalendar_(floatPaymentCalendar) {
50 for (Leg::const_iterator it = floatLeg.begin(); it < floatLeg.end(); ++it)
56 QuantLib::ext::shared_ptr<CashFlow> aCashflow = QuantLib::ext::make_shared<SimpleCashFlow>(-
floatNominal_, aDate);
57 floatLeg.insert(floatLeg.begin(), aCashflow);
60 aDate = floatLeg.back()->date();
61 aCashflow = QuantLib::ext::make_shared<SimpleCashFlow>(
floatNominal_, aDate);
62 floatLeg.push_back(aCashflow);
75 aCashflow = QuantLib::ext::make_shared<SimpleCashFlow>(-
fixedNominal_, aDate);
76 fixedLeg.insert(fixedLeg.begin(), aCashflow);
79 aDate = fixedLeg.back()->date();
80 aCashflow = QuantLib::ext::make_shared<SimpleCashFlow>(
fixedNominal_, aDate);
81 fixedLeg.push_back(aCashflow);
102 QL_FAIL(
"Unknown cross currency fix float swap type");
130 static Spread basisPoint = 1.0e-4;
133 if (
fairFixedRate_ == Null<Rate>() && legBPS_[idxFixed] != Null<Real>())
137 if (
fairSpread_ == Null<Spread>() && legBPS_[idxFloat] != Null<Real>())
149 QL_REQUIRE(
fixedRate != Null<Rate>(),
"Fixed rate cannot be null");
150 QL_REQUIRE(
spread != Null<Spread>(),
"Spread cannot be null");
void validate() const override
QuantLib::DayCounter fixedDayCount_
QuantLib::Real fixedNominal_
QuantLib::ext::shared_ptr< QuantLib::IborIndex > floatIndex_
QuantLib::Spread floatSpread_
QuantLib::Schedule fixedSchedule_
QuantLib::Rate fairFixedRate_
CrossCcyFixFloatSwap(Type type, QuantLib::Real fixedNominal, const QuantLib::Currency &fixedCurrency, const QuantLib::Schedule &fixedSchedule, QuantLib::Rate fixedRate, const QuantLib::DayCounter &fixedDayCount, QuantLib::BusinessDayConvention fixedPaymentBdc, QuantLib::Natural fixedPaymentLag, const QuantLib::Calendar &fixedPaymentCalendar, QuantLib::Real floatNominal, const QuantLib::Currency &floatCurrency, const QuantLib::Schedule &floatSchedule, const QuantLib::ext::shared_ptr< QuantLib::IborIndex > &floatIndex, QuantLib::Spread floatSpread, QuantLib::BusinessDayConvention floatPaymentBdc, QuantLib::Natural floatPaymentLag, const QuantLib::Calendar &floatPaymentCalendar)
Detailed constructor.
const QuantLib::Calendar & fixedPaymentCalendar() const
QuantLib::Currency fixedCurrency_
QuantLib::Spread fairSpread_
QuantLib::Rate fairFixedRate() const
QuantLib::Real floatNominal_
void fetchResults(const QuantLib::PricingEngine::results *r) const override
QuantLib::Natural fixedPaymentLag() const
QuantLib::Currency floatCurrency_
QuantLib::Calendar floatPaymentCalendar_
QuantLib::Schedule floatSchedule_
QuantLib::Rate fixedRate_
void setupArguments(QuantLib::PricingEngine::arguments *a) const override
void setupExpired() const override
QuantLib::BusinessDayConvention floatPaymentBdc_
QuantLib::Natural floatPaymentLag_
QuantLib::Calendar fixedPaymentCalendar_
QuantLib::BusinessDayConvention fixedPaymentBdc_
QuantLib::Spread fairSpread() const
void validate() const override
void setupArguments(PricingEngine::arguments *args) const override
void setupExpired() const override
void fetchResults(const PricingEngine::results *) const override
std::vector< Currency > currencies_
Cross currency fixed vs float swap instrument.