QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Commodity term structure. More...
#include <commoditycurve.hpp>
Public Member Functions | |
CommodityCurve (std::string name, CommodityType commodityType, Currency currency, UnitOfMeasure unitOfMeasure, const Calendar &calendar, const std::vector< Date > &dates, std::vector< Real > prices, const DayCounter &dayCounter=Actual365Fixed()) | |
CommodityCurve (std::string name, CommodityType commodityType, Currency currency, UnitOfMeasure unitOfMeasure, const Calendar &calendar, const DayCounter &dayCounter=Actual365Fixed()) | |
Public Member Functions inherited from TermStructure | |
TermStructure (DayCounter dc=DayCounter()) | |
default constructor More... | |
TermStructure (const Date &referenceDate, Calendar calendar=Calendar(), DayCounter dc=DayCounter()) | |
initialize with a fixed reference date More... | |
TermStructure (Natural settlementDays, Calendar, DayCounter dc=DayCounter()) | |
calculate the reference date based on the global evaluation date More... | |
~TermStructure () override=default | |
virtual DayCounter | dayCounter () const |
the day counter used for date/time conversion More... | |
Time | timeFromReference (const Date &date) const |
date/time conversion More... | |
virtual Time | maxTime () const |
the latest time for which the curve can return values More... | |
virtual const Date & | referenceDate () const |
the date at which discount = 1.0 and/or variance = 0.0 More... | |
virtual Calendar | calendar () const |
the calendar used for reference and/or option date calculation More... | |
virtual Natural | settlementDays () const |
the settlementDays used for reference date calculation More... | |
void | update () override |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
void | registerWithObservables (const ext::shared_ptr< Observer > &) |
Size | unregisterWith (const ext::shared_ptr< Observable > &) |
void | unregisterWithAll () |
virtual void | update ()=0 |
virtual void | deepUpdate () |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Public Member Functions inherited from Extrapolator | |
Extrapolator ()=default | |
virtual | ~Extrapolator ()=default |
void | enableExtrapolation (bool b=true) |
enable extrapolation in subsequent calls More... | |
void | disableExtrapolation (bool b=true) |
disable extrapolation in subsequent calls More... | |
bool | allowsExtrapolation () const |
tells whether extrapolation is enabled More... | |
Friends | |
class | CommodityIndex |
Inspectors | |
std::ostream & | operator<< (std::ostream &out, const CommodityCurve &curve) |
std::string | name_ |
CommodityType | commodityType_ |
UnitOfMeasure | unitOfMeasure_ |
Currency | currency_ |
std::vector< Date > | dates_ |
std::vector< Time > | times_ |
std::vector< Real > | data_ |
Interpolation | interpolation_ |
ForwardFlat | interpolator_ |
ext::shared_ptr< CommodityCurve > | basisOfCurve_ |
Real | basisOfCurveUomConversionFactor_ |
const std::string & | name () const |
const CommodityType & | commodityType () const |
const UnitOfMeasure & | unitOfMeasure () const |
const Currency & | currency () const |
Date | maxDate () const override |
the latest date for which the curve can return values More... | |
const std::vector< Time > & | times () const |
const std::vector< Date > & | dates () const |
const std::vector< Real > & | prices () const |
std::vector< std::pair< Date, Real > > | nodes () const |
bool | empty () const |
void | setPrices (std::map< Date, Real > &prices) |
void | setBasisOfCurve (const ext::shared_ptr< CommodityCurve > &basisOfCurve) |
Real | price (const Date &d, const ext::shared_ptr< ExchangeContracts > &exchangeContracts, Integer nearbyOffset) const |
Real | basisOfPrice (const Date &d) const |
Date | underlyingPriceDate (const Date &date, const ext::shared_ptr< ExchangeContracts > &exchangeContracts, Integer nearbyOffset) const |
const ext::shared_ptr< CommodityCurve > & | basisOfCurve () const |
Real | basisOfPriceImpl (Time t) const |
Real | priceImpl (Time t) const |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Protected Member Functions inherited from TermStructure | |
void | checkRange (const Date &d, bool extrapolate) const |
date-range check More... | |
void | checkRange (Time t, bool extrapolate) const |
time-range check More... | |
Protected Attributes inherited from TermStructure | |
bool | moving_ = false |
bool | updated_ = true |
Calendar | calendar_ |
Commodity term structure.
Definition at line 38 of file commoditycurve.hpp.
CommodityCurve | ( | std::string | name, |
CommodityType | commodityType, | ||
Currency | currency, | ||
UnitOfMeasure | unitOfMeasure, | ||
const Calendar & | calendar, | ||
const std::vector< Date > & | dates, | ||
std::vector< Real > | prices, | ||
const DayCounter & | dayCounter = Actual365Fixed() |
||
) |
CommodityCurve | ( | std::string | name, |
CommodityType | commodityType, | ||
Currency | currency, | ||
UnitOfMeasure | unitOfMeasure, | ||
const Calendar & | calendar, | ||
const DayCounter & | dayCounter = Actual365Fixed() |
||
) |
Definition at line 57 of file commoditycurve.cpp.
const std::string & name | ( | ) | const |
const CommodityType & commodityType | ( | ) | const |
Definition at line 114 of file commoditycurve.hpp.
const UnitOfMeasure & unitOfMeasure | ( | ) | const |
Definition at line 118 of file commoditycurve.hpp.
const Currency & currency | ( | ) | const |
Definition at line 122 of file commoditycurve.hpp.
|
overridevirtual |
the latest date for which the curve can return values
Implements TermStructure.
Definition at line 130 of file commoditycurve.hpp.
const std::vector< Time > & times | ( | ) | const |
Definition at line 134 of file commoditycurve.hpp.
const std::vector< Date > & dates | ( | ) | const |
Definition at line 138 of file commoditycurve.hpp.
const std::vector< Real > & prices | ( | ) | const |
Definition at line 155 of file commoditycurve.hpp.
bool empty | ( | ) | const |
Definition at line 146 of file commoditycurve.hpp.
void setBasisOfCurve | ( | const ext::shared_ptr< CommodityCurve > & | basisOfCurve | ) |
Real price | ( | const Date & | d, |
const ext::shared_ptr< ExchangeContracts > & | exchangeContracts, | ||
Integer | nearbyOffset | ||
) | const |
Date underlyingPriceDate | ( | const Date & | date, |
const ext::shared_ptr< ExchangeContracts > & | exchangeContracts, | ||
Integer | nearbyOffset | ||
) | const |
Definition at line 187 of file commoditycurve.hpp.
const ext::shared_ptr< CommodityCurve > & basisOfCurve | ( | ) | const |
Definition at line 205 of file commoditycurve.hpp.
|
friend |
Definition at line 39 of file commoditycurve.hpp.
|
friend |
Definition at line 99 of file commoditycurve.cpp.
|
protected |
Definition at line 92 of file commoditycurve.hpp.
|
protected |
Definition at line 93 of file commoditycurve.hpp.
|
protected |
Definition at line 94 of file commoditycurve.hpp.
|
protected |
Definition at line 95 of file commoditycurve.hpp.
|
mutableprotected |
Definition at line 96 of file commoditycurve.hpp.
|
mutableprotected |
Definition at line 97 of file commoditycurve.hpp.
|
mutableprotected |
Definition at line 98 of file commoditycurve.hpp.
|
mutableprotected |
Definition at line 99 of file commoditycurve.hpp.
|
protected |
Definition at line 100 of file commoditycurve.hpp.
|
protected |
Definition at line 101 of file commoditycurve.hpp.
|
protected |
Definition at line 102 of file commoditycurve.hpp.