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

#include <test/testmarket.hpp>

+ Inheritance diagram for TestMarketParCurves:
+ Collaboration diagram for TestMarketParCurves:

Public Member Functions

 TestMarketParCurves (const Date &asof)
 
const map< string, vector< string > > & discountRateHelpersInstMap () const
 
const map< string, vector< string > > & equityForecastRateHelpersInstMap () const
 
const map< string, vector< string > > & indexCurveRateHelperInstMap () const
 
const map< string, vector< string > > & defaultRateHelpersInstMap () const
 
const map< string, vector< string > > & zeroInflationRateHelperInstMap () const
 
const map< string, vector< string > > & yoyInflationRateHelperInstMap () const
 
const map< string, vector< Period > > & discountRateHelperTenorsMap () const
 
const map< string, vector< Period > > & equityForecastRateHelperTenorsMap () const
 
const map< string, vector< Period > > & indexCurveRateHelperTenorsMap () const
 
const map< string, vector< Period > > & defaultRateHelperTenorsMap () const
 
const map< string, vector< Period > > & cdsVolRateHelperTenorsMap () const
 
const map< string, vector< Period > > & swaptionVolRateHelperTenorsMap () const
 
const map< string, vector< Period > > & swaptionVolRateHelperSwapTenorsMap () const
 
const map< string, vector< Period > > & equityVolRateHelperTenorsMap () const
 
const map< string, vector< Period > > & baseCorrRateHelperTenorsMap () const
 
const map< string, vector< string > > & baseCorrLossLevelsMap () const
 
const map< string, vector< Period > > & zeroInflationRateHelperTenorsMap () const
 
const map< string, vector< Period > > & yoyInflationRateHelperTenorsMap () const
 
const map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > & equityForecastRateHelpersMap () const
 
const map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > & discountRateHelpersMap () const
 
const map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > & indexCurveRateHelpersMap () const
 
const map< string, vector< QuantLib::ext::shared_ptr< QuantExt::DefaultProbabilityHelper > > > & defaultRateHelpersMap () const
 
const map< string, vector< Handle< Quote > > > & discountRateHelperValuesMap () const
 
const map< string, vector< Handle< Quote > > > & equityForecastRateHelperValuesMap () const
 
const map< string, vector< Handle< Quote > > > & indexCurveRateHelperValuesMap () const
 
const map< string, vector< Handle< Quote > > > & defaultRateHelperValuesMap () const
 
const map< string, vector< Handle< Quote > > > & cdsVolRateHelperValuesMap () const
 
const map< string, vector< Handle< Quote > > > & swaptionVolRateHelperValuesMap () const
 
const map< string, vector< Handle< Quote > > > & equityVolRateHelperValuesMap () const
 
const map< string, vector< Handle< Quote > > > & baseCorrRateHelperValuesMap () const
 
const map< string, vector< Handle< Quote > > > & zeroInflationRateHelperValuesMap () const
 
const map< string, vector< Handle< Quote > > > & yoyInflationRateHelperValuesMap () const
 
- Public Member Functions inherited from MarketImpl
 MarketImpl (const bool handlePseudoCurrencies)
 
Date asofDate () const override
 
