cashflow-analysis functions More...
#include <ql/cashflows/cashflows.hpp>
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 | |
static Leg::const_iterator | nextCashFlow (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date()) |
the first cashflow paying after the given date | |
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 BigInteger | accrualDays (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date()) |
static Time | accruedPeriod (const Leg &leg, bool includeSettlementDateFlows, Date settlementDate=Date()) |
static BigInteger | 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. | |
static Real | bps (const Leg &leg, const YieldTermStructure &discountCurve, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date()) |
Basis-point sensitivity of the cash flows. | |
static 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. | |
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. | |
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. | |
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. | |
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. | |
static Time | duration (const Leg &leg, const InterestRate &yield, Duration::Type type, bool includeSettlementDateFlows, Date settlementDate=Date(), Date npvDate=Date()) |
Cash-flow duration. | |
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. | |
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. | |
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. | |
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 boost::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. | |
static Spread | zSpread (const Leg &leg, Real npv, const boost::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. | |
static Spread | zSpread (const Leg &leg, const boost::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. | |
cashflow-analysis functions
|
static |
NPV of the cash flows.
The NPV is the sum of the cash flows, each discounted according to the given term structure.
|
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.
|
static |
NPV and BPS of the cash flows.
The NPV and BPS of the cash flows calculated together for performance reason
|
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.
|
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.
|
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.
|
static |
Implied internal rate of return.
The function verifies the theoretical existance of an IRR and numerically establishes the IRR to the desired precision.
|
static |
Cash-flow duration.
The simple duration of a string of cash flows is defined as
where is the amount of the
-th cash flow,
is its payment time, and
is the corresponding discount according to the passed yield.
The modified duration is defined as
where is the present value of the cash flows according to the given IRR
.
The Macaulay duration is defined for a compounded IRR as
where is the IRR and
is the number of cash flows per year.
|
static |
Cash-flow convexity.
The convexity of a string of cash flows is defined as
where is the present value of the cash flows according to the given IRR
.
|
static |
Basis-point value.
Obtained by setting dy = 0.0001 in the 2nd-order Taylor series expansion.
|
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
|
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.