QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Public Member Functions | List of all members
FxSwapRateHelper Class Reference

Rate helper for bootstrapping over Fx Swap rates. More...

#include <ql/termstructures/yield/ratehelpers.hpp>

+ Inheritance diagram for FxSwapRateHelper:
+ Collaboration diagram for FxSwapRateHelper:

Public Member Functions

 FxSwapRateHelper (const Handle< Quote > &fwdPoint, Handle< Quote > spotFx, const Period &tenor, Natural fixingDays, Calendar calendar, BusinessDayConvention convention, bool endOfMonth, bool isFxBaseCurrencyCollateralCurrency, Handle< YieldTermStructure > collateralCurve, Calendar tradingCalendar=Calendar())
 
RateHelper interface
Real impliedQuote () const override
 
void setTermStructure (YieldTermStructure *) override
 
FxSwapRateHelper inspectors
Real spot () const
 
Period tenor () const
 
Natural fixingDays () const
 
Calendar calendar () const
 
BusinessDayConvention businessDayConvention () const
 
bool endOfMonth () const
 
bool isFxBaseCurrencyCollateralCurrency () const
 
Calendar tradingCalendar () const
 
Calendar adjustmentCalendar () const
 
- Public Member Functions inherited from RelativeDateBootstrapHelper< TS >
 RelativeDateBootstrapHelper (const Handle< Quote > &quote)
 
 RelativeDateBootstrapHelper (Real quote)
 
void update () override
 
- Public Member Functions inherited from BootstrapHelper< TS >
 BootstrapHelper (Handle< Quote > quote)
 
 BootstrapHelper (Real quote)
 
 ~BootstrapHelper () override=default
 
const Handle< Quote > & quote () const
 
Real quoteError () const
 
virtual void setTermStructure (TS *)
 sets the term structure to be used for pricing More...
 
virtual Date earliestDate () const
 earliest relevant date More...
 
virtual Date maturityDate () const
 instrument's maturity date More...
 
virtual Date latestRelevantDate () const
 latest relevant date More...
 
virtual Date pillarDate () const
 pillar date More...
 
virtual Date latestDate () const
 latest date More...
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 

Visitability

Handle< Quotespot_
 
Period tenor_
 
Natural fixingDays_
 
Calendar cal_
 
BusinessDayConvention conv_
 
bool eom_
 
bool isFxBaseCurrencyCollateralCurrency_
 
RelinkableHandle< YieldTermStructuretermStructureHandle_
 
Handle< YieldTermStructurecollHandle_
 
RelinkableHandle< YieldTermStructurecollRelinkableHandle_
 
Calendar tradingCalendar_
 
Calendar jointCalendar_
 
void accept (AcyclicVisitor &) override
 
void initializeDates () override
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from RelativeDateBootstrapHelper< TS >
- Protected Attributes inherited from RelativeDateBootstrapHelper< TS >
Date evaluationDate_
 
- Protected Attributes inherited from BootstrapHelper< TS >
Handle< Quotequote_
 
TS * termStructure_
 
Date earliestDate_
 
Date latestDate_
 
Date maturityDate_
 
Date latestRelevantDate_
 
Date pillarDate_
 

Detailed Description

Rate helper for bootstrapping over Fx Swap rates.

The forward is given by fwdFx = spotFx + fwdPoint.

isFxBaseCurrencyCollateralCurrency indicates if the base currency of the FX currency pair is the one used as collateral.

calendar is usually the joint calendar of the two currencies in the pair.

tradingCalendar can be used when the cross pairs don't include the currency of the business center (usually USD; the corresponding calendar is UnitedStates). If given, it will be used for adjusting the earliest settlement date and for setting the latest date. Due to FX spot market conventions, it is not sufficient to pass a JointCalendar with UnitedStates included as calendar; with regard the earliest date, this calendar is only used in case the spot date of the two currencies is not a US business day.

Warning:
The ON fx swaps can be achieved by setting fixingDays to 0 and using a tenor of '1d'. The same tenor should be used for TN swaps, with fixingDays set to 1. However, handling ON and TN swaps for cross rates without USD is not trivial and should be treated with caution. If today is a US holiday, ON trade is not possible. If tomorrow is a US Holiday, the ON trade will be at least two business days long in the other countries and the TN trade will not exist. In such cases, if this helper is used for curve construction, probably it is safer not to pass a trading calendar to the ON and TN helpers and provide fwdPoints that will yield proper level of discount factors.

