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

Base market data class. More...

#include <ored/marketdata/marketdatum.hpp>

+ Inheritance diagram for MarketDatum:
+ Collaboration diagram for MarketDatum:

Public Types

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_OPTION ,
  INDEX_CDS_OPTION , COMMODITY_SPOT , COMMODITY_FWD , CORRELATION ,
  COMMODITY_OPTION , CPR , RATING , NONE
}
 Supported market instrument types. More...
 
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 , NONE
}
 Supported market quote types. More...
 

Public Member Functions

 MarketDatum ()
 
 MarketDatum (Real value, Date asofDate, const string &name, QuoteType quoteType, InstrumentType instrumentType)
 Constructor. More...
 
virtual ~MarketDatum ()
 Default destructor. More...
 
virtual QuantLib::ext::shared_ptr< MarketDatumclone ()
 Make a copy of the market datum. More...
 

Inspectors

Handle< Quote > quote_
 
Date asofDate_
 
string name_
 
InstrumentType instrumentType_
 
QuoteType quoteType_
 
class boost::serialization::access
 Serialization. More...
 
const string & name () const
 
const Handle< Quote > & quote () const
 
Date asofDate () const
 
InstrumentType instrumentType () const
 
QuoteType quoteType () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Detailed Description

Base market data class.

This class holds a single market point, a SimpleQuote pointer and generic additional information.

The market point is classified by an instrument type, a quote type and a name string. The name's structure depends on the market point's type with tokens separated by "/".

Specific market data classes are derived from this base class and hold additional specific data that are represented by the market point's name.

Definition at line 78 of file marketdatum.hpp.

Member Enumeration Documentation

◆ InstrumentType

enum class InstrumentType
strong

Supported market instrument types.

Enumerator
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_OPTION 
INDEX_CDS_OPTION 
COMMODITY_SPOT 
COMMODITY_FWD 
CORRELATION 
COMMODITY_OPTION 
CPR 
RATING 
NONE 

Definition at line 82 of file marketdatum.hpp.

82 {
83 ZERO,
85 MM,
88 FRA,
89 IMM_FRA,
90 IR_SWAP,
95 CDS,
97 FX_SPOT,
98 FX_FWD,
101 SWAPTION,
102 CAPFLOOR,
103 FX_OPTION,
113 BOND,
120 CPR,
121 RATING,
122 NONE
123 };

◆ QuoteType

enum class QuoteType
strong

Supported market quote types.

Enumerator
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 
NONE 

Definition at line 126 of file marketdatum.hpp.

Constructor & Destructor Documentation

◆ MarketDatum() [1/2]

Definition at line 80 of file marketdatum.hpp.

80{}

◆ MarketDatum() [2/2]

MarketDatum ( Real  value,
Date  asofDate,
const string &  name,
QuoteType  quoteType,
InstrumentType  instrumentType 
)

Constructor.

Definition at line 145 of file marketdatum.hpp.

146 : quote_(QuantLib::ext::make_shared<SimpleQuote>(value)), asofDate_(asofDate), name_(name),
InstrumentType instrumentType() const
InstrumentType instrumentType_
Handle< Quote > quote_
const string & name() const
QuoteType quoteType() const
SafeStack< ValueType > value

◆ ~MarketDatum()

virtual ~MarketDatum ( )
virtual

Default destructor.

Definition at line 150 of file marketdatum.hpp.

150{}

Member Function Documentation

◆ clone()

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

◆ name()

const string & name ( ) const

Definition at line 159 of file marketdatum.hpp.

159{ return name_; }
+ Here is the caller graph for this function:

◆ quote()

const Handle< Quote > & quote ( ) const

Definition at line 160 of file marketdatum.hpp.

160{ return quote_; }

◆ asofDate()

Date asofDate ( ) const

Definition at line 161 of file marketdatum.hpp.

161{ return asofDate_; }
+ Here is the caller graph for this function:

◆ instrumentType()

InstrumentType instrumentType ( ) const

Definition at line 162 of file marketdatum.hpp.

162{ return instrumentType_; }

◆ quoteType()

QuoteType quoteType ( ) const

Definition at line 163 of file marketdatum.hpp.

163{ return quoteType_; }
+ Here is the caller graph for this function:

◆ serialize()

template void serialize ( Archive &  ar,
const unsigned int  version 
)
private

Definition at line 314 of file marketdatum.cpp.

314 {
315 Real value;
316 // save / load the value of the quote, do not try to serialize the quote as such
317 if (Archive::is_saving::value) {
318 value = quote_->value();
319 ar& value;
320 } else {
321 ar& value;
322 quote_ = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(value));
323 }
324 ar& asofDate_;
325 ar& name_;
326 ar& instrumentType_;
327 ar& quoteType_;
328}

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialization.

Definition at line 174 of file marketdatum.hpp.

Member Data Documentation

◆ quote_

Handle<Quote> quote_
protected

Definition at line 166 of file marketdatum.hpp.

◆ asofDate_

Date asofDate_
protected

Definition at line 167 of file marketdatum.hpp.

◆ name_

string name_
protected

Definition at line 168 of file marketdatum.hpp.

◆ instrumentType_

InstrumentType instrumentType_
protected

Definition at line 169 of file marketdatum.hpp.

◆ quoteType_

QuoteType quoteType_
protected

Definition at line 170 of file marketdatum.hpp.