QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
CashFlows Class Reference

cashflow-analysis functions More...

#include <ql/cashflows/cashflows.hpp>

+ Collaboration diagram for CashFlows:

Classes

class  IrrFinder
 

Public Member Functions

 CashFlows ()=delete
 
 CashFlows (CashFlows &&)=delete
 
 CashFlows (const CashFlows &)=delete
 
CashFlowsoperator= (CashFlows &&)=delete
 
CashFlowsoperator= (const CashFlows &)=delete
 
 ~CashFlows ()=default
 

Static Public Member Functions

Date functions
static Date startDate (const Leg &leg)
 
static Date maturityDate (const Leg &leg)
 
static bool isExpired (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
CashFlow functions
static Leg::const_reverse_iterator previousCashFlow (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 the last cashflow paying before or at the given date More...
 
static Leg::const_iterator nextCashFlow (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 the first cashflow paying after the given date More...
 
static Date previousCashFlowDate (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Date nextCashFlowDate (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Real previousCashFlowAmount (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Real nextCashFlowAmount (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
Coupon inspectors
static Rate previousCouponRate (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Rate nextCouponRate (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Real nominal (const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
 
static Date accrualStartDate (const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
 
static Date accrualEndDate (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Date referencePeriodStart (const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
 
static Date referencePeriodEnd (const Leg &leg, bool includeSettlementDateFlows, Date settlDate=Date())
 
static Time accrualPeriod (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Date::serial_type accrualDays (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Time accruedPeriod (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Date::serial_type accruedDays (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
static Real accruedAmount (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date())
 
YieldTermStructure functions
static Real npv (const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 NPV of the cash flows. More...
 
static Real bps (const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 Basis-point sensitivity of the cash flows. More...
 
static std::pair< Real, Realnpvbps (const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 NPV and BPS of the cash flows. More...
 
static QL_DEPRECATED void npvbps (const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate, Date npvDate, Real &npv, Real &bps)
 NPV and BPS of the cash flows. More...
 
static Rate atmRate (const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date(), Real npv=Null< Real >())
 At-the-money rate of the cash flows. More...
 
Yield (a.k.a. Internal Rate of Return, i.e. IRR) functions
static Real npv (const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 NPV of the cash flows. More...
 
static Real npv (const Leg &leg, Rate yield, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 
static Real bps (const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 Basis-point sensitivity of the cash flows. More...
 
static Real bps (const Leg &leg, Rate yield, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 
static Rate yield (const Leg &leg, Real npv, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date(), Real accuracy=1.0e-10, Size maxIterations=100, Rate guess=0.05)
 Implied internal rate of return. More...
 
template<typename Solver >
static Rate yield (const Solver &solver, const Leg &leg, Real npv, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date(), Real accuracy=1.0e-10, Rate guess=0.05)
 
static Time duration (const Leg &leg, const InterestRate &yield, Duration::Type type, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 Cash-flow duration. More...
 
static Time duration (const Leg &leg, Rate yield, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, Duration::Type type, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 
static Real convexity (const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 Cash-flow convexity. More...
 
static Real convexity (const Leg &leg, Rate yield, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 
static Real basisPointValue (const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 Basis-point value. More...
 
static Real basisPointValue (const Leg &leg, Rate yield, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 
static Real yieldValueBasisPoint (const Leg &leg, const InterestRate &yield, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 Yield value of a basis point. More...
 
static Real yieldValueBasisPoint (const Leg &leg, Rate yield, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 
Z-spread functions
static Real npv (const Leg &leg, const ext::shared_ptr< YieldTermStructure > &discount, Spread zSpread, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date())
 NPV of the cash flows. More...
 
static Spread zSpread (const Leg &leg, Real npv, const ext::shared_ptr< YieldTermStructure > &, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date(), Real accuracy=1.0e-10, Size maxIterations=100, Rate guess=0.0)
 implied Z-spread. More...
 
static Spread zSpread (const Leg &leg, const ext::shared_ptr< YieldTermStructure > &d, Real npv, const DayCounter &dayCounter, Compounding compounding, Frequency frequency, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date(), Real accuracy=1.0e-10, Size maxIterations=100, Rate guess=0.0)
 deprecated implied Z-spread. More...
 

Detailed Description

cashflow-analysis functions

Definition at line 41 of file cashflows.hpp.

Constructor & Destructor Documentation

◆ CashFlows() [1/3]

CashFlows ( )
delete

◆ CashFlows() [2/3]

CashFlows ( CashFlows &&  )
delete

◆ CashFlows() [3/3]

CashFlows ( const CashFlows )
delete

◆ ~CashFlows()

~CashFlows ( )
default

Member Function Documentation

◆ operator=() [1/2]

CashFlows & operator= ( CashFlows &&  )
delete

◆ operator=() [2/2]

CashFlows & operator= ( const CashFlows )
delete

◆ startDate()

Date startDate ( const Leg leg)
static

Definition at line 38 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maturityDate()

Date maturityDate ( const Leg leg)
static

Definition at line 52 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isExpired()

bool isExpired ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 66 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ previousCashFlow()

Leg::const_reverse_iterator previousCashFlow ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

the last cashflow paying before or at the given date

Definition at line 84 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nextCashFlow()

Leg::const_iterator nextCashFlow ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

the first cashflow paying after the given date

Definition at line 102 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ previousCashFlowDate()

Date previousCashFlowDate ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 119 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nextCashFlowDate()

Date nextCashFlowDate ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 131 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ previousCashFlowAmount()

Real previousCashFlowAmount ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 143 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nextCashFlowAmount()

Real nextCashFlowAmount ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 159 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ previousCouponRate()

Rate previousCouponRate ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 215 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nextCouponRate()

Rate nextCouponRate ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 224 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nominal()

Real nominal ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlDate = Date() 
)
static

Definition at line 232 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ accrualStartDate()

Date accrualStartDate ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlDate = Date() 
)
static

Definition at line 247 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accrualEndDate()

Date accrualEndDate ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 263 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ referencePeriodStart()

Date referencePeriodStart ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlDate = Date() 
)
static

Definition at line 279 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ referencePeriodEnd()

Date referencePeriodEnd ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlDate = Date() 
)
static

Definition at line 295 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accrualPeriod()

Time accrualPeriod ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 311 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accrualDays()

Date::serial_type accrualDays ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 326 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accruedPeriod()

Time accruedPeriod ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 341 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accruedDays()

Date::serial_type accruedDays ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 359 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accruedAmount()

Real accruedAmount ( const Leg leg,
bool  includeSettlementDateFlows,
Date  settlementDate = Date() 
)
static

Definition at line 377 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ npv() [1/4]

Real npv ( const Leg leg,
const YieldTermStructure discountCurve,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

NPV of the cash flows.

The NPV is the sum of the cash flows, each discounted according to the given term structure.

Definition at line 425 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bps() [1/3]

Real bps ( const Leg leg,
const YieldTermStructure discountCurve,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Basis-point sensitivity of the cash flows.

The result is the change in NPV due to a uniform 1-basis-point change in the rate paid by the cash flows. The change for each coupon is discounted according to the given term structure.

Definition at line 450 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ npvbps() [1/2]

std::pair< Real, Real > npvbps ( const Leg leg,
const YieldTermStructure discountCurve,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

NPV and BPS of the cash flows.

The NPV and BPS of the cash flows calculated together for performance reason

Definition at line 484 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ npvbps() [2/2]

void npvbps ( const Leg leg,
const YieldTermStructure discountCurve,
bool  includeSettlementDateFlows,
Date  settlementDate,
Date  npvDate,
Real npv,
Real bps 
)
static

NPV and BPS of the cash flows.

Deprecated:
Use the overload returning a pair of Reals. Deprecated in version 1.29.

Definition at line 473 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ atmRate()

Rate atmRate ( const Leg leg,
const YieldTermStructure discountCurve,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date(),
Real  npv = Null<Real>() 
)
static

At-the-money rate of the cash flows.

The result is the fixed rate for which a fixed rate cash flow vector, equivalent to the input vector, has the required NPV according to the given term structure. If the required NPV is not given, the input cash flow vector's NPV is used instead.

Definition at line 521 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ npv() [2/4]

Real npv ( const Leg leg,
const InterestRate yield,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

NPV of the cash flows.

The IRR is the interest rate at which the NPV of the cash flows equals the dirty price.

The NPV is the sum of the cash flows, each discounted according to the given constant interest rate. The result is affected by the choice of the interest-rate compounding and the relative frequency and day counter.

Definition at line 823 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ npv() [3/4]

Real npv ( const Leg leg,
Rate  yield,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Definition at line 867 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ bps() [2/3]

Real bps ( const Leg leg,
const InterestRate yield,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Basis-point sensitivity of the cash flows.

The result is the change in NPV due to a uniform 1-basis-point change in the rate paid by the cash flows. The change for each coupon is discounted according to the given constant interest rate. The result is affected by the choice of the interest-rate compounding and the relative frequency and day counter.

Definition at line 880 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ bps() [3/3]

Real bps ( const Leg leg,
Rate  yield,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Definition at line 902 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ yield() [1/2]

Rate yield ( const Leg leg,
Real  npv,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date(),
Real  accuracy = 1.0e-10,
Size  maxIterations = 100,
Rate  guess = 0.05 
)
static

Implied internal rate of return.

The function verifies the theoretical existence of an IRR and numerically establishes the IRR to the desired precision.

Definition at line 915 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ yield() [2/2]

static Rate yield ( const Solver &  solver,
const Leg leg,
Real  npv,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date(),
Real  accuracy = 1.0e-10,
Rate  guess = 0.05 
)
static

Definition at line 290 of file cashflows.hpp.

+ Here is the call graph for this function:

◆ duration() [1/2]

Time duration ( const Leg leg,
const InterestRate yield,
Duration::Type  type,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Cash-flow duration.

The simple duration of a string of cash flows is defined as

\[ D_{\mathrm{simple}} = \frac{\sum t_i c_i B(t_i)}{\sum c_i B(t_i)} \]

where \( c_i \) is the amount of the \( i \)-th cash flow, \( t_i \) is its payment time, and \( B(t_i) \) is the corresponding discount according to the passed yield.

The modified duration is defined as

\[ D_{\mathrm{modified}} = -\frac{1}{P} \frac{\partial P}{\partial y} \]

where \( P \) is the present value of the cash flows according to the given IRR \( y \).

The Macaulay duration is defined for a compounded IRR as

\[ D_{\mathrm{Macaulay}} = \left( 1 + \frac{y}{N} \right) D_{\mathrm{modified}} \]

where \( y \) is the IRR and \( N \) is the number of cash flows per year.

Definition at line 936 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duration() [2/2]

Time duration ( const Leg leg,
Rate  yield,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
Duration::Type  type,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Definition at line 970 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ convexity() [1/2]

Real convexity ( const Leg leg,
const InterestRate yield,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Cash-flow convexity.

The convexity of a string of cash flows is defined as

\[ C = \frac{1}{P} \frac{\partial^2 P}{\partial y^2} \]

where \( P \) is the present value of the cash flows according to the given IRR \( y \).

Definition at line 985 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ convexity() [2/2]

Real convexity ( const Leg leg,
Rate  yield,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Definition at line 1056 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ basisPointValue() [1/2]

Real basisPointValue ( const Leg leg,
const InterestRate yield,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Basis-point value.

Obtained by setting dy = 0.0001 in the 2nd-order Taylor series expansion.

Definition at line 1069 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ basisPointValue() [2/2]

Real basisPointValue ( const Leg leg,
Rate  yield,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Definition at line 1103 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ yieldValueBasisPoint() [1/2]

Real yieldValueBasisPoint ( const Leg leg,
const InterestRate yield,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Yield value of a basis point.

The yield value of a one basis point change in price is the derivative of the yield with respect to the price multiplied by 0.01

Definition at line 1116 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ yieldValueBasisPoint() [2/2]

Real yieldValueBasisPoint ( const Leg leg,
Rate  yield,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

Definition at line 1142 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ npv() [4/4]

Real npv ( const Leg leg,
const ext::shared_ptr< YieldTermStructure > &  discount,
Spread  zSpread,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date() 
)
static

NPV of the cash flows.

For details on z-spread refer to: "Credit Spreads Explained", Lehman Brothers European Fixed Income Research - March 2004, D. O'Kane

The NPV is the sum of the cash flows, each discounted according to the z-spreaded term structure. The result is affected by the choice of the z-spread compounding and the relative frequency and day counter.

Definition at line 1205 of file cashflows.cpp.

+ Here is the call graph for this function:

◆ zSpread() [1/2]

Spread zSpread ( const Leg leg,
Real  npv,
const ext::shared_ptr< YieldTermStructure > &  discount,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date(),
Real  accuracy = 1.0e-10,
Size  maxIterations = 100,
Rate  guess = 0.0 
)
static

implied Z-spread.

Definition at line 1239 of file cashflows.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ zSpread() [2/2]

static Spread zSpread ( const Leg leg,
const ext::shared_ptr< YieldTermStructure > &  d,
Real  npv,
const DayCounter dayCounter,
Compounding  compounding,
Frequency  frequency,
bool  includeSettlementDateFlows,
Date  settlementDate = Date(),
Date  npvDate = Date(),
Real  accuracy = 1.0e-10,
Size  maxIterations = 100,
Rate  guess = 0.0 
)
static

deprecated implied Z-spread.

Definition at line 442 of file cashflows.hpp.

+ Here is the call graph for this function: