Logo
Reference manual - version ored_version
CommodityForwardQuote Class Reference

Commodity forward quote class. More...

#include <ored/marketdata/marketdatum.hpp>

Inheritance diagram for CommodityForwardQuote:

Public Member Functions

 CommodityForwardQuote (QuantLib::Real value, const QuantLib::Date &asofDate, const std::string &name, QuoteType quoteType, const std::string &commodityName, const std::string &quoteCurrency, const QuantLib::Date &expiryDate)
 Date based commodity forward constructor.
 CommodityForwardQuote (QuantLib::Real value, const QuantLib::Date &asofDate, const std::string &name, QuoteType quoteType, const std::string &commodityName, const std::string &quoteCurrency, const QuantLib::Period &tenor, boost::optional< QuantLib::Period > startTenor=boost::none)
 Tenor based commodity forward constructor.
QuantLib::ext::shared_ptr< MarketDatum > clone () override
 Make a copy of the market datum.
Public Member Functions inherited from MarketDatum
 MarketDatum (Real value, Date asofDate, const string &name, QuoteType quoteType, InstrumentType instrumentType)
 Constructor.
virtual ~MarketDatum ()
 Default destructor.
const stringname () const
const Handle< Quote > & quote () const
Date asofDate () const
InstrumentType instrumentType () const
QuoteType quoteType () const
void setValue (const double v)

Inspectors

class boost::serialization::access
 Serialization.
const std::string & commodityName () const
const std::string & quoteCurrency () const
const QuantLib::Date & expiryDate () const
 The commodity forward's expiry if the quote is date based.
const QuantLib::Period & tenor () const
 The commodity forward's tenor if the quote is tenor based.
const boost::optional< QuantLib::Period > & startTenor () const
bool tenorBased () const
 Returns true if the forward is tenor based and false if forward is date based.

Additional Inherited Members

Public Types inherited from MarketDatum
enum class  InstrumentType {
  ZERO , DISCOUNT , MM , MM_FUTURE ,
  OI_FUTURE , FRA , IMM_FRA , IR_SWAP ,
  BASIS_SWAP , BMA_SWAP , CC_BASIS_SWAP , CC_FIX_FLOAT_SWAP ,
  CDS , CDS_INDEX , FX_SPOT , FX_FWD ,
  HAZARD_RATE , RECOVERY_RATE , SWAPTION , CAPFLOOR ,
  FX_OPTION , ZC_INFLATIONSWAP , ZC_INFLATIONCAPFLOOR , YY_INFLATIONSWAP ,
  YY_INFLATIONCAPFLOOR , SEASONALITY , EQUITY_SPOT , EQUITY_FWD ,
  EQUITY_DIVIDEND , EQUITY_OPTION , BOND , BOND_FUTURE ,
  BOND_OPTION , INDEX_CDS_OPTION , INDEX_CDS_TRANCHE , COMMODITY_SPOT ,
  COMMODITY_FWD , CORRELATION , COMMODITY_OPTION , CPR ,
  RATING , NONE
}
 Supported market instrument types.
enum class  QuoteType {
  BASIS_SPREAD , CREDIT_SPREAD , CONV_CREDIT_SPREAD , YIELD_SPREAD ,
  HAZARD_RATE , RATE , RATIO , PRICE ,
  RATE_LNVOL , RATE_NVOL , RATE_SLNVOL , BASE_CORRELATION ,
  SHIFT , TRANSITION_PROBABILITY , CONVERSION_FACTOR , NONE
}
 Supported market quote types.
Handle< Quote > quote_
Date asofDate_
string name_
InstrumentType instrumentType_
QuoteType quoteType_

Detailed Description

Commodity forward quote class.

This class holds a forward price for a commodity in a given currency

Member Function Documentation

◆ clone()

QuantLib::ext::shared_ptr< MarketDatum > clone ( )
overridevirtual

Make a copy of the market datum.

Reimplemented from MarketDatum.

◆ startTenor()

const boost::optional< QuantLib::Period > & startTenor ( ) const

The period between the as of date and the date from which the forward tenor is applied. This is generally the spot tenor which is indicated by boost::none but there are special cases:

  • overnight forward: startTenor will be 0 * Days and tenor will be 1 * Days
  • tom-next forward: startTenor will be 1 * Days and tenor will be 1 * Days