|
QuantLib: a free/open-source library for quantitative finance
Reference manual - version 1.40
|
base class for commodity indexes More...
#include <ql/experimental/commodities/commodityindex.hpp>
Public Member Functions | |
| CommodityIndex (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) | |
Index interface | |
| std::string | name () const override |
| Returns the name of the index. | |
| Calendar | fixingCalendar () const override |
| returns the calendar defining valid fixing dates | |
| bool | isValidFixingDate (const Date &fixingDate) const override |
| returns TRUE if the fixing date is a valid one | |
| Real | fixing (const Date &fixingDate, bool forecastTodaysFixing=false) const override |
| returns the fixing at the given date | |
Observer interface | |
| void | update () override |
| Public Member Functions inherited from Index | |
| bool | hasHistoricalFixing (const Date &fixingDate) const |
| returns whether a historical fixing was stored for the given date | |
| virtual Real | pastFixing (const Date &fixingDate) const |
| returns a past fixing at the given date | |
| const TimeSeries< Real > & | timeSeries () const |
| returns the fixing TimeSeries | |
| virtual bool | allowsNativeFixings () |
| check if index allows for native fixings. | |
| void | update () override |
| virtual void | addFixing (const Date &fixingDate, Real fixing, bool forceOverwrite=false) |
| void | addFixings (const TimeSeries< Real > &t, bool forceOverwrite=false) |
| stores historical fixings from a TimeSeries | |
| template<class DateIterator, class ValueIterator> | |
| void | addFixings (DateIterator dBegin, DateIterator dEnd, ValueIterator vBegin, bool forceOverwrite=false) |
| stores historical fixings at the given dates | |
| void | clearFixings () |
| clears all stored historical fixings | |
| Public Member Functions inherited from Observable | |
| Observable (const Observable &) | |
| Observable & | operator= (const Observable &) |
| Observable (Observable &&)=delete | |
| Observable & | operator= (Observable &&)=delete |
| void | notifyObservers () |
| Public Member Functions inherited from Observer | |
| Observer (const Observer &) | |
| Observer & | operator= (const 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 | deepUpdate () |
Inspectors | |
| std::string | name_ |
| CommodityType | commodityType_ |
| UnitOfMeasure | unitOfMeasure_ |
| Currency | currency_ |
| Calendar | calendar_ |
| Real | lotQuantity_ |
| ext::shared_ptr< CommodityCurve > | forwardCurve_ |
| Real | forwardCurveUomConversionFactor_ = 1 |
| ext::shared_ptr< ExchangeContracts > | exchangeContracts_ |
| Integer | nearbyOffset_ |
| const CommodityType & | commodityType () const |
| const Currency & | currency () const |
| const UnitOfMeasure & | unitOfMeasure () const |
| const ext::shared_ptr< CommodityCurve > & | forwardCurve () const |
| Real | lotQuantity () const |
| Real | forwardPrice (const Date &date) const |
| Date | lastQuoteDate () const |
| bool | empty () const |
| bool | forwardCurveEmpty () const |
| const Calendar & | calendar () const |
| Real | price (const Date &date) |
| void | addQuote (const Date "eDate, Real quote) |
| void | addQuotes (const std::map< Date, Real > "es) |
| void | clearQuotes () |
| bool | isValidQuoteDate (const Date "eDate) const |
| const TimeSeries< Real > & | quotes () const |
| std::ostream & | operator<< (std::ostream &, const CommodityIndex &) |
Additional Inherited Members | |
| Public Types inherited from Observer | |
| typedef set_type::iterator | iterator |
| ext::shared_ptr< Observable > | notifier () const |
base class for commodity indexes
|
overridevirtual |
|
overridevirtual |
returns the calendar defining valid fixing dates
Implements Index.
|
overridevirtual |
returns TRUE if the fixing date is a valid one
Implements Index.
returns the fixing at the given date
the date passed as arguments must be the actual calendar date of the fixing; no settlement days must be used.
Implements Index.
|
overridevirtual |
This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.
Implements Observer.
| const Calendar & calendar | ( | ) | const |
| void clearQuotes | ( | ) |
| bool isValidQuoteDate | ( | const Date & | quoteDate | ) | const |
| const TimeSeries< Real > & quotes | ( | ) | const |