Discounting Risky Bond Engine. More...
#include <qle/pricingengines/discountingriskybondengine.hpp>
Classes | |
| struct | BondNPVCalculationResults |
| struct | RecoveryContribution |
Public Member Functions | |
| DiscountingRiskyBondEngine (const Handle< YieldTermStructure > &discountCurve, const Handle< DefaultProbabilityTermStructure > &defaultCurve, const Handle< Quote > &recoveryRate, const Handle< Quote > &securitySpread, Period timestepPeriod, QuantLib::ext::optional< bool > includeSettlementDateFlows=QuantLib::ext::nullopt, const bool includePastCashflows=false, const Handle< YieldTermStructure > &incomeCurve={}, const bool conditionalOnSurvival=true, const bool spreadOnIncome=true, const bool treatSecuritySpreadAsCreditSpread=false) | |
| DiscountingRiskyBondEngine (const Handle< YieldTermStructure > &discountCurve, const Handle< Quote > &securitySpread, Period timestepPeriod, QuantLib::ext::optional< bool > includeSettlementDateFlows=QuantLib::ext::nullopt, const Handle< YieldTermStructure > &incomeCurve={}, const bool conditionalOnSurvival=true, const bool spreadOnIncome=true, const bool treatSecuritySpreadAsCreditSpread=false) | |
| alternative constructor (does not require default curve or recovery rate) | |
| void | calculate () const override |
| std::pair< Real, Real > | forwardPrice (const QuantLib::Date &forwardNpvDate, const QuantLib::Date &settlementDate, const bool conditionalOnSurvival=true, std::vector< CashFlowResults > *const cfResults=nullptr, QuantLib::Leg *const expectedCashflows=nullptr) const override |
| ForwardEnabledBondEngine interface. | |
| Handle< YieldTermStructure > | discountCurve () const |
| Handle< DefaultProbabilityTermStructure > | defaultCurve () const |
| Handle< Quote > | recoveryRate () const |
| Handle< Quote > | securitySpread () const |
Protected Member Functions | |
| BondNPVCalculationResults | calculateNpv (const Date &npvDate, const Date &settlementDate, QuantLib::ext::optional< bool > includeSettlementDateFlows, const bool conditionalOnSurvival, const bool additionalResults) const |
| DiscountingRiskyBondEngine::RecoveryContribution | recoveryContribution (const Real dfNpv, const Real spNpv, const Real effRecovery, const QuantLib::ext::shared_ptr< DefaultProbabilityTermStructure > &effCreditCurve, const bool additionalResults, const Real nominal, const QuantLib::Date &startDate, const QuantLib::Date &endDate) const |
Protected Attributes | |
| Handle< YieldTermStructure > | discountCurve_ |
| Handle< DefaultProbabilityTermStructure > | defaultCurve_ |
| Handle< Quote > | recoveryRate_ |
| Handle< Quote > | securitySpread_ |
| Period | timestepPeriod_ |
| QuantLib::ext::optional< bool > | includeSettlementDateFlows_ |
| bool | includePastCashflows_ |
| Handle< YieldTermStructure > | incomeCurve_ |
| bool | conditionalOnSurvival_ |
| bool | spreadOnIncome_ |
| bool | treatSecuritySpreadAsCreditSpread_ |
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.
|
overridevirtual |
ForwardEnabledBondEngine interface.
Implements ForwardEnabledBondEngine.
|
protected |
Calculate the npv, compoundFactorSettlement, cashflowsBeforeSettlementValue and the additional CashflowResults as of the npvDate including cashflows eligible w.r.t. the given settlement date