Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
OICCBSHelper Class Reference

Rate helper for bootstrapping over Overnight Indexed CC Basis Swap Spreads. More...

#include <qle/termstructures/oiccbasisswaphelper.hpp>

+ Inheritance diagram for OICCBSHelper:
+ Collaboration diagram for OICCBSHelper:

Public Member Functions

 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)
 
RateHelper interface
Real impliedQuote () const override
 
void setTermStructure (YieldTermStructure *) override
 
inspectors
QuantLib::ext::shared_ptr< OvernightIndexedCrossCcyBasisSwapswap () const
 

Visitability

Natural settlementDays_
 
Period term_
 
QuantLib::ext::shared_ptr< OvernightIndex > payIndex_
 
Period payTenor_
 
QuantLib::ext::shared_ptr< OvernightIndex > recIndex_
 
Period recTenor_
 
Handle< YieldTermStructure > fixedDiscountCurve_
 
bool spreadQuoteOnPayLeg_
 
bool fixedDiscountOnPayLeg_
 
QuantLib::ext::shared_ptr< OvernightIndexedCrossCcyBasisSwapswap_
 
RelinkableHandle< YieldTermStructure > termStructureHandle_
 
void accept (AcyclicVisitor &) override
 
void initializeDates () override
 

Detailed Description

Rate helper for bootstrapping over Overnight Indexed CC Basis Swap Spreads.

Definition at line 39 of file oiccbasisswaphelper.hpp.

Constructor & Destructor Documentation

◆ OICCBSHelper()

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 
)

Definition at line 31 of file oiccbasisswaphelper.cpp.

38 : RelativeDateRateHelper(spreadQuote), settlementDays_(settlementDays), term_(term), payIndex_(payIndex),
39 payTenor_(payTenor), recIndex_(recIndex), recTenor_(recTenor), fixedDiscountCurve_(fixedDiscountCurve),
40 spreadQuoteOnPayLeg_(spreadQuoteOnPayLeg), fixedDiscountOnPayLeg_(fixedDiscountOnPayLeg) {
41
42 registerWith(payIndex_);
43 registerWith(recIndex_);
44 registerWith(fixedDiscountCurve_);
46}
QuantLib::ext::shared_ptr< OvernightIndex > recIndex_
QuantLib::ext::shared_ptr< OvernightIndex > payIndex_
Handle< YieldTermStructure > fixedDiscountCurve_
RelativeDateBootstrapHelper< YieldTermStructure > RelativeDateRateHelper
+ Here is the call graph for this function:

Member Function Documentation

◆ impliedQuote()

Real impliedQuote ( ) const
override

Definition at line 84 of file oiccbasisswaphelper.cpp.

84 {
85 QL_REQUIRE(termStructure_ != 0, "term structure not set");
86 // we didn't register as observers - force calculation
87 swap_->deepUpdate();
89 return swap_->fairPayLegSpread();
90 else
91 return swap_->fairRecLegSpread();
92}
QuantLib::ext::shared_ptr< OvernightIndexedCrossCcyBasisSwap > swap_

◆ setTermStructure()

void setTermStructure ( YieldTermStructure *  t)
override

Definition at line 77 of file oiccbasisswaphelper.cpp.

77 {
78 // do not set the relinkable handle as an observer -
79 // force recalculation when needed
80 termStructureHandle_.linkTo(QuantLib::ext::shared_ptr<YieldTermStructure>(t, null_deleter()), false);
81 RelativeDateRateHelper::setTermStructure(t);
82}
RelinkableHandle< YieldTermStructure > termStructureHandle_

◆ swap()

QuantLib::ext::shared_ptr< OvernightIndexedCrossCcyBasisSwap > swap ( ) const

Definition at line 54 of file oiccbasisswaphelper.hpp.

54{ return swap_; }

◆ accept()

void accept ( AcyclicVisitor &  v)
override

Definition at line 94 of file oiccbasisswaphelper.cpp.

94 {
95 Visitor<OICCBSHelper>* v1 = dynamic_cast<Visitor<OICCBSHelper>*>(&v);
96 if (v1 != 0)
97 v1->visit(*this);
98 else
99 RateHelper::accept(v);
100}

◆ initializeDates()

void initializeDates ( )
overrideprotected

Definition at line 48 of file oiccbasisswaphelper.cpp.

48 {
49 Date asof = Settings::instance().evaluationDate();
50 Date settlementDate = payIndex_->fixingCalendar().advance(asof, settlementDays_, Days);
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(); // arbitrary here
54 Currency recCurrency = GBPCurrency(); // recCcy != payCcy, but FX=1
55 QuantLib::ext::shared_ptr<Quote> fx(new SimpleQuote(1.0));
56 swap_ = QuantLib::ext::shared_ptr<OvernightIndexedCrossCcyBasisSwap>(
57 new OvernightIndexedCrossCcyBasisSwap(10000.0, // arbitrary payNominal
58 payCurrency, paySchedule, payIndex_,
59 0.0, // zero pay spread
60 10000.0, // recNominal consistent with FX rate used
61 recCurrency, recSchedule, recIndex_,
62 0.0)); // target receive spread
64 QuantLib::ext::shared_ptr<PricingEngine> engine(new OvernightIndexedCrossCcyBasisSwapEngine(
65 fixedDiscountCurve_, payCurrency, termStructureHandle_, recCurrency, Handle<Quote>(fx)));
66 swap_->setPricingEngine(engine);
67 } else {
68 QuantLib::ext::shared_ptr<PricingEngine> engine(new OvernightIndexedCrossCcyBasisSwapEngine(
69 termStructureHandle_, payCurrency, fixedDiscountCurve_, recCurrency, Handle<Quote>(fx)));
70 swap_->setPricingEngine(engine);
71 }
72
73 earliestDate_ = swap_->startDate();
74 latestDate_ = swap_->maturityDate();
75}
+ Here is the caller graph for this function:

Member Data Documentation

◆ settlementDays_

Natural settlementDays_
protected

Definition at line 63 of file oiccbasisswaphelper.hpp.

◆ term_

Period term_
protected

Definition at line 64 of file oiccbasisswaphelper.hpp.

◆ payIndex_

QuantLib::ext::shared_ptr<OvernightIndex> payIndex_
protected

Definition at line 65 of file oiccbasisswaphelper.hpp.

◆ payTenor_

Period payTenor_
protected

Definition at line 66 of file oiccbasisswaphelper.hpp.

◆ recIndex_

QuantLib::ext::shared_ptr<OvernightIndex> recIndex_
protected

Definition at line 67 of file oiccbasisswaphelper.hpp.

◆ recTenor_

Period recTenor_
protected

Definition at line 68 of file oiccbasisswaphelper.hpp.

◆ fixedDiscountCurve_

Handle<YieldTermStructure> fixedDiscountCurve_
protected

Definition at line 69 of file oiccbasisswaphelper.hpp.

◆ spreadQuoteOnPayLeg_

bool spreadQuoteOnPayLeg_
protected

Definition at line 70 of file oiccbasisswaphelper.hpp.

◆ fixedDiscountOnPayLeg_

bool fixedDiscountOnPayLeg_
protected

Definition at line 71 of file oiccbasisswaphelper.hpp.

◆ swap_

QuantLib::ext::shared_ptr<OvernightIndexedCrossCcyBasisSwap> swap_
protected

Definition at line 73 of file oiccbasisswaphelper.hpp.

◆ termStructureHandle_

RelinkableHandle<YieldTermStructure> termStructureHandle_
protected

Definition at line 74 of file oiccbasisswaphelper.hpp.