19#include <ql/currencies/europe.hpp>
20#include <ql/pricingengines/swap/discountingswapengine.hpp>
21#include <ql/utilities/null_deleter.hpp>
25using QuantLib::ext::shared_ptr;
33 const QuantLib::ext::shared_ptr<OvernightIndex>& payIndex,
const Period& payTenor,
34 const QuantLib::ext::shared_ptr<OvernightIndex>& recIndex,
35 const Period& recTenor,
36 const Handle<Quote>& spreadQuote,
const Handle<YieldTermStructure>& fixedDiscountCurve,
37 bool spreadQuoteOnPayLeg,
bool fixedDiscountOnPayLeg)
39 payTenor_(payTenor), recIndex_(recIndex), recTenor_(recTenor), fixedDiscountCurve_(fixedDiscountCurve),
40 spreadQuoteOnPayLeg_(spreadQuoteOnPayLeg), fixedDiscountOnPayLeg_(fixedDiscountOnPayLeg) {
49 Date asof = Settings::instance().evaluationDate();
51 Schedule paySchedule = MakeSchedule().from(settlementDate).to(settlementDate +
term_).withTenor(
payTenor_);
52 Schedule recSchedule = MakeSchedule().from(settlementDate).to(settlementDate +
term_).withTenor(
recTenor_);
53 Currency payCurrency = EURCurrency();
54 Currency recCurrency = GBPCurrency();
55 QuantLib::ext::shared_ptr<Quote> fx(
new SimpleQuote(1.0));
56 swap_ = QuantLib::ext::shared_ptr<OvernightIndexedCrossCcyBasisSwap>(
66 swap_->setPricingEngine(engine);
70 swap_->setPricingEngine(engine);
73 earliestDate_ =
swap_->startDate();
74 latestDate_ =
swap_->maturityDate();
80 termStructureHandle_.linkTo(QuantLib::ext::shared_ptr<YieldTermStructure>(t, null_deleter()),
false);
81 RelativeDateRateHelper::setTermStructure(t);
85 QL_REQUIRE(termStructure_ != 0,
"term structure not set");
89 return swap_->fairPayLegSpread();
91 return swap_->fairRecLegSpread();
95 Visitor<OICCBSHelper>* v1 =
dynamic_cast<Visitor<OICCBSHelper>*
>(&v);
99 RateHelper::accept(v);
bool fixedDiscountOnPayLeg_
void setTermStructure(YieldTermStructure *) override
QuantLib::ext::shared_ptr< OvernightIndex > recIndex_
OICCBSHelper(Natural settlementDays, const Period &term, const QuantLib::ext::shared_ptr< OvernightIndex > &payIndex, const Period &payTenor, const QuantLib::ext::shared_ptr< OvernightIndex > &recIndex, const Period &recTenor, const Handle< Quote > &spreadQuote, const Handle< YieldTermStructure > &fixedDiscountCurve, bool spreadQuoteOnPayLeg, bool fixedDiscountOnPayLeg)
RelinkableHandle< YieldTermStructure > termStructureHandle_
void accept(AcyclicVisitor &) override
QuantLib::ext::shared_ptr< OvernightIndexedCrossCcyBasisSwap > swap_
void initializeDates() override
Real impliedQuote() const override
QuantLib::ext::shared_ptr< OvernightIndex > payIndex_
bool spreadQuoteOnPayLeg_
Handle< YieldTermStructure > fixedDiscountCurve_
Basis swap: compounded overnight rate in ccy 1 vs. compounded overnight rate in ccy 2.
RelativeDateBootstrapHelper< YieldTermStructure > RelativeDateRateHelper
Overnight Indexed Cross Currency Basis Swap Engine.
Overnight Indexed Cross Currency Basis Swap helpers.