34#include <ql/math/interpolations/backwardflatinterpolation.hpp>
35#include <ql/math/interpolations/linearinterpolation.hpp>
36#include <ql/math/interpolations/loginterpolation.hpp>
54 const std::map<std::string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves = {},
55 const std::map<std::string, QuantLib::ext::shared_ptr<CommodityCurve>>& commodityCurves = {},
56 bool const buildCalibrationInfo =
false);
92 void populateData(std::map<QuantLib::Date, QuantLib::Handle<QuantLib::Quote>>& data,
const QuantLib::Date& asof,
93 const QuantLib::ext::shared_ptr<CommodityCurveConfig>& config,
const Loader& loader);
96 void add(
const QuantLib::Date& asof,
const QuantLib::Date& expiry, QuantLib::Real
value,
97 std::map<QuantLib::Date, QuantLib::Handle<QuantLib::Quote>>& data,
bool outright, QuantLib::Real pointsFactor = 1.0);
100 void buildCurve(
const QuantLib::Date& asof,
const std::map<QuantLib::Date, QuantLib::Handle<QuantLib::Quote>>& data,
101 const QuantLib::ext::shared_ptr<CommodityCurveConfig>& config);
105 const QuantLib::ext::shared_ptr<CommodityCurveConfig>& baseConfig,
107 const std::map<std::string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves,
108 const std::map<std::string, QuantLib::ext::shared_ptr<CommodityCurve>>& commodityCurves);
112 const QuantLib::Handle<QuantExt::PriceTermStructure>& basePts,
const Loader& loader);
117 const std::map<std::string, QuantLib::ext::shared_ptr<CommodityCurve>>& commodityCurves);
120 std::vector<QuantLib::ext::shared_ptr<CommodityForwardQuote>>
121 getQuotes(
const QuantLib::Date& asof,
const std::string& ,
const std::vector<std::string>& quotes,
125 template <
template <
class>
class CurveType,
typename... Args>
void populateCurve(Args... args);
128 using Helper = QuantLib::BootstrapHelper<QuantExt::PriceTermStructure>;
129 void addInstruments(
const QuantLib::Date& asof,
const Loader& loader,
const std::string& configId,
130 const std::string& currency,
const PriceSegment& priceSegment,
131 const std::map<std::string, QuantLib::ext::shared_ptr<CommodityCurve>>& commodityCurves,
132 std::map<QuantLib::Date, QuantLib::ext::shared_ptr<Helper>>& instruments);
137 std::map<QuantLib::Date, QuantLib::ext::shared_ptr<Helper>>& instruments);
150 args..., QuantLib::Cubic(QuantLib::CubicInterpolation::Parabolic));
Commodity curve configuration.
std::string interpolationMethod_
Store the interpolation method.
const CommodityCurveSpec & spec() const
QuantLib::ext::shared_ptr< QuantExt::CommodityIndex > commodityIndex_
QuantLib::ext::shared_ptr< QuantExt::PriceTermStructure > commodityPriceCurve_
QuantLib::ext::shared_ptr< CommodityCurveCalibrationInfo > calibrationInfo_
QuantLib::ext::shared_ptr< QuantExt::PriceTermStructure > commodityPriceCurve() const
QuantLib::Real onValue_
Store the overnight value if any.
QuantLib::BootstrapHelper< QuantExt::PriceTermStructure > Helper
Add the instruments relating to a priceSegment to instruments.
void buildCurve(const QuantLib::Date &asof, const std::map< QuantLib::Date, QuantLib::Handle< QuantLib::Quote > > &data, const QuantLib::ext::shared_ptr< CommodityCurveConfig > &config)
Build price curve using the curve data.
CommodityCurve()
Default constructor.
QuantLib::ext::shared_ptr< CommodityCurveCalibrationInfo > calibrationInfo() const
CommodityCurve(const QuantLib::Date &asof, const CommodityCurveSpec &spec, const Loader &loader, const CurveConfigurations &curveConfigs, const FXTriangulation &fxSpots=FXTriangulation(), const std::map< std::string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves={}, const std::map< std::string, QuantLib::ext::shared_ptr< CommodityCurve > > &commodityCurves={}, bool const buildCalibrationInfo=false)
Detailed constructor.
QuantLib::ext::shared_ptr< QuantExt::CommodityIndex > commodityIndex() const
void buildPiecewiseCurve(const QuantLib::Date &asof, const CommodityCurveConfig &config, const Loader &loader, const std::map< std::string, QuantLib::ext::shared_ptr< CommodityCurve > > &commodityCurves)
Build commodity piecewise price curve.
void buildCrossCurrencyPriceCurve(const QuantLib::Date &asof, const QuantLib::ext::shared_ptr< CommodityCurveConfig > &config, const QuantLib::ext::shared_ptr< CommodityCurveConfig > &baseConfig, const FXTriangulation &fxSpots, const std::map< std::string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves, const std::map< std::string, QuantLib::ext::shared_ptr< CommodityCurve > > &commodityCurves)
Build cross currency commodity price curve.
std::vector< QuantLib::ext::shared_ptr< CommodityForwardQuote > > getQuotes(const QuantLib::Date &asof, const std::string &, const std::vector< std::string > "es, const Loader &loader, bool filter=false)
Get the configured quotes. If filter is true, remove tenor based quotes and quotes with expiry before...
void add(const QuantLib::Date &asof, const QuantLib::Date &expiry, QuantLib::Real value, std::map< QuantLib::Date, QuantLib::Handle< QuantLib::Quote > > &data, bool outright, QuantLib::Real pointsFactor=1.0)
Add node to price curve data with check for duplicate expiry dates.
QuantLib::Real tnValue_
Store the tomorrow next value if any.
bool regexQuotes_
Populated with true if the quotes are configured via a wildcard.
QuantLib::DayCounter dayCounter_
Store the curve's day counter.
void addOffPeakPowerInstruments(const QuantLib::Date &asof, const Loader &loader, const std::string &configId, const PriceSegment &priceSegment, std::map< QuantLib::Date, QuantLib::ext::shared_ptr< Helper > > &instruments)
Special method to add instruments when the priceSegment is OffPeakPowerDaily.
void populateCurve(Args... args)
Method for populating the price curve.
void populateData(std::map< QuantLib::Date, QuantLib::Handle< QuantLib::Quote > > &data, const QuantLib::Date &asof, const QuantLib::ext::shared_ptr< CommodityCurveConfig > &config, const Loader &loader)
Populate data with dates and prices from the loader.
QuantLib::Real commoditySpot_
Store the commodity spot value with Null<Real>() indicating that none has been provided.
void buildBasisPriceCurve(const QuantLib::Date &asof, const CommodityCurveConfig &config, const QuantLib::Handle< QuantExt::PriceTermStructure > &basePts, const Loader &loader)
Build commodity basis price curve.
void addInstruments(const QuantLib::Date &asof, const Loader &loader, const std::string &configId, const std::string ¤cy, const PriceSegment &priceSegment, const std::map< std::string, QuantLib::ext::shared_ptr< CommodityCurve > > &commodityCurves, std::map< QuantLib::Date, QuantLib::ext::shared_ptr< Helper > > &instruments)
Commodity curve description.
Container class for all Curve Configurations.
Market data loader base class.
SafeStack< ValueType > value
SafeStack< Filter > filter
Currency and instrument specific conventions/defaults.
Curve configuration repository.
Curve requirements specification.
Intelligent FX price repository.
Market Datum Loader Interface.
Serializable Credit Default Swap.
vector< string > curveConfigs
a container holding information on calibration results during the t0 market build
Wrapper class for QuantLib term structures.