33#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
52 const std::map<std::string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves = {},
53 const std::map<std::string, QuantLib::ext::shared_ptr<CommodityCurve>>& commodityCurves = {},
54 const std::map<std::string, QuantLib::ext::shared_ptr<CommodityVolCurve>>& commodityVolCurves = {},
55 const map<string, QuantLib::ext::shared_ptr<FXVolCurve>>& fxVolCurves = {},
56 const map<string, QuantLib::ext::shared_ptr<CorrelationCurve>>& correlationCurves = {},
57 const Market* fxIndices =
nullptr,
const bool buildCalibrationInfo =
true);
73 QuantLib::ext::shared_ptr<QuantLib::BlackVolTermStructure>
volatility_;
74 QuantLib::ext::shared_ptr<QuantExt::FutureExpiryCalculator>
expCalc_;
75 QuantLib::ext::shared_ptr<CommodityFutureConvention>
convention_;
82 QuantLib::Handle<QuantExt::PriceTermStructure>
pts_;
83 QuantLib::Handle<QuantLib::YieldTermStructure>
yts_;
103 const std::vector<QuantLib::Real>& configuredStrikes);
122 const QuantLib::Handle<QuantLib::BlackVolTermStructure>& baseVts,
123 const QuantLib::Handle<QuantExt::PriceTermStructure>& basePts);
128 const map<
string, QuantLib::ext::shared_ptr<CommodityCurve>>& comCurves,
129 const map<
string, QuantLib::ext::shared_ptr<CommodityVolCurve>>& volCurves,
130 const map<
string, QuantLib::ext::shared_ptr<FXVolCurve>>& fxVolCurves,
131 const map<
string, QuantLib::ext::shared_ptr<CorrelationCurve>>& correlationCurves,
132 const Market* fxIndices =
nullptr);
141 QuantLib::Handle<QuantExt::PriceTermStructure>
143 const QuantLib::ext::shared_ptr<QuantExt::PriceTermStructure>& pts,
144 const std::vector<QuantLib::Date>& optionExpiries)
const;
147 QuantLib::Date
getExpiry(
const QuantLib::Date& asof,
const QuantLib::ext::shared_ptr<Expiry>& expiry,
148 const std::string&
name, QuantLib::Natural rollDays)
const;
152 const std::map<std::string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves,
153 const std::map<std::string, QuantLib::ext::shared_ptr<CommodityCurve>>& commodityCurves,
154 bool searchYield,
bool dontThrow =
false);
157 std::vector<QuantLib::Real>
checkMoneyness(
const std::vector<std::string>& moneynessLevels)
const;
Wrapper class for building commodity volatility structures.
void buildVolatility(const QuantLib::Date &asof, const CommodityVolatilityConfig &vc, const ConstantVolatilityConfig &cvc, const Loader &loader)
Build a volatility structure from a single constant volatility quote.
QuantLib::Date getExpiry(const QuantLib::Date &asof, const QuantLib::ext::shared_ptr< Expiry > &expiry, const std::string &name, QuantLib::Natural rollDays) const
Get an explicit expiry date from a commodity option quote's Expiry.
QuantLib::ext::shared_ptr< QuantExt::FutureExpiryCalculator > expCalc_
const QuantLib::ext::shared_ptr< FxEqCommVolCalibrationInfo > & calibrationInfo() const
void buildVolatility(const QuantLib::Date &asof, CommodityVolatilityConfig &vc, const VolatilityMoneynessSurfaceConfig &vmsc, const Loader &loader)
const QuantLib::ext::shared_ptr< QuantLib::BlackVolTermStructure > & volatility()
QuantLib::Handle< QuantExt::PriceTermStructure > pts_
CommodityVolatilityCurveSpec spec_
QuantLib::ext::shared_ptr< CommodityFutureConvention > convention_
QuantLib::ext::shared_ptr< QuantLib::BlackVolTermStructure > volatility_
QuantLib::ext::shared_ptr< FxEqCommVolCalibrationInfo > calibrationInfo_
void buildVolatility(const QuantLib::Date &asof, CommodityVolatilityConfig &vc, const VolatilityApoFutureSurfaceConfig &vapo, const QuantLib::Handle< QuantLib::BlackVolTermStructure > &baseVts, const QuantLib::Handle< QuantExt::PriceTermStructure > &basePts)
void buildVolCalibrationInfo(const Date &asof, QuantLib::ext::shared_ptr< VolatilityConfig > &volatilityConfig, const CurveConfigurations &curveConfigs, const CommodityVolatilityConfig &config)
Build the calibration info.
QuantLib::Date maxExpiry_
QuantLib::Calendar calendar_
QuantLib::Handle< QuantExt::PriceTermStructure > correctFuturePriceCurve(const QuantLib::Date &asof, const std::string &contractName, const QuantLib::ext::shared_ptr< QuantExt::PriceTermStructure > &pts, const std::vector< QuantLib::Date > &optionExpiries) const
void populateCurves(const CommodityVolatilityConfig &config, const std::map< std::string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves, const std::map< std::string, QuantLib::ext::shared_ptr< CommodityCurve > > &commodityCurves, bool searchYield, bool dontThrow=false)
Populate price curve, pts_, and yield curve, yts_.
const CommodityVolatilityCurveSpec & spec() const
void buildVolatility(const QuantLib::Date &asof, CommodityVolatilityConfig &vc, const VolatilityDeltaSurfaceConfig &vdsc, const Loader &loader)
void buildVolatility(const QuantLib::Date &asof, CommodityVolatilityConfig &vc, const VolatilityStrikeSurfaceConfig &vssc, const Loader &loader)
Build a volatility surface from a collection of expiry and absolute strike pairs.
CommodityVolCurve()
Default constructor.
CommodityVolCurve(const QuantLib::Date &asof, const CommodityVolatilityCurveSpec &spec, const Loader &loader, const CurveConfigurations &curveConfigs, const std::map< std::string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves={}, const std::map< std::string, QuantLib::ext::shared_ptr< CommodityCurve > > &commodityCurves={}, const std::map< std::string, QuantLib::ext::shared_ptr< CommodityVolCurve > > &commodityVolCurves={}, const map< string, QuantLib::ext::shared_ptr< FXVolCurve > > &fxVolCurves={}, const map< string, QuantLib::ext::shared_ptr< CorrelationCurve > > &correlationCurves={}, const Market *fxIndices=nullptr, const bool buildCalibrationInfo=true)
Detailed constructor.
QuantLib::Handle< QuantLib::YieldTermStructure > yts_
std::vector< QuantLib::Real > checkMoneyness(const std::vector< std::string > &moneynessLevels) const
Check and return moneyness levels.
void buildVolatilityExplicit(const QuantLib::Date &asof, CommodityVolatilityConfig &vc, const VolatilityStrikeSurfaceConfig &vssc, const Loader &loader, const std::vector< QuantLib::Real > &configuredStrikes)
QuantLib::DayCounter dayCounter_
Commodity volatility configuration.
Commodity volatility description.
Container class for all Curve Configurations.
Market data loader base class.
Class for building a commodity price curve.
Currency and instrument specific conventions/defaults.
Curve configuration repository.
Curve requirements specification.
Wrapper class for building FX volatility structures.
Market Datum Loader Interface.
Serializable Credit Default Swap.
vector< string > curveConfigs
Wrapper class for QuantLib term structures.