returns the net present value of the instrument.
accrued amount at a given date The default bond settlement is used if no date is given.
This method can be called by derived classes in order to
build redemption payments from the existing cash flows.
It must be called after setting up the _cashflows
vector
and will fill the _notionalSchedule
, _notionals
, and
_redemptions
data members.
If given, the elements of the redemptions vector will multiply the amount of the redemption cash flow. The elements will be taken in base 100, i.e., a redemption equal to 100 does not modify the amount.
The _cashflows
vector must contain at least one
coupon and must be sorted by date.
returns all additional result returned by the pricing engine.
This method causes the object to forward all notifications, even when not calculated. The default behavior is to forward the first notification received, and discard the others until recalculated; the rationale is that observers were already notified, and don't need further notification until they recalculate, at which point this object would be recalculated too. After recalculation, this object would again forward the first notification received.
warning Forwarding all notifications will cause a performance hit, and should be used only when discarding notifications cause an incorrect behavior.
used internally to collect notional information from the
coupons. It should not be called by derived classes,
unless they already provide redemption cash flows (in
which case they must set up the _redemptions
data member
independently). It will fill the _notionalSchedule
and
_notionals
data members.
note returns all the cashflows, including the redemptions.
theoretical clean price
The default bond settlement is used for calculation.
warning the theoretical price calculated from a flat term structure might differ slightly from the price calculated from the corresponding yield by means of the other overload of this function. If the price from a constant yield is desired, it is advisable to use such other overload.
clean price given a yield and settlement date The default bond settlement is used if no date is given.
theoretical dirty price
The default bond settlement is used for calculation.
warning the theoretical price calculated from a flat term structure might differ slightly from the price calculated from the corresponding yield by means of the other overload of this function. If the price from a constant yield is desired, it is advisable to use such other overload.
dirty price given a yield and settlement date The default bond settlement is used if no date is given.
returns the error estimate on the NPV when available.
This method constrains the object to return the presently cached results on successive invocations, even if arguments upon which they depend should change.
Expected next coupon: depending on (the bond and) the given date the coupon can be historic, deterministic or expected in a stochastic sense. When the bond settlement date is used the coupon is the already-fixed not-yet-paid one.
The current bond settlement is used if no date is given.
Previous coupon already paid at a given date
Expected previous coupon: depending on (the bond and) the given date the coupon can be historic, deterministic or expected in a stochastic sense. When the bond settlement date is used the coupon is the last paid one.
The current bond settlement is used if no date is given.
This method force the recalculation of any results which
would otherwise be cached. It is not declared as
const
since it needs to call the
non-const
notifyObservers
method.
note Explicit invocation of this method is not necessary if the object registered itself as observer with the structures on which such results depend. It is strongly advised to follow this policy when possible.
returns the redemption, if only one is defined
returns just the redemption flows (not interest payments)
returns any additional result returned by the pricing engine.
set the pricing engine to be used.
warning calling this method will have no effects in case the performCalculation method was overridden in a derived class.
theoretical settlement value
The default bond settlement date is used for calculation.
This method reverts the effect of the freeze
method, thus re-enabling recalculations.
Observer interface
returns the date the net present value refers to.
theoretical bond yield
The default bond settlement and theoretical price are used for calculation.
yield given a (clean) price and settlement date The default bond settlement is used if no date is given.
callable/puttable zero coupon bond
Callable zero coupon bond class.