Logo
Reference manual - version qle_version
Classes | Public Member Functions | Protected Attributes | List of all members
DiscountingRiskyBondEngine Class Reference

Discounting Risky Bond Engine. More...

#include <qle/pricingengines/discountingriskybondengine.hpp>

+ Inheritance diagram for DiscountingRiskyBondEngine:

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
 

Protected Attributes

Handle< YieldTermStructure > discountCurve_
 
Handle< DefaultProbabilityTermStructure > defaultCurve_
 
Handle< Quote > recoveryRate_
 
Handle< Quote > securitySpread_
 
Period timestepPeriod_
 
boost::optional< bool > includeSettlementDateFlows_
 

Detailed Description

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.

Member Function Documentation

◆ calculateNpv()

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

  • If conditionalOnSurvival is set to true, the npv is computed conditional on the survival until the npvDate, otherwise the npv is including the default probability between today and the npvDate
  • If an incomeCurve is given, this is used to compound the npv from today to the npvDate, otherwise the curve built in the engine as discount curve + security Spread is used.