Discounting Risky Bond Engine. More...
#include <qle/pricingengines/discountingriskybondengine.hpp>
Classes | |
struct | BondNPVCalculationResults |
Public Member Functions | |
DiscountingRiskyBondEngine (const Handle< YieldTermStructure > &discountCurve, const Handle< DefaultProbabilityTermStructure > &defaultCurve, const Handle< Quote > &recoveryRate, const Handle< Quote > &securitySpread, Period timestepPeriod, boost::optional< bool > includeSettlementDateFlows=boost::none) | |
DiscountingRiskyBondEngine (const Handle< YieldTermStructure > &discountCurve, const Handle< Quote > &securitySpread, Period timestepPeriod, boost::optional< bool > includeSettlementDateFlows=boost::none) | |
alternative constructor (does not require default curve or recovery rate) | |
void | calculate () const override |
BondNPVCalculationResults | calculateNpv (const Date &npvDate, const Date &settlementDate, const Leg &cashflows, boost::optional< bool > includeSettlementDateFlows=boost::none, const Handle< YieldTermStructure > &incomeCurve=Handle< YieldTermStructure >(), const bool conditionalOnSurvival=true, const bool additionalResults=true) const |
Handle< YieldTermStructure > | discountCurve () const |
Handle< DefaultProbabilityTermStructure > | defaultCurve () const |
Handle< Quote > | recoveryRate () const |
Handle< Quote > | securitySpread () const |
Discounting Risky Bond Engine.
WARNING: Only covers Vanilla coupon bonds (floating and fixed rate), and Zero Bonds (one cashflow, a redemption at maturity).
This class implements pricing of Risky Bonds by discounting the future nominal cash flows using the respective yield curves, and probability of survival. The nominal recovered in case of default is calculated as recovery rate times the integral of probability of default until maturity date. For coupon bonds the coupon periods are taken as the time step for integration, for a zero bond the time step period provided is used.
BondNPVCalculationResults calculateNpv | ( | const Date & | npvDate, |
const Date & | settlementDate, | ||
const Leg & | cashflows, | ||
boost::optional< bool > | includeSettlementDateFlows = boost::none , |
||
const Handle< YieldTermStructure > & | incomeCurve = Handle< YieldTermStructure >() , |
||
const bool | conditionalOnSurvival = true , |
||
const bool | additionalResults = true |
||
) | const |
Calculate the npv, compoundFactorSettlement, cashflowsBeforeSettlementValue and the additional CashflowResults as of the npvDate including cashflows eligible w.r.t. the given settlement date