Documentation of 'org.jquantlib.cashflow.CashFlows' Java class
CashFlows
org.jquantlib.cashflow

Class CashFlows



  • public class CashFlows
    extends java.lang.Object
    Cashflow-analysis functions
    • Method Detail

      • getInstance

        public static CashFlows getInstance()
      • startDate

        public Date startDate(Leg cashflows)
      • maturityDate

        public Date maturityDate(Leg cashflows)
      • npv

        public double npv(Leg cashflows,
                          Handle<YieldTermStructure> discountCurve,
                          Date settlementDate,
                          Date npvDate,
                          int exDividendDays)
        NPV of the cash flows.

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

        Parameters:
        cashflows -
        discountCurve -
        settlementDate -
        npvDate -
        exDividendDays -
        Returns:
      • npv

        public double npv(Leg cashflows,
                          InterestRate irr,
                          Date settlementDate)
        NPV of the cash flows.

        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.

      • bps

        public double bps(Leg cashflows,
                          Handle<YieldTermStructure> discountCurve,
                          Date settlementDate,
                          Date npvDate,
                          int exDividendDays)
        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.

      • bps

        public double bps(Leg cashflows,
                          InterestRate irr,
                          Date settlementDate)
        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.

      • atmRate

        public double atmRate(Leg leg,
                              Handle<YieldTermStructure> discountCurve,
                              Date settlementDate,
                              Date npvDate,
                              int exDividendDays,
                              double npv)
        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.

      • irr

        public double irr(Leg cashflows,
                          double marketPrice,
                          DayCounter dayCounter,
                          Compounding compounding,
                          Frequency frequency,
                          Date settlementDate,
                          double tolerance,
                          int maxIterations,
                          double guess)
        Internal rate of return.

        The IRR is the interest rate at which the NPV of the cash flows equals the given market price. The function verifies the theoretical existance of an IRR and numerically establishes the IRR to the desired precision.

      • duration

        public double duration(Leg leg,
                               InterestRate y,
                               CashFlows.Duration duration,
                               Date settlementDate)
        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.

      • convexity

        public double convexity(Leg cashFlows,
                                InterestRate rate,
                                Date settlementDate)
        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 .

      • previousCashFlow

        public final int previousCashFlow(Leg leg)
      • previousCashFlow

        public final int previousCashFlow(Leg leg,
                                          Date refDate)
      • previousCouponRate

        public final double previousCouponRate(Leg cashFlows)
      • previousCouponRate

        public final double previousCouponRate(Leg cashFlows,
                                               Date settlement)
      • nextCouponRate

        public final double nextCouponRate(Leg leg)
      • nextCouponRate

        public final double nextCouponRate(Leg cashFlows,
                                           Date settlement)
      • nextCashFlow

        public final CashFlow nextCashFlow(Leg cashFlows,
                                           Date settlement)
        NOTE: should return null when no cashflow could be found!
        Parameters:
        cashFlows -
        settlement -
        Returns:
      • nextCashFlowIndex

        public final int nextCashFlowIndex(Leg cashFlows,
                                           Date settlement)
        NOTE: returns the index! for cashflow.end() the returned index would throw a index out of bounds exception
        Parameters:
        cashFlows -
        settlement -
        Returns:
      • nextCashFlow

        public final CashFlow nextCashFlow(Leg cashFlows)
      • yieldValueBasisPoint

        public final double yieldValueBasisPoint(Leg leg,
                                                 InterestRate y,
                                                 Date settlementDate)
        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
        Parameters:
        leg -
        y -
        settlmentDate -
        Returns:
      • yieldValueBasisPoint

        public final double yieldValueBasisPoint(Leg leg,
                                                 InterestRate y)
      • couponRate

        public final double couponRate(Leg leg,
                                       Leg iteratorLeg,
                                       int iteratorIndex)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.