QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Cash flow dependent on a zero inflation index ratio. More...
#include <zeroinflationcashflow.hpp>
Public Member Functions | |
ZeroInflationCashFlow (Real notional, const ext::shared_ptr< ZeroInflationIndex > &index, CPI::InterpolationType observationInterpolation, const Date &startDate, const Date &endDate, const Period &observationLag, const Date &paymentDate, bool growthOnly=false) | |
ZeroInflationCashFlow interface | |
ext::shared_ptr< ZeroInflationIndex > | zeroInflationIndex () const |
CPI::InterpolationType | observationInterpolation () const |
CashFlow interface | |
void | performCalculations () const override |
Public Member Functions inherited from IndexedCashFlow | |
IndexedCashFlow (Real notional, ext::shared_ptr< Index > index, const Date &baseDate, const Date &fixingDate, const Date &paymentDate, bool growthOnly=false) | |
Date | date () const override |
virtual Real | notional () const |
virtual Date | baseDate () const |
virtual Date | fixingDate () const |
virtual ext::shared_ptr< Index > | index () const |
virtual bool | growthOnly () const |
virtual Real | baseFixing () const |
virtual Real | indexFixing () const |
Real | amount () const override |
returns the amount of the cash flow More... | |
Public Member Functions inherited from CashFlow | |
~CashFlow () override=default | |
bool | hasOccurred (const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const override |
returns true if an event has already occurred before a date More... | |
virtual Date | exCouponDate () const |
returns the date that the cash flow trades exCoupon More... | |
bool | tradingExCoupon (const Date &refDate=Date()) const |
returns true if the cashflow is trading ex-coupon on the refDate More... | |
Public Member Functions inherited from Event | |
~Event () override=default | |
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 LazyObject | |
LazyObject () | |
~LazyObject () override=default | |
void | update () override |
bool | isCalculated () const |
void | forwardFirstNotificationOnly () |
void | alwaysForwardNotifications () |
void | recalculate () |
void | freeze () |
void | unfreeze () |
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 () |
Visitability | |
ext::shared_ptr< ZeroInflationIndex > | zeroInflationIndex_ |
CPI::InterpolationType | observationInterpolation_ |
Date | startDate_ |
Date | endDate_ |
Period | observationLag_ |
void | accept (AcyclicVisitor &) override |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Protected Member Functions inherited from LazyObject | |
virtual void | calculate () const |
Protected Attributes inherited from IndexedCashFlow | |
Real | amount_ |
Protected Attributes inherited from LazyObject | |
bool | calculated_ = false |
bool | frozen_ = false |
bool | alwaysForward_ |
Cash flow dependent on a zero inflation index ratio.
The ratio is taken between fixings observed at the start date and the end date minus the observation lag; that is, if the start and end dates are, e.g., in June and the observation lag is three months, the ratio will be taken between March fixings.
Definition at line 38 of file zeroinflationcashflow.hpp.
ZeroInflationCashFlow | ( | Real | notional, |
const ext::shared_ptr< ZeroInflationIndex > & | index, | ||
CPI::InterpolationType | observationInterpolation, | ||
const Date & | startDate, | ||
const Date & | endDate, | ||
const Period & | observationLag, | ||
const Date & | paymentDate, | ||
bool | growthOnly = false |
||
) |
The fixings dates for the index are startDate - observationLag
and endDate - observationLag
.
Definition at line 27 of file zeroinflationcashflow.cpp.
ext::shared_ptr< ZeroInflationIndex > zeroInflationIndex | ( | ) | const |
Definition at line 54 of file zeroinflationcashflow.hpp.
CPI::InterpolationType observationInterpolation | ( | ) | const |
Definition at line 57 of file zeroinflationcashflow.hpp.
|
overridevirtual |
This method must implement any calculations which must be (re)done in order to calculate the desired results.
Reimplemented from IndexedCashFlow.
Definition at line 41 of file zeroinflationcashflow.cpp.
|
overridevirtual |
Reimplemented from IndexedCashFlow.
Definition at line 59 of file zeroinflationcashflow.cpp.
|
private |
Definition at line 72 of file zeroinflationcashflow.hpp.
|
private |
Definition at line 73 of file zeroinflationcashflow.hpp.
|
private |
Definition at line 74 of file zeroinflationcashflow.hpp.
|
private |
Definition at line 74 of file zeroinflationcashflow.hpp.
|
private |
Definition at line 75 of file zeroinflationcashflow.hpp.