32 ext::shared_ptr<CommodityCurve> forwardCurve,
33 ext::shared_ptr<ExchangeContracts> exchangeContracts,
35 : name_(indexName), commodityType_(
std::move(commodityType)),
36 unitOfMeasure_(
std::move(unitOfMeasure)), currency_(
std::move(currency)),
37 calendar_(
std::move(calendar)), lotQuantity_(lotQuantity),
38 forwardCurve_(
std::move(forwardCurve)), exchangeContracts_(
std::move(exchangeContracts)),
39 nearbyOffset_(nearbyOffset) {
55 out <<
"[" << index.
name_ <<
"] ("
base class for commodity indexes
UnitOfMeasure unitOfMeasure_
Real forwardCurveUomConversionFactor_
CommodityType commodityType_
CommodityIndex(const std::string &name, CommodityType commodityType, Currency currency, UnitOfMeasure unitOfMeasure, Calendar calendar, Real lotQuantity, ext::shared_ptr< CommodityCurve > forwardCurve, ext::shared_ptr< ExchangeContracts > exchangeContracts, int nearbyOffset)
TimeSeries< Real > quotes_
ext::shared_ptr< CommodityCurve > forwardCurve_
static Real calculateUomConversionFactor(const CommodityType &commodityType, const UnitOfMeasure &fromUnitOfMeasure, const UnitOfMeasure &toUnitOfMeasure)
const std::string & code() const
ISO 4217 three-letter code, e.g, "USD".
const TimeSeries< Real > & getHistory(const std::string &name) const
returns the (possibly empty) history of the index fixings
void setHistory(const std::string &name, TimeSeries< Real > history)
stores the historical fixings of the index
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
static IndexManager & instance()
access to the unique instance
Unit of measure specification
const std::string & code() const
code, e.g, "BBL", "MT"
Commodity pricing helpers.
std::ostream & operator<<(std::ostream &out, GFunctionFactory::YieldCurveModel type)