Handle< YieldTermStructure > yieldCurve (const YieldCurveType &type, const string &ccy, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > discountCurveImpl (const string &ccy, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > yieldCurve (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< IborIndexiborIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< SwapIndex > swapIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantLib::SwaptionVolatilityStructure > swaptionVol (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
string shortSwapIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
string swapIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantLib::SwaptionVolatilityStructure > yieldVol (const string &securityID, const string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantExt::FxIndexfxIndexImpl (const string &fxIndex, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > fxRateImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > fxSpotImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
 
Handle< BlackVolTermStructurefxVolImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::CreditCurvedefaultCurve (const string &, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > recoveryRate (const string &, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::CreditVolCurvecdsVol (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::BaseCorrelationTermStructurebaseCorrelation (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< OptionletVolatilityStructure > capFloorVol (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
std::pair< string, QuantLib::Period > capFloorVolIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::YoYOptionletVolatilitySurface > yoyCapFloorVol (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
virtual Handle< ZeroInflationIndex > zeroInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
virtual Handle< YoYInflationIndex > yoyInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
virtual Handle< CPIVolatilitySurface > cpiInflationCapFloorVolatilitySurface (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > equitySpot (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::EquityIndex2equityCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > equityDividendCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< BlackVolTermStructureequityVol (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > equityForecastCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > securitySpread (const string &securityID, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::InflationIndexObserverbaseCpis (const string &index, const string &configuration=Market::defaultConfiguration) const
 
QuantLib::Handle< QuantExt::PriceTermStructurecommodityPriceCurve (const string &commodityName, const string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantExt::CommodityIndexcommodityIndex (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantLib::BlackVolTermStructure > commodityVolatility (const string &commodityName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::CorrelationTermStructurecorrelationCurve (const string &index1, const string &index2, const string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< Quote > cpr (const string &securityID, const string &configuration=Market::defaultConfiguration) const override
 
 MarketImpl (const MarketImpl &)=delete
 
MarketImploperator= (const MarketImpl &)=delete
 
void refresh (const string &configuration=Market::defaultConfiguration) override
 
Date asofDate () const override
 
Handle< YieldTermStructure > yieldCurve (const YieldCurveType &type, const string &ccy, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > discountCurveImpl (const string &ccy, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > yieldCurve (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< IborIndexiborIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< SwapIndex > swapIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantLib::SwaptionVolatilityStructure > swaptionVol (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
string shortSwapIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
string swapIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantLib::SwaptionVolatilityStructure > yieldVol (const string &securityID, const string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantExt::FxIndexfxIndexImpl (const string &fxIndex, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > fxRateImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > fxSpotImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
 
Handle< BlackVolTermStructurefxVolImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::CreditCurvedefaultCurve (const string &, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > recoveryRate (const string &, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::CreditVolCurvecdsVol (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::BaseCorrelationTermStructurebaseCorrelation (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
Handle< OptionletVolatilityStructure > capFloorVol (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
std::pair< string, QuantLib::Period > capFloorVolIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::YoYOptionletVolatilitySurface > yoyCapFloorVol (const string &name, const string &configuration=Market::defaultConfiguration) const override
 
virtual Handle< ZeroInflationIndex > zeroInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
virtual Handle< YoYInflationIndex > yoyInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
virtual Handle< CPIVolatilitySurface > cpiInflationCapFloorVolatilitySurface (const string &indexName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > equitySpot (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::EquityIndex2equityCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > equityDividendCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< BlackVolTermStructureequityVol (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< YieldTermStructure > equityForecastCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< Quote > securitySpread (const string &securityID, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::InflationIndexObserverbaseCpis (const string &index, const string &configuration=Market::defaultConfiguration) const
 
QuantLib::Handle< QuantExt::PriceTermStructurecommodityPriceCurve (const string &commodityName, const string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantExt::CommodityIndexcommodityIndex (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< QuantLib::BlackVolTermStructure > commodityVolatility (const string &commodityName, const string &configuration=Market::defaultConfiguration) const override
 
Handle< QuantExt::CorrelationTermStructurecorrelationCurve (const string &index1, const string &index2, const string &configuration=Market::defaultConfiguration) const override
 
QuantLib::Handle< Quote > cpr (const string &securityID, const string &configuration=Market::defaultConfiguration) const override
 
- Public Member Functions inherited from Market
 Market (const bool handlePseudoCurrencies)
 
virtual ~Market ()
 
virtual Date asofDate () const=0
 
virtual Handle< YieldTermStructure > yieldCurve (const YieldCurveType &type, const string &name, const string &configuration=Market::defaultConfiguration) const=0
 
Handle< YieldTermStructure > discountCurve (const string &ccy, const string &configuration=Market::defaultConfiguration) const
 
virtual Handle< YieldTermStructure > discountCurveImpl (const string &ccy, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< YieldTermStructure > yieldCurve (const string &name, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< IborIndexiborIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< SwapIndex > swapIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< SwaptionVolatilityStructureswaptionVol (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual string shortSwapIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual string swapIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< SwaptionVolatilityStructureyieldVol (const string &securityID, const string &configuration=Market::defaultConfiguration) const=0
 
QuantLib::Handle< QuantExt::FxIndexfxIndex (const string &fxIndex, const string &configuration=Market::defaultConfiguration) const
 
virtual QuantLib::Handle< QuantExt::FxIndexfxIndexImpl (const string &fxIndex, const string &configuration=Market::defaultConfiguration) const=0
 
Handle< Quote > fxRate (const string &ccypair, const string &configuration=Market::defaultConfiguration) const
 
virtual Handle< Quote > fxRateImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const=0
 
Handle< Quote > fxSpot (const string &ccypair, const string &configuration=Market::defaultConfiguration) const
 
virtual Handle< Quote > fxSpotImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const=0
 
Handle< BlackVolTermStructurefxVol (const string &ccypair, const string &configuration=Market::defaultConfiguration) const
 
virtual Handle< BlackVolTermStructurefxVolImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::CreditCurvedefaultCurve (const string &, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< Quote > recoveryRate (const string &, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::CreditVolCurvecdsVol (const string &, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::BaseCorrelationTermStructurebaseCorrelation (const string &, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< OptionletVolatilityStructure > capFloorVol (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual std::pair< std::string, QuantLib::Period > capFloorVolIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::YoYOptionletVolatilitySurface > yoyCapFloorVol (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< ZeroInflationIndex > zeroInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< YoYInflationIndex > yoyInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< CPIVolatilitySurface > cpiInflationCapFloorVolatilitySurface (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< Quote > equitySpot (const string &eqName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< YieldTermStructure > equityDividendCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< YieldTermStructure > equityForecastCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::EquityIndex2equityCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< Quote > securitySpread (const string &securityID, const string &configuration=Market::defaultConfiguration) const=0
 
virtual QuantLib::Handle< QuantExt::PriceTermStructurecommodityPriceCurve (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const=0
 
virtual QuantLib::Handle< QuantExt::CommodityIndexcommodityIndex (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const=0
 
virtual QuantLib::Handle< QuantLib::BlackVolTermStructure > commodityVolatility (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const=0
 
virtual QuantLib::Handle< QuantExt::CorrelationTermStructurecorrelationCurve (const std::string &index1, const std::string &index2, const std::string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< BlackVolTermStructureequityVol (const string &eqName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual void refresh (const string &)
 
virtual Handle< Quote > cpr (const string &securityID, const string &configuration=Market::defaultConfiguration) const=0
 
string commodityCurveLookup (const string &pm) const
 
bool handlePseudoCurrencies () const
 
virtual Handle< YieldTermStructure > yieldCurve (const YieldCurveType &type, const string &name, const string &configuration=Market::defaultConfiguration) const=0
 
Handle< YieldTermStructure > discountCurve (const string &ccy, const string &configuration=Market::defaultConfiguration) const
 
virtual Handle< YieldTermStructure > discountCurveImpl (const string &ccy, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< YieldTermStructure > yieldCurve (const string &name, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< IborIndexiborIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< SwapIndex > swapIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< SwaptionVolatilityStructureswaptionVol (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual string shortSwapIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual string swapIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< SwaptionVolatilityStructureyieldVol (const string &securityID, const string &configuration=Market::defaultConfiguration) const=0
 
QuantLib::Handle< QuantExt::FxIndexfxIndex (const string &fxIndex, const string &configuration=Market::defaultConfiguration) const
 
virtual QuantLib::Handle< QuantExt::FxIndexfxIndexImpl (const string &fxIndex, const string &configuration=Market::defaultConfiguration) const=0
 
Handle< Quote > fxRate (const string &ccypair, const string &configuration=Market::defaultConfiguration) const
 
virtual Handle< Quote > fxRateImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const=0
 
Handle< Quote > fxSpot (const string &ccypair, const string &configuration=Market::defaultConfiguration) const
 
virtual Handle< Quote > fxSpotImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const=0
 
Handle< BlackVolTermStructurefxVol (const string &ccypair, const string &configuration=Market::defaultConfiguration) const
 
virtual Handle< BlackVolTermStructurefxVolImpl (const string &ccypair, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::CreditCurvedefaultCurve (const string &, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< Quote > recoveryRate (const string &, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::CreditVolCurvecdsVol (const string &, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::BaseCorrelationTermStructurebaseCorrelation (const string &, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< OptionletVolatilityStructure > capFloorVol (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual std::pair< std::string, QuantLib::Period > capFloorVolIndexBase (const string &key, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::YoYOptionletVolatilitySurface > yoyCapFloorVol (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< ZeroInflationIndex > zeroInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< YoYInflationIndex > yoyInflationIndex (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< CPIVolatilitySurface > cpiInflationCapFloorVolatilitySurface (const string &indexName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< Quote > equitySpot (const string &eqName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< YieldTermStructure > equityDividendCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< YieldTermStructure > equityForecastCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< QuantExt::EquityIndex2equityCurve (const string &eqName, const string &configuration=Market::defaultConfiguration) const=0
 
virtual Handle< Quote > securitySpread (const string &securityID, const string &configuration=Market::defaultConfiguration) const=0
 
virtual QuantLib::Handle< QuantExt::PriceTermStructurecommodityPriceCurve (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const=0
 
virtual QuantLib::Handle< QuantExt::CommodityIndexcommodityIndex (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const=0
 
virtual QuantLib::Handle< QuantLib::BlackVolTermStructure > commodityVolatility (const std::string &commodityName, const std::string &configuration=Market::defaultConfiguration) const=0
 
virtual QuantLib::Handle< QuantExt::CorrelationTermStructurecorrelationCurve (const std::string &index1, const std::string &index2, const std::string &configuration=Market::defaultConfiguration) const=0
 

Private Member Functions

void createDiscountCurve (const string &ccy, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates)
 
void createEquityForecastCurve (const string &name, const string &ccy, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates)
 
void createXccyDiscountCurve (const string &ccy, const string &baseCcy, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates)
 
void createIborIndex (const string &idxName, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates, bool singleCurve)
 
void createDefaultCurve (const string &name, const string &ccy, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates)
 
void createCdsVolCurve (const string &name, const vector< Period > &parTenor, const vector< Real > &parRates)
 
void createEquityVolCurve (const string &name, const string &ccy, const vector< Period > &parTenor, const vector< Real > &parRates)
 
void createBaseCorrel (const string &name, const vector< Period > &tenors, const vector< string > &lossLevel, const vector< Real > quotes)
 
void createSwaptionVolCurve (const string &name, const vector< Period > &optionTenors, const vector< Period > &swapTenors, const vector< Real > &strikeSpreads, const vector< Real > &parRates)
 
void createZeroInflationIndex (const string &idxName, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates, bool singleCurve)
 
void createYoYInflationIndex (const string &idxName, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates, bool singleCurve)
 
Handle< YieldTermStructure > flatRateYts (Real forward)
 
Handle< BlackVolTermStructureflatRateFxv (Volatility forward)
 
Handle< QuantLib::SwaptionVolatilityStructure > flatRateSvs (Volatility forward, VolatilityType type=ShiftedLognormal, Real shift=0.0)
 
Handle< DefaultProbabilityTermStructure > flatRateDcs (Volatility forward)
 
Handle< OptionletVolatilityStructure > flatRateCvs (Volatility vol, VolatilityType type=Normal, Real shift=0.0)
 

Private Attributes

map< string, vector< string > > discountRateHelperInstMap_
 
map< string, vector< string > > equityForecastRateHelperInstMap_
 
map< string, vector< string > > indexCurveRateHelperInstMap_
 
map< string, vector< string > > defaultRateHelperInstMap_
 
map< string, vector< string > > zeroInflationRateHelperInstMap_
 
map< string, vector< string > > yoyInflationRateHelperInstMap_
 
map< string, vector< Period > > discountRateHelperTenorsMap_
 
map< string, vector< Period > > equityForecastRateHelperTenorsMap_
 
map< string, vector< Period > > indexCurveRateHelperTenorsMap_
 
map< string, vector< Period > > defaultRateHelperTenorsMap_
 
map< string, vector< Period > > cdsVolRateHelperTenorsMap_
 
map< string, vector< Period > > swaptionVolRateHelperTenorsMap_
 
map< string, vector< Period > > swaptionVolRateHelperSwapTenorsMap_
 
map< string, vector< Period > > equityVolRateHelperTenorsMap_
 
map< string, vector< Period > > baseCorrRateHelperTenorsMap_
 
map< string, vector< Period > > zeroInflationRateHelperTenorsMap_
 
map< string, vector< Period > > yoyInflationRateHelperTenorsMap_
 
map< string, vector< string > > baseCorrLossLevelsMap_
 
map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > discountRateHelpersMap_
 
map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > equityForecastRateHelpersMap_
 
map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > indexCurveRateHelpersMap_
 
map< string, vector< QuantLib::ext::shared_ptr< QuantExt::DefaultProbabilityHelper > > > defaultRateHelpersMap_
 
map< string, vector< Handle< Quote > > > discountRateHelperValuesMap_
 
map< string, vector< Handle< Quote > > > equityForecastRateHelperValuesMap_
 
map< string, vector< Handle< Quote > > > indexCurveRateHelperValuesMap_
 
map< string, vector< Handle< Quote > > > defaultRateHelperValuesMap_
 
map< string, vector< Handle< Quote > > > cdsVolRateHelperValuesMap_
 
map< string, vector< Handle< Quote > > > swaptionVolRateHelperValuesMap_
 
map< string, vector< Handle< Quote > > > equityVolRateHelperValuesMap_
 
map< string, vector< Handle< Quote > > > baseCorrRateHelperValuesMap_
 
map< string, vector< Handle< Quote > > > zeroInflationRateHelperValuesMap_
 
map< string, vector< Handle< Quote > > > yoyInflationRateHelperValuesMap_
 

Additional Inherited Members

- Static Public Attributes inherited from Market
static const string defaultConfiguration
 
static const string inCcyConfiguration
 
- Protected Member Functions inherited from MarketImpl
virtual void require (const MarketObject o, const string &name, const string &configuration, const bool forceBuild=false) const
 
void addSwapIndex (const string &swapindex, const string &discountIndex, const string &configuration=Market::defaultConfiguration) const
 
- Protected Attributes inherited from MarketImpl
Date asof_
 
QuantLib::ext::shared_ptr< FXTriangulationfx_
 
map< tuple< string, YieldCurveType, string >, Handle< YieldTermStructure > > yieldCurves_
 
map< pair< string, string >, Handle< IborIndex > > iborIndices_
 
map< pair< string, string >, Handle< SwapIndex > > swapIndices_
 
map< pair< string, string >, Handle< QuantLib::SwaptionVolatilityStructure > > swaptionCurves_
 
map< pair< string, string >, pair< string, string > > swaptionIndexBases_
 
map< pair< string, string >, Handle< QuantLib::SwaptionVolatilityStructure > > yieldVolCurves_
 
map< pair< string, string >, Handle< BlackVolTermStructure > > fxVols_
 
map< pair< string, string >, Handle< QuantExt::CreditCurve > > defaultCurves_
 
map< pair< string, string >, Handle< QuantExt::CreditVolCurve > > cdsVols_
 
map< pair< string, string >, Handle< QuantExt::BaseCorrelationTermStructure > > baseCorrelations_
 
map< pair< string, string >, Handle< Quote > > recoveryRates_
 
map< pair< string, string >, Handle< OptionletVolatilityStructure > > capFloorCurves_
 
map< pair< string, string >, std::pair< string, QuantLib::Period > > capFloorIndexBase_
 
map< pair< string, string >, Handle< YoYOptionletVolatilitySurface > > yoyCapFloorVolSurfaces_
 
map< pair< string, string >, Handle< ZeroInflationIndex > > zeroInflationIndices_
 
map< pair< string, string >, Handle< YoYInflationIndex > > yoyInflationIndices_
 
map< pair< string, string >, Handle< CPIVolatilitySurface > > cpiInflationCapFloorVolatilitySurfaces_
 
map< pair< string, string >, Handle< Quote > > equitySpots_
 
map< pair< string, string >, Handle< BlackVolTermStructure > > equityVols_
 
map< pair< string, string >, Handle< Quote > > securitySpreads_
 
map< pair< string, string >, Handle< QuantExt::InflationIndexObserver > > baseCpis_
 
map< tuple< string, string, string >, Handle< QuantExt::CorrelationTermStructure > > correlationCurves_
 
map< pair< string, string >, QuantLib::Handle< QuantExt::CommodityIndex > > commodityIndices_
 
map< pair< string, string >, QuantLib::Handle< QuantLib::BlackVolTermStructure > > commodityVols_
 
map< pair< string, string >, QuantLib::Handle< QuantExt::EquityIndex2 > > equityCurves_
 
map< pair< string, string >, Handle< Quote > > cprs_
 
map< string, std::set< QuantLib::ext::shared_ptr< TermStructure > > > refreshTs_
 
- Protected Attributes inherited from Market
bool handlePseudoCurrencies_
 

Detailed Description

Definition at line 92 of file testmarket.hpp.

Constructor & Destructor Documentation

◆ TestMarketParCurves()

TestMarketParCurves ( const Date &  asof)

Definition at line 645 of file testmarket.cpp.

645 : MarketImpl(false) {
646 asof_ = asof;
647
649
650 vector<pair<string, Real>> ccys = {{"EUR", 0.02}, {"USD", 0.03}, {"GBP", 0.04}, {"CHF", 0.02}};
651 vector<pair<string, Real>> o_ccys = {{"JPY", 0.005}};
652 vector<pair<string, Real>> x_ccys = {{"CHF", 0.02}};
653 vector<pair<string, Real>> d_names = {{"dc", 0.001}, {"dc2", 0.001}, {"dc3", 0.001}};
654 map<string, string> d_ccys;
655 d_ccys["dc"] = "USD";
656 d_ccys["dc2"] = "EUR";
657 d_ccys["dc3"] = "GBP";
658 vector<Period> parTenor = {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
659 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years, 30 * Years};
660 vector<Period> parTenor2 = {3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
661 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years};
662 vector<Period> parTenor3 = {6 * Months, 1 * Years, 2 * Years, 5 * Years, 10 * Years};
663
664 for (auto it : ccys) {
665 string ccy = it.first;
666 Real parRate = it.second;
667 vector<string> parInst;
668 if (ccy == "JPY")
669 parInst = {"OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS"};
670 else
671 parInst = {"DEP", "DEP", "DEP", "DEP", "FRA", "IRS", "IRS", "IRS", "IRS", "IRS", "IRS", "IRS", "IRS"};
672 vector<Real> parRates(parInst.size(), parRate);
673 createDiscountCurve(ccy, parInst, parTenor, parRates);
674 }
675 for (auto it : o_ccys) {
676 string ccy = it.first;
677 Real parRate = it.second;
678 vector<string> parInst;
679 parInst = {"OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS", "OIS"};
680 vector<Real> parRates(parInst.size(), parRate);
681 createDiscountCurve(ccy, parInst, parTenor, parRates);
682 }
683
684 // add fx rates
685 // add fx rates
686 std::map<std::string, QuantLib::Handle<QuantLib::Quote>> quotes;
687 quotes["EURUSD"] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(1.2));
688 quotes["EURGBP"] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(0.8));
689 quotes["EURCHF"] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(1.0));
690 quotes["EURJPY"] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(128.0));
691 fx_ = QuantLib::ext::make_shared<FXTriangulation>(quotes);
692
693 recoveryRates_[make_pair(Market::defaultConfiguration, "dc")] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(0.4));
695 Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(0.4));
697 Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(0.4));
698
699 for (auto it : d_names) {
700 string name = it.first;
701 Real parRate = it.second;
702 string ccy = d_ccys[name];
703 vector<string> parInst;
704 parInst = {"CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS", "CDS"};
705 vector<Real> parRates(parInst.size(), parRate);
706
707 createDefaultCurve(name, ccy, parInst, parTenor2, parRates);
708 }
709 // build ibor indices
710 vector<pair<string, Real>> indexData = {
711 {"EUR-EONIA", 0.02}, {"EUR-EURIBOR-2W", 0.02}, {"EUR-EURIBOR-1M", 0.02}, {"EUR-EURIBOR-3M", 0.02},
712 {"EUR-EURIBOR-6M", 0.02}, {"USD-FedFunds", 0.03}, {"USD-LIBOR-2W", 0.03}, {"USD-LIBOR-1M", 0.03},
713 {"USD-LIBOR-3M", 0.03}, {"USD-LIBOR-6M", 0.03}, {"GBP-SONIA", 0.04}, {"GBP-LIBOR-2W", 0.04},
714 {"GBP-LIBOR-1M", 0.04}, {"GBP-LIBOR-3M", 0.04}, {"GBP-LIBOR-6M", 0.04}, {"JPY-TONAR", 0.005},
715 {"JPY-LIBOR-2W", 0.005}, {"JPY-LIBOR-1M", 0.005}, {"JPY-LIBOR-3M", 0.005}, {"JPY-LIBOR-6M", 0.005}};
716 vector<pair<string, Real>> singleCurve_indexData = {{"CHF-LIBOR-3M", 0.02}, {"CHF-LIBOR-6M", 0.02}};
717 for (auto id : indexData) {
718 string idxName = id.first;
719 string ccy = idxName.substr(0, 3);
720 vector<string> parInst = {"DEP", "DEP", "DEP", "DEP", "FRA", "IRS", "IRS",
721 "IRS", "IRS", "IRS", "IRS", "IRS", "IRS"};
722 vector<Real> parRates(parInst.size(), id.second);
723 createIborIndex(idxName, parInst, parTenor, parRates, false);
724 }
725 for (auto id : singleCurve_indexData) {
726 string idxName = id.first;
727 string ccy = idxName.substr(0, 3);
728 vector<string> parInst = {"DEP", "DEP", "DEP", "DEP", "FRA", "IRS", "IRS",
729 "IRS", "IRS", "IRS", "IRS", "IRS", "IRS"};
730 vector<Real> parRates(parInst.size(), id.second);
731 createIborIndex(idxName, parInst, parTenor, parRates, true);
732 }
733 // now build the remaining discount curves that have cross-currency dependencies
734 for (auto it : x_ccys) {
735 string baseCcy = "EUR";
736 string ccy = it.first;
737 Real parRate = it.second;
738 vector<string> parInst;
739 parInst = {"FXF", "FXF", "FXF", "FXF", "FXF", "XBS", "XBS", "XBS", "XBS", "XBS", "XBS", "XBS", "XBS"};
740 vector<Real> parRates(parInst.size(), parRate);
741 BOOST_ASSERT(ccy != baseCcy);
742 createXccyDiscountCurve(ccy, baseCcy, parInst, parTenor, parRates);
743 }
744
745 // swap index
746 addSwapIndex("EUR-CMS-2Y", "EUR-EURIBOR-6M", Market::defaultConfiguration);
747 addSwapIndex("EUR-CMS-30Y", "EUR-EURIBOR-6M", Market::defaultConfiguration);
748 addSwapIndex("USD-CMS-2Y", "USD-FedFunds", Market::defaultConfiguration);
749 addSwapIndex("USD-CMS-30Y", "USD-FedFunds", Market::defaultConfiguration);
750 addSwapIndex("GBP-CMS-2Y", "GBP-SONIA", Market::defaultConfiguration);
751 addSwapIndex("GBP-CMS-30Y", "GBP-SONIA", Market::defaultConfiguration);
752 addSwapIndex("CHF-CMS-2Y", "CHF-LIBOR-6M", Market::defaultConfiguration);
753 addSwapIndex("CHF-CMS-30Y", "CHF-LIBOR-6M", Market::defaultConfiguration);
754 addSwapIndex("JPY-CMS-2Y", "JPY-LIBOR-6M", Market::defaultConfiguration);
755 addSwapIndex("JPY-CMS-30Y", "JPY-LIBOR-6M", Market::defaultConfiguration);
756
757 // build fx vols
758 fxVols_[make_pair(Market::defaultConfiguration, "EURUSD")] = flatRateFxv(0.12);
759 fxVols_[make_pair(Market::defaultConfiguration, "EURGBP")] = flatRateFxv(0.15);
760 fxVols_[make_pair(Market::defaultConfiguration, "EURCHF")] = flatRateFxv(0.15);
761 fxVols_[make_pair(Market::defaultConfiguration, "EURJPY")] = flatRateFxv(0.15);
762
763 // build cap/floor vol structures
764 capFloorCurves_[make_pair(Market::defaultConfiguration, "EUR")] = flatRateCvs(0.0050, Normal);
765 capFloorCurves_[make_pair(Market::defaultConfiguration, "USD")] = flatRateCvs(0.0060, Normal);
766 capFloorCurves_[make_pair(Market::defaultConfiguration, "GBP")] = flatRateCvs(0.0055, Normal);
767 capFloorCurves_[make_pair(Market::defaultConfiguration, "CHF")] = flatRateCvs(0.0045, Normal);
768 capFloorCurves_[make_pair(Market::defaultConfiguration, "JPY")] = flatRateCvs(0.0040, Normal);
769
770 // build swaption vols
771 vector<pair<string, Real>> swapvolrates = {
772 {"EUR", 0.2}, {"USD", 0.30}, {"GBP", 0.25}, {"CHF", 0.25}, {"JPY", 0.25}};
773 vector<Period> swapTenors = {2 * Weeks, 1 * Months, 3 * Months, 6 * Months, 1 * Years, 2 * Years, 3 * Years,
774 5 * Years, 10 * Years, 13 * Years, 15 * Years, 20 * Years, 30 * Years};
775 vector<Period> swapTerms = {1 * Years, 2 * Years, 3 * Years, 4 * Years, 5 * Years,
776 7 * Years, 10 * Years, 15 * Years, 20 * Years, 30 * Years};
777
778 swaptionIndexBases_[make_pair(Market::defaultConfiguration, "EUR")] = std::make_pair("EUR-CMS-2Y", "EUR-CMS-30Y");
779 swaptionIndexBases_[make_pair(Market::defaultConfiguration, "USD")] = std::make_pair("USD-CMS-2Y", "USD-CMS-30Y");
780 swaptionIndexBases_[make_pair(Market::defaultConfiguration, "GBP")] = std::make_pair("GBP-CMS-2Y", "GBP-CMS-30Y");
781 swaptionIndexBases_[make_pair(Market::defaultConfiguration, "CHF")] = std::make_pair("CHF-CMS-2Y", "CHF-CMS-30Y");
782 swaptionIndexBases_[make_pair(Market::defaultConfiguration, "JPY")] = std::make_pair("JPY-CMS-2Y", "JPY-CMS-30Y");
783
784 vector<Real> swapStrikes = {-0.02, -0.005, 0, 0.005, 0.02};
785 for (auto it : swapvolrates) {
786 string name = it.first;
787 Real parRate = it.second;
788 vector<Real> parRates(swapTenors.size() * swapTerms.size() * swapStrikes.size(), parRate);
789 createSwaptionVolCurve(name, swapTenors, swapTerms, swapStrikes, parRates);
790 }
791
792 // Add Equity Spots
793 equitySpots_[make_pair(Market::defaultConfiguration, "SP5")] =
794 Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(2147.56));
795 equitySpots_[make_pair(Market::defaultConfiguration, "Lufthansa")] =
796 Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(12.75));
797
798 vector<pair<string, Real>> eqvolrates = {{"SP5", 0.2514}, {"Lufthansa", 0.30}};
799 map<string, string> currencyMap;
800 currencyMap["SP5"] = "USD";
801 currencyMap["Lufthansa"] = "EUR";
802 for (auto it : eqvolrates) {
803 string name = it.first;
804 Real parRate = it.second;
805 vector<Real> parRates(parTenor.size(), parRate);
806 createEquityVolCurve(name, currencyMap[name], parTenor, parRates);
807 }
808
809 yieldCurves_[make_tuple(Market::defaultConfiguration, YieldCurveType::EquityDividend, "SP5")] = flatRateYts(0.01);
810 yieldCurves_[make_tuple(Market::defaultConfiguration, YieldCurveType::EquityDividend, "Lufthansa")] =
811 flatRateYts(0.0);
812
813 vector<string> parInst = {"DEP", "DEP", "DEP", "DEP", "FRA", "IRS", "IRS",
814 "IRS", "IRS", "IRS", "IRS", "IRS", "IRS"};
815 vector<Real> parRates1(parInst.size(), 0.03);
816 vector<Real> parRates2(parInst.size(), 0.02);
817
818 equityCurves_[make_pair(Market::defaultConfiguration, "SP5")] = Handle<EquityIndex2>(QuantLib::ext::make_shared<EquityIndex2>(
819 "SP5", UnitedStates(UnitedStates::Settlement), parseCurrency("USD"), equitySpot("SP5"), yieldCurve(YieldCurveType::Discount, "USD"),
820 yieldCurve(YieldCurveType::EquityDividend, "SP5")));
821 equityCurves_[make_pair(Market::defaultConfiguration, "Lufthansa")] =
822 Handle<EquityIndex2>(QuantLib::ext::make_shared<EquityIndex2>(
823 "Lufthansa", TARGET(), parseCurrency("EUR"), equitySpot("Lufthansa"),
824 yieldCurve(YieldCurveType::Discount, "EUR"), yieldCurve(YieldCurveType::EquityDividend, "Lufthansa")));
825
826 vector<pair<string, Real>> cdsrates = {{"dc", 0.12}, {"dc2", 0.1313}, {"dc3", 0.14}};
827 for (auto it : cdsrates) {
828 string name = it.first;
829 Real parRate = it.second;
830 vector<Real> parRates(parTenor3.size(), parRate);
831 createCdsVolCurve(name, parTenor3, parRates);
832 }
833
834 vector<pair<string, vector<Real>>> bcrates = {{"Tranch1", {0.1, 0.2, 0.3, 0.4, 0.5, 0.6}}};
835 vector<Period> bctenors = {1 * Days, 2 * Days};
836 vector<string> lossLevel = {"0.03", "0.06", "0.09", "0.12", "0.22", "1.00"};
837 for (auto it : bcrates) {
838 string name = it.first;
839 vector<Real> corrRates = it.second;
840 createBaseCorrel(name, bctenors, lossLevel, corrRates);
841 }
842
843 Date cpiFixingEnd(1, asof_.month(), asof_.year());
844 Date cpiFixingStart = cpiFixingEnd - Period(14, Months);
845 Schedule fixingDatesUKRPI = MakeSchedule().from(cpiFixingStart).to(cpiFixingEnd).withTenor(1 * Months);
846 Real fixingRatesUKRPI[] = {258.5, 258.9, 258.6, 259.8, 259.6, 259.5, 259.8, 260.6,
847 258.8, 260.0, 261.1, 261.4, 262.1, -264.3, -265.2};
848
849 RelinkableHandle<ZeroInflationTermStructure> hcpi;
850 QuantLib::ext::shared_ptr<ZeroInflationIndex> ii = QuantLib::ext::shared_ptr<UKRPI>(new UKRPI(hcpi));
851 for (Size i = 0; i < fixingDatesUKRPI.size(); i++) {
852 ii->addFixing(fixingDatesUKRPI[i], fixingRatesUKRPI[i], true);
853 };
854
855 vector<pair<string, vector<Real>>> zirates = {
856 {"UKRPI", {2.825, 2.9425, 2.975, 2.983, 3.0, 3.01, 3.008, 3.009, 3.013}}};
857 vector<Period> zitenors = {6 * Months, 1 * Years, 2 * Years, 3 * Years, 5 * Years,
858 7 * Years, 10 * Years, 15 * Years, 20 * Years};
859 for (auto it : zirates) {
860 string index = it.first;
861 vector<Real> parRates = it.second;
862 vector<string> parInst = {"ZIS", "ZIS", "ZIS", "ZIS", "ZIS", "ZIS", "ZIS", "ZIS", "ZIS"};
863 createZeroInflationIndex(index, parInst, zitenors, parRates, true);
864 }
865 vector<pair<string, vector<Real>>> yyrates = {
866 {"UKRPI", {/*2.825,*/ 2.9425, 2.975, 2.983, 3.0, 3.01, 3.008, 3.009, 3.013}}};
867 vector<Period> yytenors = {1 * Years, 2 * Years, 3 * Years, 5 * Years,
868 7 * Years, 10 * Years, 15 * Years, 20 * Years};
869 for (auto it : yyrates) {
870 string index = it.first;
871 vector<Real> parRates = it.second;
872 vector<string> parInst = {"YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS", "YYS"};
873 createYoYInflationIndex(index, parInst, yytenors, parRates, true);
874 }
875}
static const string defaultConfiguration
map< pair< string, string >, Handle< OptionletVolatilityStructure > > capFloorCurves_
map< pair< string, string >, QuantLib::Handle< QuantExt::EquityIndex2 > > equityCurves_
map< pair< string, string >, Handle< BlackVolTermStructure > > fxVols_
QuantLib::ext::shared_ptr< FXTriangulation > fx_
map< tuple< string, YieldCurveType, string >, Handle< YieldTermStructure > > yieldCurves_
map< pair< string, string >, Handle< Quote > > equitySpots_
map< pair< string, string >, Handle< Quote > > recoveryRates_
Handle< Quote > equitySpot(const string &eqName, const string &configuration=Market::defaultConfiguration) const override
map< pair< string, string >, pair< string, string > > swaptionIndexBases_
Handle< YieldTermStructure > yieldCurve(const YieldCurveType &type, const string &ccy, const string &configuration=Market::defaultConfiguration) const override
void addSwapIndex(const string &swapindex, const string &discountIndex, const string &configuration=Market::defaultConfiguration) const
static void setConventions()
Set Conventions.
void createIborIndex(const string &idxName, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates, bool singleCurve)
Definition: testmarket.cpp:909
void createDiscountCurve(const string &ccy, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates)
Definition: testmarket.cpp:877
Handle< OptionletVolatilityStructure > flatRateCvs(Volatility vol, VolatilityType type=Normal, Real shift=0.0)
void createCdsVolCurve(const string &name, const vector< Period > &parTenor, const vector< Real > &parRates)
Definition: testmarket.cpp:951
void createXccyDiscountCurve(const string &ccy, const string &baseCcy, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates)
Definition: testmarket.cpp:890
Handle< YieldTermStructure > flatRateYts(Real forward)
void createEquityVolCurve(const string &name, const string &ccy, const vector< Period > &parTenor, const vector< Real > &parRates)
Definition: testmarket.cpp:979
void createBaseCorrel(const string &name, const vector< Period > &tenors, const vector< string > &lossLevel, const vector< Real > quotes)
void createYoYInflationIndex(const string &idxName, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates, bool singleCurve)
Handle< BlackVolTermStructure > flatRateFxv(Volatility forward)
void createDefaultCurve(const string &name, const string &ccy, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates)
Definition: testmarket.cpp:933
void createSwaptionVolCurve(const string &name, const vector< Period > &optionTenors, const vector< Period > &swapTenors, const vector< Real > &strikeSpreads, const vector< Real > &parRates)
void createZeroInflationIndex(const string &idxName, const vector< string > &parInst, const vector< Period > &parTenor, const vector< Real > &parRates, bool singleCurve)
Currency parseCurrency(const string &s)
Date asof(14, Jun, 2018)
string name
+ Here is the call graph for this function:

Member Function Documentation

◆ discountRateHelpersInstMap()

const map< string, vector< string > > & discountRateHelpersInstMap ( ) const

Definition at line 96 of file testmarket.hpp.

map< string, vector< string > > discountRateHelperInstMap_
Definition: testmarket.hpp:203

◆ equityForecastRateHelpersInstMap()

const map< string, vector< string > > & equityForecastRateHelpersInstMap ( ) const

Definition at line 97 of file testmarket.hpp.

97 {
99 }
map< string, vector< string > > equityForecastRateHelperInstMap_
Definition: testmarket.hpp:203

◆ indexCurveRateHelperInstMap()

const map< string, vector< string > > & indexCurveRateHelperInstMap ( ) const

Definition at line 100 of file testmarket.hpp.

map< string, vector< string > > indexCurveRateHelperInstMap_
Definition: testmarket.hpp:204

◆ defaultRateHelpersInstMap()

const map< string, vector< string > > & defaultRateHelpersInstMap ( ) const

Definition at line 101 of file testmarket.hpp.

map< string, vector< string > > defaultRateHelperInstMap_
Definition: testmarket.hpp:204

◆ zeroInflationRateHelperInstMap()

const map< string, vector< string > > & zeroInflationRateHelperInstMap ( ) const

Definition at line 102 of file testmarket.hpp.

102 {
104 }
map< string, vector< string > > zeroInflationRateHelperInstMap_
Definition: testmarket.hpp:204

◆ yoyInflationRateHelperInstMap()

const map< string, vector< string > > & yoyInflationRateHelperInstMap ( ) const

Definition at line 105 of file testmarket.hpp.

map< string, vector< string > > yoyInflationRateHelperInstMap_
Definition: testmarket.hpp:205

◆ discountRateHelperTenorsMap()

const map< string, vector< Period > > & discountRateHelperTenorsMap ( ) const

Definition at line 106 of file testmarket.hpp.

map< string, vector< Period > > discountRateHelperTenorsMap_
Definition: testmarket.hpp:206

◆ equityForecastRateHelperTenorsMap()

const map< string, vector< Period > > & equityForecastRateHelperTenorsMap ( ) const

Definition at line 107 of file testmarket.hpp.

107 {
109 }
map< string, vector< Period > > equityForecastRateHelperTenorsMap_
Definition: testmarket.hpp:206

◆ indexCurveRateHelperTenorsMap()

const map< string, vector< Period > > & indexCurveRateHelperTenorsMap ( ) const

Definition at line 110 of file testmarket.hpp.

map< string, vector< Period > > indexCurveRateHelperTenorsMap_
Definition: testmarket.hpp:207

◆ defaultRateHelperTenorsMap()

const map< string, vector< Period > > & defaultRateHelperTenorsMap ( ) const

Definition at line 111 of file testmarket.hpp.

map< string, vector< Period > > defaultRateHelperTenorsMap_
Definition: testmarket.hpp:207

◆ cdsVolRateHelperTenorsMap()

const map< string, vector< Period > > & cdsVolRateHelperTenorsMap ( ) const

Definition at line 112 of file testmarket.hpp.

map< string, vector< Period > > cdsVolRateHelperTenorsMap_
Definition: testmarket.hpp:207

◆ swaptionVolRateHelperTenorsMap()

const map< string, vector< Period > > & swaptionVolRateHelperTenorsMap ( ) const

Definition at line 113 of file testmarket.hpp.

113 {
115 }
map< string, vector< Period > > swaptionVolRateHelperTenorsMap_
Definition: testmarket.hpp:208

◆ swaptionVolRateHelperSwapTenorsMap()

const map< string, vector< Period > > & swaptionVolRateHelperSwapTenorsMap ( ) const

Definition at line 116 of file testmarket.hpp.

116 {
118 }
map< string, vector< Period > > swaptionVolRateHelperSwapTenorsMap_
Definition: testmarket.hpp:208

◆ equityVolRateHelperTenorsMap()

const map< string, vector< Period > > & equityVolRateHelperTenorsMap ( ) const

Definition at line 119 of file testmarket.hpp.

map< string, vector< Period > > equityVolRateHelperTenorsMap_
Definition: testmarket.hpp:208

◆ baseCorrRateHelperTenorsMap()

const map< string, vector< Period > > & baseCorrRateHelperTenorsMap ( ) const

Definition at line 120 of file testmarket.hpp.

map< string, vector< Period > > baseCorrRateHelperTenorsMap_
Definition: testmarket.hpp:209

◆ baseCorrLossLevelsMap()

const map< string, vector< string > > & baseCorrLossLevelsMap ( ) const

Definition at line 121 of file testmarket.hpp.

121{ return baseCorrLossLevelsMap_; }
map< string, vector< string > > baseCorrLossLevelsMap_
Definition: testmarket.hpp:210

◆ zeroInflationRateHelperTenorsMap()

const map< string, vector< Period > > & zeroInflationRateHelperTenorsMap ( ) const

Definition at line 122 of file testmarket.hpp.

122 {
124 }
map< string, vector< Period > > zeroInflationRateHelperTenorsMap_
Definition: testmarket.hpp:209

◆ yoyInflationRateHelperTenorsMap()

const map< string, vector< Period > > & yoyInflationRateHelperTenorsMap ( ) const

Definition at line 125 of file testmarket.hpp.

125 {
127 }
map< string, vector< Period > > yoyInflationRateHelperTenorsMap_
Definition: testmarket.hpp:209

◆ equityForecastRateHelpersMap()

const map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > & equityForecastRateHelpersMap ( ) const

Definition at line 128 of file testmarket.hpp.

128 {
130 }
map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > equityForecastRateHelpersMap_
Definition: testmarket.hpp:211

◆ discountRateHelpersMap()

const map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > & discountRateHelpersMap ( ) const

Definition at line 131 of file testmarket.hpp.

131 {
133 }
map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > discountRateHelpersMap_
Definition: testmarket.hpp:211

◆ indexCurveRateHelpersMap()

const map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > & indexCurveRateHelpersMap ( ) const

Definition at line 134 of file testmarket.hpp.

134 {
136 }
map< string, vector< QuantLib::ext::shared_ptr< RateHelper > > > indexCurveRateHelpersMap_
Definition: testmarket.hpp:212

◆ defaultRateHelpersMap()

const map< string, vector< QuantLib::ext::shared_ptr< QuantExt::DefaultProbabilityHelper > > > & defaultRateHelpersMap ( ) const

Definition at line 137 of file testmarket.hpp.

137 {
139 }
map< string, vector< QuantLib::ext::shared_ptr< QuantExt::DefaultProbabilityHelper > > > defaultRateHelpersMap_
Definition: testmarket.hpp:213

◆ discountRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & discountRateHelperValuesMap ( ) const

Definition at line 140 of file testmarket.hpp.

140 {
142 }
map< string, vector< Handle< Quote > > > discountRateHelperValuesMap_
Definition: testmarket.hpp:214

◆ equityForecastRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & equityForecastRateHelperValuesMap ( ) const

Definition at line 143 of file testmarket.hpp.

143 {
145 }
map< string, vector< Handle< Quote > > > equityForecastRateHelperValuesMap_
Definition: testmarket.hpp:214

◆ indexCurveRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & indexCurveRateHelperValuesMap ( ) const

Definition at line 146 of file testmarket.hpp.

146 {
148 }
map< string, vector< Handle< Quote > > > indexCurveRateHelperValuesMap_
Definition: testmarket.hpp:215

◆ defaultRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & defaultRateHelperValuesMap ( ) const

Definition at line 149 of file testmarket.hpp.

map< string, vector< Handle< Quote > > > defaultRateHelperValuesMap_
Definition: testmarket.hpp:215

◆ cdsVolRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & cdsVolRateHelperValuesMap ( ) const

Definition at line 150 of file testmarket.hpp.

map< string, vector< Handle< Quote > > > cdsVolRateHelperValuesMap_
Definition: testmarket.hpp:215

◆ swaptionVolRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & swaptionVolRateHelperValuesMap ( ) const

Definition at line 151 of file testmarket.hpp.

151 {
153 }
map< string, vector< Handle< Quote > > > swaptionVolRateHelperValuesMap_
Definition: testmarket.hpp:216

◆ equityVolRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & equityVolRateHelperValuesMap ( ) const

Definition at line 154 of file testmarket.hpp.

154 {
156 }
map< string, vector< Handle< Quote > > > equityVolRateHelperValuesMap_
Definition: testmarket.hpp:216

◆ baseCorrRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & baseCorrRateHelperValuesMap ( ) const

Definition at line 157 of file testmarket.hpp.

157 {
159 }
map< string, vector< Handle< Quote > > > baseCorrRateHelperValuesMap_
Definition: testmarket.hpp:216

◆ zeroInflationRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & zeroInflationRateHelperValuesMap ( ) const

Definition at line 160 of file testmarket.hpp.

160 {
162 }
map< string, vector< Handle< Quote > > > zeroInflationRateHelperValuesMap_
Definition: testmarket.hpp:217

◆ yoyInflationRateHelperValuesMap()

const map< string, vector< Handle< Quote > > > & yoyInflationRateHelperValuesMap ( ) const

Definition at line 163 of file testmarket.hpp.

163 {
165 }
map< string, vector< Handle< Quote > > > yoyInflationRateHelperValuesMap_
Definition: testmarket.hpp:217

◆ createDiscountCurve()

void createDiscountCurve ( const string &  ccy,
const vector< string > &  parInst,
const vector< Period > &  parTenor,
const vector< Real > &  parRates 
)
private

Definition at line 877 of file testmarket.cpp.

878 {
879 discountRateHelperInstMap_[ccy] = parInst;
880 discountRateHelperTenorsMap_[ccy] = parTenor;
881 vector<Handle<Quote>> parQuotes(parRates.size());
882 for (Size i = 0; i < parRates.size(); ++i)
883 parQuotes[i] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(parRates[i]));
884 discountRateHelperValuesMap_[ccy] = parQuotes;
885 discountRateHelpersMap_[ccy] = parRateCurveHelpers(ccy, parInst, parTenor, discountRateHelperValuesMap_[ccy]);
886 yieldCurves_[make_tuple(Market::defaultConfiguration, YieldCurveType::Discount, ccy)] =
887 parRateCurve(asof_, discountRateHelpersMap_[ccy]);
888}
+ Here is the caller graph for this function:

◆ createEquityForecastCurve()

void createEquityForecastCurve ( const string &  name,
const string &  ccy,
const vector< string > &  parInst,
const vector< Period > &  parTenor,
const vector< Real > &  parRates 
)
private

◆ createXccyDiscountCurve()

void createXccyDiscountCurve ( const string &  ccy,
const string &  baseCcy,
const vector< string > &  parInst,
const vector< Period > &  parTenor,
const vector< Real > &  parRates 
)
private

Definition at line 890 of file testmarket.cpp.

892 {
893 discountRateHelperInstMap_[ccy] = parInst;
894 discountRateHelperTenorsMap_[ccy] = parTenor;
895 vector<Handle<Quote>> parQuotes(parRates.size());
896 for (Size i = 0; i < parRates.size(); ++i)
897 parQuotes[i] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(parRates[i]));
898 discountRateHelperValuesMap_[ccy] = parQuotes;
899 Handle<Quote> fxSpot = this->fxSpot(ccy + baseCcy, Market::defaultConfiguration);
900 Handle<YieldTermStructure> baseDiscount = this->discountCurve(baseCcy, Market::defaultConfiguration);
901 Handle<YieldTermStructure> ccyDiscountHandle =
902 Handle<YieldTermStructure>(); // leave unlinked, as this is the curve we are building
903 discountRateHelpersMap_[ccy] = parRateCurveHelpers(ccy, parInst, parTenor, discountRateHelperValuesMap_[ccy],
904 ccyDiscountHandle, fxSpot, baseDiscount, this);
905 yieldCurves_[make_tuple(Market::defaultConfiguration, YieldCurveType::Discount, ccy)] =
906 parRateCurve(asof_, discountRateHelpersMap_[ccy]);
907}
Handle< Quote > fxSpot(const string &ccypair, const string &configuration=Market::defaultConfiguration) const
Handle< YieldTermStructure > discountCurve(const string &ccy, const string &configuration=Market::defaultConfiguration) const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createIborIndex()

void createIborIndex ( const string &  idxName,
const vector< string > &  parInst,
const vector< Period > &  parTenor,
const vector< Real > &  parRates,
bool  singleCurve 
)
private

Definition at line 909 of file testmarket.cpp.

911 {
912 string ccy = idxName.substr(0, 3);
913 indexCurveRateHelperInstMap_[idxName] = parInst;
914 indexCurveRateHelperTenorsMap_[idxName] = parTenor;
915 vector<Handle<Quote>> parQuotes(parRates.size());
916 for (Size i = 0; i < parRates.size(); ++i)
917 parQuotes[i] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(parRates[i]));
918 indexCurveRateHelperValuesMap_[idxName] = parQuotes;
919 indexCurveRateHelpersMap_[idxName] = parRateCurveHelpers(
920 ccy, parInst, parTenor, indexCurveRateHelperValuesMap_[idxName],
921 singleCurve ? Handle<YieldTermStructure>()
922 : yieldCurves_[make_tuple(Market::defaultConfiguration, YieldCurveType::Discount, ccy)]);
923 Handle<IborIndex> h(parseIborIndex(idxName, parRateCurve(asof_, indexCurveRateHelpersMap_[idxName])));
924 iborIndices_[make_pair(Market::defaultConfiguration, idxName)] = h;
925
926 // set up dummy fixings for the past 400 days
927 for (Date d = asof_ - 400; d < asof_; d++) {
928 if (h->isValidFixingDate(d))
929 h->addFixing(d, 0.01);
930 }
931}
map< pair< string, string >, Handle< IborIndex > > iborIndices_
QuantLib::ext::shared_ptr< IborIndex > parseIborIndex(const string &s, const Handle< YieldTermStructure > &h=Handle< YieldTermStructure >())
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createDefaultCurve()

void createDefaultCurve ( const string &  name,
const string &  ccy,
const vector< string > &  parInst,
const vector< Period > &  parTenor,
const vector< Real > &  parRates 
)
private

Definition at line 933 of file testmarket.cpp.

934 {
935 QuantLib::ext::shared_ptr<Conventions> conventions = InstrumentConventions::instance().conventions();
938 vector<Handle<Quote>> parQuotes(parRates.size());
939 for (Size i = 0; i < parRates.size(); ++i)
940 parQuotes[i] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(parRates[i]));
942 QuantLib::ext::shared_ptr<Convention> conv = conventions->get("CDS-STANDARD-CONVENTIONS");
943 Handle<YieldTermStructure> baseDiscount = this->discountCurve(ccy, Market::defaultConfiguration);
945 parRateCurveHelpers(name, parTenor, defaultRateHelperValuesMap_[name], baseDiscount, this);
946
947 defaultCurves_[make_pair(Market::defaultConfiguration, name)] = Handle<QuantExt::CreditCurve>(
948 QuantLib::ext::make_shared<QuantExt::CreditCurve>(parRateCurve(asof_, defaultRateHelpersMap_[name])));
949}
map< pair< string, string >, Handle< QuantExt::CreditCurve > > defaultCurves_
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createCdsVolCurve()

void createCdsVolCurve ( const string &  name,
const vector< Period > &  parTenor,
const vector< Real > &  parRates 
)
private

Definition at line 951 of file testmarket.cpp.

952 {
954 vector<Handle<Quote>> parQuotes(parRates.size());
955 for (Size i = 0; i < parRates.size(); ++i)
956 parQuotes[i] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(parRates[i]));
957 cdsVolRateHelperValuesMap_[name] = parQuotes;
958
959 DayCounter dc = Actual365Fixed();
960 Calendar cal = TARGET();
961 BusinessDayConvention bdc = Following;
962 vector<Volatility> atmVols(parQuotes.size());
963 vector<Date> dates(parQuotes.size());
964 vector<Time> times(parQuotes.size());
965
966 for (Size i = 0; i < parQuotes.size(); i++) {
967 dates[i] = asof_ + parTenor[i];
968 atmVols[i] = parQuotes[i]->value();
969 times[i] = dc.yearFraction(asof_, dates[i]);
970 }
971
972 // QuantLib::ext::shared_ptr<BlackVolTermStructure> vol(new BlackVarianceCurve(asof_, dates, atmVols, dc));
973 QuantLib::ext::shared_ptr<BlackVolTermStructure> vol(new BlackVarianceCurve3(0, cal, bdc, dc, times, parQuotes));
974 vol->enableExtrapolation();
975 cdsVols_[make_pair(Market::defaultConfiguration, name)] = Handle<QuantExt::CreditVolCurve>(
976 QuantLib::ext::make_shared<QuantExt::CreditVolCurveWrapper>(Handle<BlackVolTermStructure>(vol)));
977}
map< pair< string, string >, Handle< QuantExt::CreditVolCurve > > cdsVols_
+ Here is the caller graph for this function:

◆ createEquityVolCurve()

void createEquityVolCurve ( const string &  name,
const string &  ccy,
const vector< Period > &  parTenor,
const vector< Real > &  parRates 
)
private

Definition at line 979 of file testmarket.cpp.

980 {
982 vector<Handle<Quote>> parQuotes(parRates.size());
983 for (Size i = 0; i < parRates.size(); ++i)
984 parQuotes[i] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(parRates[i]));
986
987 DayCounter dc = Actual365Fixed();
988 // use calendat based on ccy, to align with sim market
989 Calendar cal = parseCalendar(ccy);
990 BusinessDayConvention bdc = Following;
991 vector<Date> dates(parQuotes.size());
992 vector<Time> times(parQuotes.size());
993
994 for (Size i = 0; i < parQuotes.size(); i++) {
995 dates[i] = cal.advance(asof_, parTenor[i]);
996 times[i] = dc.yearFraction(asof_, dates[i]);
997 }
998 QuantLib::ext::shared_ptr<BlackVolTermStructure> vol(new BlackVarianceCurve3(0, cal, bdc, dc, times, parQuotes));
999 vol->enableExtrapolation();
1000 equityVols_[make_pair(Market::defaultConfiguration, name)] = Handle<BlackVolTermStructure>(vol);
1001}
map< pair< string, string >, Handle< BlackVolTermStructure > > equityVols_
Calendar parseCalendar(const string &s)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createBaseCorrel()

void createBaseCorrel ( const string &  name,
const vector< Period > &  tenors,
const vector< string > &  lossLevel,
const vector< Real >  quotes 
)
private

Definition at line 1003 of file testmarket.cpp.

1004 {
1005 Natural settlementDays = 0;
1006 Calendar calendar = TARGET();
1007 BusinessDayConvention bdc = Following;
1008 DayCounter dc = Actual365Fixed();
1009
1010 vector<Handle<Quote>> allQuotes(quotes.size());
1011 vector<vector<Handle<Quote>>> correls(quotes.size());
1012 for (Size i = 0; i < quotes.size(); i++) {
1013 Handle<Quote> sq(QuantLib::ext::make_shared<SimpleQuote>(quotes[i]));
1014 allQuotes[i] = sq;
1015 vector<Handle<Quote>> qt(tenors.size(), sq);
1016 correls[i] = qt;
1017 }
1018 baseCorrRateHelperTenorsMap_[name] = {1 * Days};
1020 baseCorrLossLevelsMap_[name] = lossLevel;
1021
1022 vector<Real> ll_quotes(lossLevel.size());
1023 for (Size j = 0; j < lossLevel.size(); j++) {
1024 ll_quotes[j] = parseReal(lossLevel[j]);
1025 }
1026 auto bcts =
1027 QuantLib::ext::make_shared<QuantExt::InterpolatedBaseCorrelationTermStructure<Bilinear>>(settlementDays, calendar, bdc, tenors, ll_quotes,
1028 correls, dc);
1029 bcts->enableExtrapolation(true);
1031 Handle<QuantExt::BaseCorrelationTermStructure>(bcts);
1032}
map< pair< string, string >, Handle< QuantExt::BaseCorrelationTermStructure > > baseCorrelations_
Real parseReal(const string &s)
Calendar calendar
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createSwaptionVolCurve()

void createSwaptionVolCurve ( const string &  name,
const vector< Period > &  optionTenors,
const vector< Period > &  swapTenors,
const vector< Real > &  strikeSpreads,
const vector< Real > &  parRates 
)
private

Definition at line 1034 of file testmarket.cpp.

1036 {
1037 DayCounter dc = Actual365Fixed();
1038 Calendar cal = TARGET();
1039 BusinessDayConvention bdc = Following;
1040 swaptionVolRateHelperTenorsMap_[name] = optionTenors;
1042
1043 vector<vector<Handle<Quote>>> parQuotes(optionTenors.size(), vector<Handle<Quote>>(swapTenors.size()));
1044 vector<vector<Handle<Quote>>> cubeQuotes(optionTenors.size() * swapTenors.size(),
1045 vector<Handle<Quote>>(strikeSpreads.size(), Handle<Quote>()));
1046 vector<Handle<Quote>> allQuotes(parRates.size());
1047
1048 vector<vector<Real>> shift(optionTenors.size(), vector<Real>(swapTenors.size(), 0.0));
1049 for (Size i = 0; i < optionTenors.size(); ++i) {
1050 for (Size j = 0; j < swapTenors.size(); ++j) {
1051 for (Size k = 0; k < strikeSpreads.size(); ++k) {
1052 Size l = (i * swapTenors.size() * strikeSpreads.size()) + j * strikeSpreads.size() + k;
1053 Handle<Quote> quote = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(parRates[l]));
1054 if (close_enough(strikeSpreads[k], 0.0))
1055 parQuotes[i][j] = quote;
1056
1057 cubeQuotes[i * swapTenors.size() + j][k] = quote;
1058 allQuotes[l] = quote;
1059 }
1060 }
1061 }
1063 QuantLib::ext::shared_ptr<SwaptionVolatilityStructure> atm(new SwaptionVolatilityMatrix(
1064 asof_, cal, bdc, optionTenors, swapTenors, parQuotes, dc, true, QuantLib::Normal, shift));
1065
1066 Handle<SwaptionVolatilityStructure> hATM(atm);
1067 Handle<SwapIndex> si = swapIndex(swapIndexBase(name));
1068 Handle<SwapIndex> ssi = swapIndex(shortSwapIndexBase(name));
1069
1070 QuantLib::ext::shared_ptr<SwaptionVolatilityCube> tmp(new QuantExt::SwaptionVolCube2(
1071 hATM, optionTenors, swapTenors, strikeSpreads, cubeQuotes, *si, *ssi, false, true, false));
1072 tmp->enableExtrapolation();
1073
1074 Handle<SwaptionVolatilityStructure> svp =
1075 Handle<SwaptionVolatilityStructure>(QuantLib::ext::make_shared<SwaptionVolCubeWithATM>(tmp));
1076
1077 swaptionCurves_[make_pair(Market::defaultConfiguration, name)] = svp;
1078}
string shortSwapIndexBase(const string &key, const string &configuration=Market::defaultConfiguration) const override
string swapIndexBase(const string &key, const string &configuration=Market::defaultConfiguration) const override
map< pair< string, string >, Handle< QuantLib::SwaptionVolatilityStructure > > swaptionCurves_
Handle< SwapIndex > swapIndex(const string &indexName, const string &configuration=Market::defaultConfiguration) const override
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createZeroInflationIndex()

void createZeroInflationIndex ( const string &  idxName,
const vector< string > &  parInst,
const vector< Period > &  parTenor,
const vector< Real > &  parRates,
bool  singleCurve 
)
private

Definition at line 1080 of file testmarket.cpp.

1082 {
1083 QuantLib::ext::shared_ptr<Conventions> conventions = InstrumentConventions::instance().conventions();
1084 zeroInflationRateHelperInstMap_[idxName] = parInst;
1085 zeroInflationRateHelperTenorsMap_[idxName] = parTenor;
1086
1087 vector<Handle<Quote>> parQuotes(parRates.size());
1088 for (Size i = 0; i < parRates.size(); ++i)
1089 parQuotes[i] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(parRates[i] / 100));
1090 zeroInflationRateHelperValuesMap_[idxName] = parQuotes;
1091
1092 QuantLib::ext::shared_ptr<ZeroInflationIndex> zii = parseZeroInflationIndex(idxName);
1093 string ccy = zii->currency().code();
1094 QuantLib::ext::shared_ptr<ore::data::InflationSwapConvention> conv =
1095 QuantLib::ext::dynamic_pointer_cast<ore::data::InflationSwapConvention>(conventions->get(idxName));
1096
1097 std::vector<QuantLib::ext::shared_ptr<ZeroInflationTraits::helper>> instruments;
1098 ;
1099 for (Size i = 0; i < parTenor.size(); i++) {
1100 instruments.push_back(QuantLib::ext::make_shared<ZeroCouponInflationSwapHelper>(
1101 parQuotes[i], conv->observationLag(), asof_ + parTenor[i], conv->infCalendar(), conv->infConvention(),
1102 conv->dayCounter(), zii, conv->interpolated() ? QuantLib::CPI::Linear : QuantLib::CPI::Flat,
1103 yieldCurve(YieldCurveType::Discount, ccy, Market::defaultConfiguration)));
1104 }
1105 QuantLib::ext::shared_ptr<ZeroInflationTermStructure> zeroCurve;
1106 Real baseRate = parQuotes[0]->value();
1107 zeroCurve = QuantLib::ext::shared_ptr<PiecewiseZeroInflationCurve<Linear>>(
1108 new PiecewiseZeroInflationCurve<Linear>(asof_, conv->infCalendar(), conv->dayCounter(), conv->observationLag(),
1109 zii->frequency(), baseRate, instruments));
1110 Handle<ZeroInflationTermStructure> its(zeroCurve);
1111 its->enableExtrapolation();
1112 QuantLib::ext::shared_ptr<ZeroInflationIndex> i =
1113 ore::data::parseZeroInflationIndex(idxName, Handle<ZeroInflationTermStructure>(its));
1114 Handle<ZeroInflationIndex> zh(i);
1115 zeroInflationIndices_[make_pair(Market::defaultConfiguration, idxName)] = zh;
1116}
map< pair< string, string >, Handle< ZeroInflationIndex > > zeroInflationIndices_
QuantLib::ext::shared_ptr< ZeroInflationIndex > parseZeroInflationIndex(const string &s, const Handle< ZeroInflationTermStructure > &h=Handle< ZeroInflationTermStructure >())
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createYoYInflationIndex()

void createYoYInflationIndex ( const string &  idxName,
const vector< string > &  parInst,
const vector< Period > &  parTenor,
const vector< Real > &  parRates,
bool  singleCurve 
)
private

Definition at line 1118 of file testmarket.cpp.

1120 {
1121 QuantLib::ext::shared_ptr<Conventions> conventions = InstrumentConventions::instance().conventions();
1122 yoyInflationRateHelperInstMap_[idxName] = parInst;
1123 yoyInflationRateHelperTenorsMap_[idxName] = parTenor;
1124
1125 vector<Handle<Quote>> parQuotes(parRates.size());
1126 for (Size i = 0; i < parRates.size(); ++i)
1127 parQuotes[i] = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(parRates[i] / 100));
1128 yoyInflationRateHelperValuesMap_[idxName] = parQuotes;
1129
1130 QuantLib::ext::shared_ptr<ZeroInflationIndex> zii = parseZeroInflationIndex("UKRPI");
1131 QuantLib::ext::shared_ptr<YoYInflationIndex> yi = QuantLib::ext::make_shared<QuantExt::YoYInflationIndexWrapper>(zii, false);
1132 string ccy = zii->currency().code();
1133 QuantLib::ext::shared_ptr<ore::data::InflationSwapConvention> conv =
1134 QuantLib::ext::dynamic_pointer_cast<ore::data::InflationSwapConvention>(conventions->get(idxName));
1135
1136 std::vector<QuantLib::ext::shared_ptr<YoYInflationTraits::helper>> instruments;
1137 for (Size i = 0; i < parTenor.size(); i++) {
1138 instruments.push_back(QuantLib::ext::make_shared<YearOnYearInflationSwapHelper>(
1139 parQuotes[i], conv->observationLag(), asof_ + parTenor[i], conv->infCalendar(), conv->infConvention(),
1140 conv->dayCounter(), yi, yieldCurve(YieldCurveType::Discount, ccy, Market::defaultConfiguration)));
1141 }
1142 QuantLib::ext::shared_ptr<YoYInflationTermStructure> yoyCurve;
1143
1144 Real baseRate = parQuotes[0]->value();
1145 yoyCurve = QuantLib::ext::shared_ptr<PiecewiseYoYInflationCurve<Linear>>(
1146 new PiecewiseYoYInflationCurve<Linear>(asof_, conv->fixCalendar(), conv->dayCounter(), conv->observationLag(),
1147 yi->frequency(), conv->interpolated(), baseRate, instruments));
1148 yoyCurve->enableExtrapolation();
1149 Handle<YoYInflationTermStructure> its(yoyCurve);
1150 QuantLib::ext::shared_ptr<YoYInflationIndex> i(yi->clone(its));
1151 Handle<YoYInflationIndex> zh(i);
1152 yoyInflationIndices_[make_pair(Market::defaultConfiguration, idxName)] = zh;
1153}
map< pair< string, string >, Handle< YoYInflationIndex > > yoyInflationIndices_
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flatRateYts()

Handle< YieldTermStructure > flatRateYts ( Real  forward)
private

Definition at line 1155 of file testmarket.cpp.

1155 {
1156 QuantLib::ext::shared_ptr<YieldTermStructure> yts(
1157 new FlatForward(Settings::instance().evaluationDate(), forward, ActualActual(ActualActual::ISDA)));
1158 return Handle<YieldTermStructure>(yts);
1159}
+ Here is the caller graph for this function:

◆ flatRateFxv()

Handle< BlackVolTermStructure > flatRateFxv ( Volatility  forward)
private

Definition at line 1160 of file testmarket.cpp.

1160 {
1161 QuantLib::ext::shared_ptr<BlackVolTermStructure> fxv(
1162 new BlackConstantVol(Settings::instance().evaluationDate(), NullCalendar(), forward, Actual365Fixed()));
1163 return Handle<BlackVolTermStructure>(fxv);
1164}
+ Here is the caller graph for this function:

◆ flatRateSvs()

Handle< QuantLib::SwaptionVolatilityStructure > flatRateSvs ( Volatility  forward,
VolatilityType  type = ShiftedLognormal,
Real  shift = 0.0 
)
private

Definition at line 1165 of file testmarket.cpp.

1166 {
1167 QuantLib::ext::shared_ptr<QuantLib::SwaptionVolatilityStructure> svs(
1168 new QuantLib::ConstantSwaptionVolatility(Settings::instance().evaluationDate(), NullCalendar(),
1169 ModifiedFollowing, forward, ActualActual(ActualActual::ISDA), type, shift));
1170 return Handle<QuantLib::SwaptionVolatilityStructure>(svs);
1171}

◆ flatRateDcs()

Handle< DefaultProbabilityTermStructure > flatRateDcs ( Volatility  forward)
private

Definition at line 1172 of file testmarket.cpp.

1172 {
1173 QuantLib::ext::shared_ptr<DefaultProbabilityTermStructure> dcs(new FlatHazardRate(asof_, forward, ActualActual(ActualActual::ISDA)));
1174 return Handle<DefaultProbabilityTermStructure>(dcs);
1175}

◆ flatRateCvs()

Handle< OptionletVolatilityStructure > flatRateCvs ( Volatility  vol,
VolatilityType  type = Normal,
Real  shift = 0.0 
)
private

Definition at line 1176 of file testmarket.cpp.

1176 {
1177 QuantLib::ext::shared_ptr<OptionletVolatilityStructure> ts(new QuantLib::ConstantOptionletVolatility(
1178 Settings::instance().evaluationDate(), NullCalendar(), ModifiedFollowing, vol, ActualActual(ActualActual::ISDA), type, shift));
1179 return Handle<OptionletVolatilityStructure>(ts);
1180}
+ Here is the caller graph for this function:

Member Data Documentation

◆ discountRateHelperInstMap_

map<string, vector<string> > discountRateHelperInstMap_
private

Definition at line 203 of file testmarket.hpp.

◆ equityForecastRateHelperInstMap_

map<string, vector<string> > equityForecastRateHelperInstMap_
private

Definition at line 203 of file testmarket.hpp.

◆ indexCurveRateHelperInstMap_

map<string, vector<string> > indexCurveRateHelperInstMap_
private

Definition at line 204 of file testmarket.hpp.

◆ defaultRateHelperInstMap_

map<string, vector<string> > defaultRateHelperInstMap_
private

Definition at line 204 of file testmarket.hpp.

◆ zeroInflationRateHelperInstMap_

map<string, vector<string> > zeroInflationRateHelperInstMap_
private

Definition at line 204 of file testmarket.hpp.

◆ yoyInflationRateHelperInstMap_

map<string, vector<string> > yoyInflationRateHelperInstMap_
private

Definition at line 205 of file testmarket.hpp.

◆ discountRateHelperTenorsMap_

map<string, vector<Period> > discountRateHelperTenorsMap_
private

Definition at line 206 of file testmarket.hpp.

◆ equityForecastRateHelperTenorsMap_

map<string, vector<Period> > equityForecastRateHelperTenorsMap_
private

Definition at line 206 of file testmarket.hpp.

◆ indexCurveRateHelperTenorsMap_

map<string, vector<Period> > indexCurveRateHelperTenorsMap_
private

Definition at line 207 of file testmarket.hpp.

◆ defaultRateHelperTenorsMap_

map<string, vector<Period> > defaultRateHelperTenorsMap_
private

Definition at line 207 of file testmarket.hpp.

◆ cdsVolRateHelperTenorsMap_

map<string, vector<Period> > cdsVolRateHelperTenorsMap_
private

Definition at line 207 of file testmarket.hpp.

◆ swaptionVolRateHelperTenorsMap_

map<string, vector<Period> > swaptionVolRateHelperTenorsMap_
private

Definition at line 208 of file testmarket.hpp.

◆ swaptionVolRateHelperSwapTenorsMap_

map<string, vector<Period> > swaptionVolRateHelperSwapTenorsMap_
private

Definition at line 208 of file testmarket.hpp.

◆ equityVolRateHelperTenorsMap_

map<string, vector<Period> > equityVolRateHelperTenorsMap_
private

Definition at line 208 of file testmarket.hpp.

◆ baseCorrRateHelperTenorsMap_

map<string, vector<Period> > baseCorrRateHelperTenorsMap_
private

Definition at line 209 of file testmarket.hpp.

◆ zeroInflationRateHelperTenorsMap_

map<string, vector<Period> > zeroInflationRateHelperTenorsMap_
private

Definition at line 209 of file testmarket.hpp.

◆ yoyInflationRateHelperTenorsMap_

map<string, vector<Period> > yoyInflationRateHelperTenorsMap_
private

Definition at line 209 of file testmarket.hpp.

◆ baseCorrLossLevelsMap_

map<string, vector<string> > baseCorrLossLevelsMap_
private

Definition at line 210 of file testmarket.hpp.

◆ discountRateHelpersMap_

map<string, vector<QuantLib::ext::shared_ptr<RateHelper> > > discountRateHelpersMap_
private

Definition at line 211 of file testmarket.hpp.

◆ equityForecastRateHelpersMap_

map<string, vector<QuantLib::ext::shared_ptr<RateHelper> > > equityForecastRateHelpersMap_
private

Definition at line 211 of file testmarket.hpp.

◆ indexCurveRateHelpersMap_

map<string, vector<QuantLib::ext::shared_ptr<RateHelper> > > indexCurveRateHelpersMap_
private

Definition at line 212 of file testmarket.hpp.

◆ defaultRateHelpersMap_

map<string, vector<QuantLib::ext::shared_ptr<QuantExt::DefaultProbabilityHelper> > > defaultRateHelpersMap_
private

Definition at line 213 of file testmarket.hpp.

◆ discountRateHelperValuesMap_

map<string, vector<Handle<Quote> > > discountRateHelperValuesMap_
private

Definition at line 214 of file testmarket.hpp.

◆ equityForecastRateHelperValuesMap_

map<string, vector<Handle<Quote> > > equityForecastRateHelperValuesMap_
private

Definition at line 214 of file testmarket.hpp.

◆ indexCurveRateHelperValuesMap_

map<string, vector<Handle<Quote> > > indexCurveRateHelperValuesMap_
private

Definition at line 215 of file testmarket.hpp.

◆ defaultRateHelperValuesMap_

map<string, vector<Handle<Quote> > > defaultRateHelperValuesMap_
private

Definition at line 215 of file testmarket.hpp.

◆ cdsVolRateHelperValuesMap_

map<string, vector<Handle<Quote> > > cdsVolRateHelperValuesMap_
private

Definition at line 215 of file testmarket.hpp.

◆ swaptionVolRateHelperValuesMap_

map<string, vector<Handle<Quote> > > swaptionVolRateHelperValuesMap_
private

Definition at line 216 of file testmarket.hpp.

◆ equityVolRateHelperValuesMap_

map<string, vector<Handle<Quote> > > equityVolRateHelperValuesMap_
private

Definition at line 216 of file testmarket.hpp.

◆ baseCorrRateHelperValuesMap_

map<string, vector<Handle<Quote> > > baseCorrRateHelperValuesMap_
private

Definition at line 216 of file testmarket.hpp.

◆ zeroInflationRateHelperValuesMap_

map<string, vector<Handle<Quote> > > zeroInflationRateHelperValuesMap_
private

Definition at line 217 of file testmarket.hpp.

◆ yoyInflationRateHelperValuesMap_

map<string, vector<Handle<Quote> > > yoyInflationRateHelperValuesMap_
private

Definition at line 217 of file testmarket.hpp.