Logo
Reference manual - version ored_version
Public Types | Public Member Functions | Friends | List of all members
RequiredFixings Class Reference

#include <ored/portfolio/fixingdates.hpp>

Public Types

using FixingEntry = std::tuple< std::string, QuantLib::Date, QuantLib::Date, bool >
 
using InflationFixingEntry = std::tuple< FixingEntry, bool, Frequency, Period >
 
using ZeroInflationFixingEntry = std::tuple< InflationFixingEntry, CPI::InterpolationType, Frequency >
 

Public Member Functions

std::map< std::string, std::set< QuantLib::Date > > fixingDatesIndices (const QuantLib::Date &settlementDate=QuantLib::Date()) const
 
void addFixingDate (const QuantLib::Date &fixingDate, const std::string &indexName, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false)
 
void addFixingDate (const FixingEntry &fixingEntry)
 
void addFixingDates (const std::vector< QuantLib::Date > &fixingDates, const std::string &indexName, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false)
 
void addZeroInflationFixingDate (const QuantLib::Date &fixingDate, const std::string &indexName, const bool indexInterpolated, const Frequency indexFrequency, const Period &indexAvailabilityLag, const CPI::InterpolationType coupopnInterpolation, const Frequency couponFrequency, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false)
 
void addZeroInflationFixingDate (const ZeroInflationFixingEntry &fixingEntry)
 
void addYoYInflationFixingDate (const QuantLib::Date &fixingDate, const std::string &indexName, const bool indexInterpolated, const Frequency indexFrequency, const Period &indexAvailabilityLag, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false)
 
void addYoYInflationFixingDate (const InflationFixingEntry &fixingEntry)
 
void clear ()
 
void addData (const RequiredFixings &requiredFixings)
 
void unsetPayDates ()
 
RequiredFixings filteredFixingDates (const QuantLib::Date &settlementDate=QuantLib::Date())
 

Friends

std::ostream & operator<< (std::ostream &, const RequiredFixings &)
 

Detailed Description

Class holding the information on the fixings required to price a trade (or a portfolio of trades).

Member Function Documentation

◆ fixingDatesIndices()

std::map<std::string, std::set<QuantLib::Date> > fixingDatesIndices ( const QuantLib::Date &  settlementDate = QuantLib::Date()) const

Gives back the dates for which fixings will be required to price the trade assuming a given settlementDate. If the settlementDate is not provided or is set equal to QuantLib::Date(), the settlement date in the implementation is assumed to be the Settings::instance().evaluationDate().

If a cashflow payment is deemed to have already occurred relative to the settlement date, then no fixing is needed. The determination of whether a cashflow has or has not occurred will in general rely on a call to CashFlow::hasOccurred which is important in cases where the cash flow payment date falls on the settlement date.

Another important case is where a cash flow fixing date occurs on the settlement date. In this case, we should always add the fixing date to the set of fixing dates regardless of Settings::instance().enforcesTodaysHistoricFixings().

◆ addFixingDate()

void addFixingDate ( const QuantLib::Date &  fixingDate,
const std::string &  indexName,
const QuantLib::Date &  payDate = Date::maxDate(),
const bool  alwaysAddIfPaysOnSettlement = false 
)

Adds a single fixing date fixingDate for an index given by its ORE index name indexName arising from a coupon with payment date payDate. If alwaysAddIfPaysOnSettlement is true the fixing date will be added if the coupon pays on the settlement date even if the cashflow returns hasOccured(settlementDate) as true. This is conservative and necessary in some cases since some pricing engines in QL (e.g. CapFloor) do not respect hasOccured() and ask for the fixing regardless. If the payDate is not given, it defaults to Date::maxDate() meaning that the added fixing is relevant unconditional on a pay date

◆ addFixingDates()

void addFixingDates ( const std::vector< QuantLib::Date > &  fixingDates,
const std::string &  indexName,
const QuantLib::Date &  payDate = Date::maxDate(),
const bool  alwaysAddIfPaysOnSettlement = false 
)

adds a vector of fixings dates fixingDates for an index given by is ORE index name indexName arising from a coupon with payment date payDate

◆ addZeroInflationFixingDate()

void addZeroInflationFixingDate ( const QuantLib::Date &  fixingDate,
const std::string &  indexName,
const bool  indexInterpolated,
const Frequency  indexFrequency,
const Period &  indexAvailabilityLag,
const CPI::InterpolationType  coupopnInterpolation,
const Frequency  couponFrequency,
const QuantLib::Date &  payDate = Date::maxDate(),
const bool  alwaysAddIfPaysOnSettlement = false 
)

add a single fixing date fixingDate for a coupon based on a zero inflation index given by its ORE index name indexName with payment date payDate

◆ addYoYInflationFixingDate()

void addYoYInflationFixingDate ( const QuantLib::Date &  fixingDate,
const std::string &  indexName,
const bool  indexInterpolated,
const Frequency  indexFrequency,
const Period &  indexAvailabilityLag,
const QuantLib::Date &  payDate = Date::maxDate(),
const bool  alwaysAddIfPaysOnSettlement = false 
)

add a single fixing date fixingDate for a coupon based on a yoy inflation index given by its ORE index name indexName with payment date payDate

◆ clear()

void clear ( )

clear all data

◆ addData()

void addData ( const RequiredFixings requiredFixings)

add data from another RequiredFixings instance

◆ unsetPayDates()

void unsetPayDates ( )

Set all pay dates to Date::maxDate(), fixingDatesIndices() will then not filter the required fixings by the given settlement date any more. Needed by total return swaps on bonds for example, where a cashflow in a bond with past payment date can still be relevant for the payment of the current return period.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
const RequiredFixings  
)
friend

allow output of required fixings data via streams