Definition at line 427 of file ratehelpers.hpp.

Constructor & Destructor Documentation

◆ FxSwapRateHelper()

FxSwapRateHelper ( const Handle< Quote > &  fwdPoint,
Handle< Quote spotFx,
const Period tenor,
Natural  fixingDays,
Calendar  calendar,
BusinessDayConvention  convention,
bool  endOfMonth,
bool  isFxBaseCurrencyCollateralCurrency,
Handle< YieldTermStructure collateralCurve,
Calendar  tradingCalendar = Calendar() 
)

Definition at line 1006 of file ratehelpers.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ impliedQuote()

Real impliedQuote ( ) const
overridevirtual

Implements BootstrapHelper< TS >.

Definition at line 1047 of file ratehelpers.cpp.

+ Here is the call graph for this function:

◆ setTermStructure()

void setTermStructure ( YieldTermStructure t)
override

Definition at line 1066 of file ratehelpers.cpp.

+ Here is the call graph for this function:

◆ spot()

Real spot ( ) const

Definition at line 446 of file ratehelpers.hpp.

+ Here is the caller graph for this function:

◆ tenor()

Period tenor ( ) const

Definition at line 447 of file ratehelpers.hpp.

◆ fixingDays()

Natural fixingDays ( ) const

Definition at line 448 of file ratehelpers.hpp.

◆ calendar()

Calendar calendar ( ) const

Definition at line 449 of file ratehelpers.hpp.

◆ businessDayConvention()

BusinessDayConvention businessDayConvention ( ) const

Definition at line 450 of file ratehelpers.hpp.

◆ endOfMonth()

bool endOfMonth ( ) const

Definition at line 451 of file ratehelpers.hpp.

◆ isFxBaseCurrencyCollateralCurrency()

bool isFxBaseCurrencyCollateralCurrency ( ) const

Definition at line 452 of file ratehelpers.hpp.

◆ tradingCalendar()

Calendar tradingCalendar ( ) const

Definition at line 454 of file ratehelpers.hpp.

◆ adjustmentCalendar()

Calendar adjustmentCalendar ( ) const

Definition at line 455 of file ratehelpers.hpp.

◆ accept()

void accept ( AcyclicVisitor v)
overridevirtual

Reimplemented from BootstrapHelper< TS >.

Definition at line 1079 of file ratehelpers.cpp.

+ Here is the call graph for this function:

◆ initializeDates()

void initializeDates ( )
overrideprivatevirtual

Implements RelativeDateBootstrapHelper< TS >.

Definition at line 1031 of file ratehelpers.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ spot_

Handle<Quote> spot_
private

Definition at line 463 of file ratehelpers.hpp.

◆ tenor_

Period tenor_
private

Definition at line 464 of file ratehelpers.hpp.

◆ fixingDays_

Natural fixingDays_
private

Definition at line 465 of file ratehelpers.hpp.

◆ cal_

Calendar cal_
private

Definition at line 466 of file ratehelpers.hpp.

◆ conv_

BusinessDayConvention conv_
private

Definition at line 467 of file ratehelpers.hpp.

◆ eom_

bool eom_
private

Definition at line 468 of file ratehelpers.hpp.

◆ isFxBaseCurrencyCollateralCurrency_

bool isFxBaseCurrencyCollateralCurrency_
private

Definition at line 469 of file ratehelpers.hpp.

◆ termStructureHandle_

RelinkableHandle<YieldTermStructure> termStructureHandle_
private

Definition at line 471 of file ratehelpers.hpp.

◆ collHandle_

Handle<YieldTermStructure> collHandle_
private

Definition at line 473 of file ratehelpers.hpp.

◆ collRelinkableHandle_

RelinkableHandle<YieldTermStructure> collRelinkableHandle_
private

Definition at line 474 of file ratehelpers.hpp.

◆ tradingCalendar_

Calendar tradingCalendar_
private

Definition at line 476 of file ratehelpers.hpp.

◆ jointCalendar_

Calendar jointCalendar_
private

Definition at line 477 of file ratehelpers.hpp.