Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
List of all members
CrossCurrencyPriceTermStructure Class Reference

Cross currency price term structure. More...

#include <qle/termstructures/crosscurrencypricetermstructure.hpp>

+ Inheritance diagram for CrossCurrencyPriceTermStructure:
+ Collaboration diagram for CrossCurrencyPriceTermStructure:

Public Member Functions

Constructors
 CrossCurrencyPriceTermStructure (const QuantLib::Date &referenceDate, const QuantLib::Handle< PriceTermStructure > &basePriceTs, const QuantLib::Handle< QuantLib::Quote > &fxSpot, const QuantLib::Handle< QuantLib::YieldTermStructure > &baseCurrencyYts, const QuantLib::Handle< QuantLib::YieldTermStructure > &yts, const QuantLib::Currency &currency)
 
 CrossCurrencyPriceTermStructure (QuantLib::Natural settlementDays, const QuantLib::Handle< PriceTermStructure > &basePriceTs, const QuantLib::Handle< QuantLib::Quote > &fxSpot, const QuantLib::Handle< QuantLib::YieldTermStructure > &baseCurrencyYts, const QuantLib::Handle< QuantLib::YieldTermStructure > &yts, const QuantLib::Currency &currency)
 
TermStructure interface
QuantLib::Date maxDate () const override
 
QuantLib::Time maxTime () const override
 
PriceTermStructure interface
QuantLib::Time minTime () const override
 The minimum time for which the curve can return values. More...
 
std::vector< QuantLib::Date > pillarDates () const override
 The pillar dates for the PriceTermStructure. More...
 
const QuantLib::Currency & currency () const override
 The currency in which prices are expressed. More...
 
- Public Member Functions inherited from PriceTermStructure
 PriceTermStructure (const QuantLib::DayCounter &dc=QuantLib::DayCounter())
 
 PriceTermStructure (const QuantLib::Date &referenceDate, const QuantLib::Calendar &cal=QuantLib::Calendar(), const QuantLib::DayCounter &dc=QuantLib::DayCounter())
 
 PriceTermStructure (QuantLib::Natural settlementDays, const QuantLib::Calendar &cal, const QuantLib::DayCounter &dc=QuantLib::DayCounter())
 
QuantLib::Real price (QuantLib::Time t, bool extrapolate=false) const
 
QuantLib::Real price (const QuantLib::Date &d, bool extrapolate=false) const
 
void update () override
 

Inspectors

QuantLib::Handle< PriceTermStructurebasePriceTs_
 
QuantLib::Handle< QuantLib::Quote > fxSpot_
 
QuantLib::Handle< QuantLib::YieldTermStructure > baseCurrencyYts_
 
QuantLib::Handle< QuantLib::YieldTermStructure > yts_
 
QuantLib::Currency currency_
 
const QuantLib::Handle< PriceTermStructure > & basePriceTs () const
 The price term structure in base currency. More...
 
const QuantLib::Handle< QuantLib::Quote > & fxSpot () const
 The FX spot rate, number of units of this price term structure's currency per unit of the base currency. More...
 
const QuantLib::Handle< QuantLib::YieldTermStructure > & baseCurrencyYts () const
 The yield term structure for the base currency. More...
 
const QuantLib::Handle< QuantLib::YieldTermStructure > & yts () const
 The yield term structure for this price term structure's currency. More...
 
QuantLib::Real priceImpl (QuantLib::Time t) const override
 Price calculation. More...
 
void registration ()
 Register with underlying market data. More...
 

Additional Inherited Members

- Protected Member Functions inherited from PriceTermStructure
void checkRange (QuantLib::Time t, bool extrapolate) const
 Extra time range check for minimum time, then calls TermStructure::checkRange. More...
 

Detailed Description

Cross currency price term structure.

This class creates a price term structure in a given currency using an already constructed price term structure in a different currency.

Definition at line 37 of file crosscurrencypricetermstructure.hpp.

Constructor & Destructor Documentation

◆ CrossCurrencyPriceTermStructure() [1/2]

CrossCurrencyPriceTermStructure ( const QuantLib::Date &  referenceDate,
const QuantLib::Handle< PriceTermStructure > &  basePriceTs,
const QuantLib::Handle< QuantLib::Quote > &  fxSpot,
const QuantLib::Handle< QuantLib::YieldTermStructure > &  baseCurrencyYts,
const QuantLib::Handle< QuantLib::YieldTermStructure > &  yts,
const QuantLib::Currency &  currency 
)

Fixed reference date based price term structure.

Parameters
referenceDateThis price term structure's reference date.
basePriceTsThe price term structure in base currency units.
fxSpotThe number of units of this price term structure's currency per unit of the base price term structure's currency.
baseCurrencyYtsThe yield term structure for the base currency.
ytsThe yield term structure for this price term structure's currency.
currencyThe price term structure's currency.

Definition at line 34 of file crosscurrencypricetermstructure.cpp.

39 : PriceTermStructure(referenceDate, basePriceTs->calendar(), basePriceTs->dayCounter()), basePriceTs_(basePriceTs),
42}
const QuantLib::Handle< QuantLib::YieldTermStructure > & baseCurrencyYts() const
The yield term structure for the base currency.
const QuantLib::Handle< QuantLib::YieldTermStructure > & yts() const
The yield term structure for this price term structure's currency.
const QuantLib::Currency & currency() const override
The currency in which prices are expressed.
const QuantLib::Handle< QuantLib::Quote > & fxSpot() const
The FX spot rate, number of units of this price term structure's currency per unit of the base curren...
const QuantLib::Handle< PriceTermStructure > & basePriceTs() const
The price term structure in base currency.
void registration()
Register with underlying market data.
QuantLib::Handle< QuantLib::YieldTermStructure > baseCurrencyYts_
QuantLib::Handle< QuantLib::YieldTermStructure > yts_
QuantLib::Handle< PriceTermStructure > basePriceTs_
PriceTermStructure(const QuantLib::DayCounter &dc=QuantLib::DayCounter())
+ Here is the call graph for this function:

◆ CrossCurrencyPriceTermStructure() [2/2]

CrossCurrencyPriceTermStructure ( QuantLib::Natural  settlementDays,
const QuantLib::Handle< PriceTermStructure > &  basePriceTs,
const QuantLib::Handle< QuantLib::Quote > &  fxSpot,
const QuantLib::Handle< QuantLib::YieldTermStructure > &  baseCurrencyYts,
const QuantLib::Handle< QuantLib::YieldTermStructure > &  yts,
const QuantLib::Currency &  currency 
)

Floating reference date based price term structure.

Parameters
settlementDaysThis price term structure's settlement days.
basePriceTsThe price term structure in base currency units.
fxSpotThe number of units of this price term structure's currency per unit of the base price term structure's currency.
baseCurrencyYtsThe yield term structure for the base currency.
ytsThe yield term structure for this price term structure's currency.
currencyThe price term structure's currency.

Member Function Documentation

◆ maxDate()

Date maxDate ( ) const
override

Definition at line 54 of file crosscurrencypricetermstructure.cpp.

54 {
55 return min(basePriceTs_->maxDate(), min(baseCurrencyYts_->maxDate(), yts_->maxDate()));
56}
CompiledFormula min(CompiledFormula x, const CompiledFormula &y)
+ Here is the call graph for this function:

◆ maxTime()

Time maxTime ( ) const
override

Definition at line 58 of file crosscurrencypricetermstructure.cpp.

58 {
59 return min(basePriceTs_->maxTime(), min(baseCurrencyYts_->maxTime(), yts_->maxTime()));
60}
+ Here is the call graph for this function:

◆ minTime()

Time minTime ( ) const
overridevirtual

The minimum time for which the curve can return values.

Reimplemented from PriceTermStructure.

Definition at line 62 of file crosscurrencypricetermstructure.cpp.

62{ return basePriceTs_->minTime(); }

◆ pillarDates()

vector< Date > pillarDates ( ) const
overridevirtual

The pillar dates for the PriceTermStructure.

Implements PriceTermStructure.

Definition at line 64 of file crosscurrencypricetermstructure.cpp.

64{ return basePriceTs_->pillarDates(); }

◆ currency()

const QuantLib::Currency & currency ( ) const
overridevirtual

The currency in which prices are expressed.

Implements PriceTermStructure.

Definition at line 84 of file crosscurrencypricetermstructure.hpp.

84{ return currency_; }

◆ basePriceTs()

const QuantLib::Handle< PriceTermStructure > & basePriceTs ( ) const

The price term structure in base currency.

Definition at line 90 of file crosscurrencypricetermstructure.hpp.

90{ return basePriceTs_; }

◆ fxSpot()

const QuantLib::Handle< QuantLib::Quote > & fxSpot ( ) const

The FX spot rate, number of units of this price term structure's currency per unit of the base currency.

Definition at line 93 of file crosscurrencypricetermstructure.hpp.

93{ return fxSpot_; }

◆ baseCurrencyYts()

const QuantLib::Handle< QuantLib::YieldTermStructure > & baseCurrencyYts ( ) const

The yield term structure for the base currency.

Definition at line 96 of file crosscurrencypricetermstructure.hpp.

96{ return baseCurrencyYts_; }

◆ yts()

const QuantLib::Handle< QuantLib::YieldTermStructure > & yts ( ) const

The yield term structure for this price term structure's currency.

Definition at line 99 of file crosscurrencypricetermstructure.hpp.

99{ return yts_; }

◆ priceImpl()

QuantLib::Real priceImpl ( QuantLib::Time  t) const
overrideprotectedvirtual

Price calculation.

Implements PriceTermStructure.

Definition at line 66 of file crosscurrencypricetermstructure.cpp.

66 {
67 // Price in base currency times the FX forward, number of units of currency per unit of base currency.
68 return basePriceTs_->price(t, true) * fxSpot_->value() * baseCurrencyYts_->discount(t, true) /
69 yts_->discount(t, true);
70}

◆ registration()

void registration ( )
private

Register with underlying market data.

Definition at line 72 of file crosscurrencypricetermstructure.cpp.

72 {
73 registerWith(basePriceTs_);
74 registerWith(fxSpot_);
75 registerWith(baseCurrencyYts_);
76 registerWith(yts_);
77}
+ Here is the caller graph for this function:

Member Data Documentation

◆ basePriceTs_

QuantLib::Handle<PriceTermStructure> basePriceTs_
private

Definition at line 110 of file crosscurrencypricetermstructure.hpp.

◆ fxSpot_

QuantLib::Handle<QuantLib::Quote> fxSpot_
private

Definition at line 111 of file crosscurrencypricetermstructure.hpp.

◆ baseCurrencyYts_

QuantLib::Handle<QuantLib::YieldTermStructure> baseCurrencyYts_
private

Definition at line 112 of file crosscurrencypricetermstructure.hpp.

◆ yts_

QuantLib::Handle<QuantLib::YieldTermStructure> yts_
private

Definition at line 113 of file crosscurrencypricetermstructure.hpp.

◆ currency_

QuantLib::Currency currency_
private

Definition at line 114 of file crosscurrencypricetermstructure.hpp.