Logo
Reference manual - version qle_version
FxIndex Class Reference

FX Index. More...

#include <qle/indexes/fxindex.hpp>

Inheritance diagram for FxIndex:

Public Member Functions

 FxIndex (const std::string &familyName, Natural fixingDays, const Currency &source, const Currency &target, const Calendar &fixingCalendar, const Handle< YieldTermStructure > &sourceYts=Handle< YieldTermStructure >(), const Handle< YieldTermStructure > &targetYts=Handle< YieldTermStructure >(), bool fixingTriangulation=false)
 FxIndex (const std::string &familyName, Natural fixingDays, const Currency &source, const Currency &target, const Calendar &fixingCalendar, const Handle< Quote > fxSpot, const Handle< YieldTermStructure > &sourceYts=Handle< YieldTermStructure >(), const Handle< YieldTermStructure > &targetYts=Handle< YieldTermStructure >(), bool fixingTriangulation=true)
Index interface
std::string name () const override
Calendar fixingCalendar () const override
bool isValidFixingDate (const Date &fixingDate) const override
Real fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override
Observer interface
void update () override
Inspectors
std::string familyName () const
std::string oreName () const
Natural fixingDays () const
Date fixingDate (const Date &valueDate) const
const Currency & sourceCurrency () const
const Currency & targetCurrency () const
const Handle< YieldTermStructure > & sourceCurve () const
const Handle< YieldTermStructure > & targetCurve () const
const Handle< QuotefxQuote (bool withSettlementLag=false) const
 fxQuote returns instantaneous Quote by default, otherwise settlement after fixingDays
const bool useQuote () const
Date calculations
virtual Date valueDate (const Date &fixingDate) const

Fixing calculations

std::string familyName_
std::string oreName_
Natural fixingDays_
Currency sourceCurrency_
Currency targetCurrency_
const Handle< YieldTermStructure > sourceYts_
const Handle< YieldTermStructure > targetYts_
std::string name_
const Handle< QuotefxSpot_
Handle< QuotefxRate_
bool useQuote_
virtual Real forecastFixing (const Time &fixingTime) const override
 It can be overridden to implement particular conventions.
virtual Real forecastFixing (const Date &fixingDate) const
Real pastFixing (const Date &fixingDate) const override
 returns a past fixing at the given date
QuantLib::ext::shared_ptr< FxIndexclone (const Handle< Quote > fxQuote=Handle< Quote >(), const Handle< YieldTermStructure > &sourceYts=Handle< YieldTermStructure >(), const Handle< YieldTermStructure > &targetYts=Handle< YieldTermStructure >(), const std::string &familyName=std::string())
 clone the index, the clone will be linked to the provided handles

Detailed Description

FX Index.

Constructor & Destructor Documentation

◆ FxIndex()

FxIndex ( const std::string & familyName,
Natural fixingDays,
const Currency & source,
const Currency & target,
const Calendar & fixingCalendar,
const Handle< YieldTermStructure > & sourceYts = Handle< YieldTermStructure >(),
const Handle< YieldTermStructure > & targetYts = Handle< YieldTermStructure >(),
bool fixingTriangulation = false )

familyName may be e.g. ECB fixingDays determine the spot date of the currency pair source is the asset or foreign currency target is the numeraire or domestic currency fixingCalendar is the calendar defining good days for the pair this class uses the exchange rate manager to retrieve spot values fxSpot is the fx rate settled at today + fixingDays

Member Function Documentation

◆ forecastFixing()

virtual Real forecastFixing ( const Time & fixingTime) const
overridevirtual

It can be overridden to implement particular conventions.

Implements EqFxIndexBase.

◆ pastFixing()

Real pastFixing ( const Date & fixingDate) const
overridevirtual

returns a past fixing at the given date

the date passed as arguments must be the actual calendar date of the fixing; no settlement days must be used.

Implements EqFxIndexBase.