Class DiscountingPaymentPricer


  • public class DiscountingPaymentPricer
    extends Object
    Pricer for simple payments.

    This function provides the ability to price an Payment.

    • Constructor Detail

      • DiscountingPaymentPricer

        public DiscountingPaymentPricer()
        Creates an instance.
    • Method Detail

      • presentValue

        public CurrencyAmount presentValue​(Payment payment,
                                           BaseProvider provider)
        Computes the present value of the payment by discounting.

        The present value is zero if the payment date is before the valuation date.

        Parameters:
        payment - the payment
        provider - the provider
        Returns:
        the present value
      • presentValue

        public CurrencyAmount presentValue​(Payment payment,
                                           DiscountFactors discountFactors)
        Computes the present value of the payment by discounting.

        The present value is zero if the payment date is before the valuation date.

        The specified discount factors should be for the payment currency, however this is not validated.

        Parameters:
        payment - the payment
        discountFactors - the discount factors to price against
        Returns:
        the present value
      • presentValueAmount

        public double presentValueAmount​(Payment payment,
                                         BaseProvider provider)
        Computes the present value of the payment by discounting.

        The present value is zero if the payment date is before the valuation date.

        Parameters:
        payment - the payment
        provider - the provider
        Returns:
        the present value
      • presentValueWithSpread

        public CurrencyAmount presentValueWithSpread​(Payment payment,
                                                     DiscountFactors discountFactors,
                                                     double zSpread,
                                                     CompoundedRateType compoundedRateType,
                                                     int periodsPerYear)
        Computes the present value of the payment with z-spread by discounting.

        The present value is zero if the payment date is before the valuation date.

        The specified discount factors should be for the payment currency, however this is not validated.

        The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.

        Parameters:
        payment - the payment
        discountFactors - the discount factors to price against
        zSpread - the z-spread
        compoundedRateType - the compounded rate type
        periodsPerYear - the number of periods per year
        Returns:
        the present value
      • explainPresentValue

        public ExplainMap explainPresentValue​(Payment payment,
                                              BaseProvider provider)
        Explains the present value of the payment.

        This returns explanatory information about the calculation.

        Parameters:
        payment - the payment
        provider - the provider
        Returns:
        the explanatory information
      • presentValueSensitivity

        public PointSensitivityBuilder presentValueSensitivity​(Payment payment,
                                                               BaseProvider provider)
        Compute the present value curve sensitivity of the payment.

        The present value sensitivity of the payment is the sensitivity of the present value to the discount factor curve. There is no sensitivity if the payment date is before the valuation date.

        Parameters:
        payment - the payment
        provider - the provider
        Returns:
        the point sensitivity of the present value
      • presentValueSensitivity

        public PointSensitivityBuilder presentValueSensitivity​(Payment payment,
                                                               DiscountFactors discountFactors)
        Compute the present value curve sensitivity of the payment.

        The present value sensitivity of the payment is the sensitivity of the present value to the discount factor curve. There is no sensitivity if the payment date is before the valuation date.

        The specified discount factors should be for the payment currency, however this is not validated.

        Parameters:
        payment - the payment
        discountFactors - the discount factors to price against
        Returns:
        the point sensitivity of the present value
      • presentValueSensitivityWithSpread

        public PointSensitivityBuilder presentValueSensitivityWithSpread​(Payment payment,
                                                                         DiscountFactors discountFactors,
                                                                         double zSpread,
                                                                         CompoundedRateType compoundedRateType,
                                                                         int periodsPerYear)
        Compute the present value curve sensitivity of the payment with z-spread.

        The present value sensitivity of the payment is the sensitivity of the present value to the discount factor curve. There is no sensitivity if the payment date is before the valuation date.

        The specified discount factors should be for the payment currency, however this is not validated.

        The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.

        Parameters:
        payment - the payment
        discountFactors - the discount factors to price against
        zSpread - the z-spread
        compoundedRateType - the compounded rate type
        periodsPerYear - the number of periods per year
        Returns:
        the point sensitivity of the present value
      • forecastValue

        public CurrencyAmount forecastValue​(Payment payment,
                                            BaseProvider provider)
        Computes the forecast value of the payment.

        The present value is zero if the payment date is before the valuation date.

        Parameters:
        payment - the payment
        provider - the provider
        Returns:
        the forecast value
      • forecastValueAmount

        public double forecastValueAmount​(Payment payment,
                                          BaseProvider provider)
        Computes the forecast value of the payment.

        The present value is zero if the payment date is before the valuation date.

        Parameters:
        payment - the payment
        provider - the provider
        Returns:
        the forecast value
      • cashFlows

        public CashFlows cashFlows​(Payment payment,
                                   BaseProvider provider)
        Calculates the future cash flow of the payment.

        The cash flow is returned, empty if the payment has already occurred.

        Parameters:
        payment - the payment
        provider - the provider
        Returns:
        the cash flow, empty if the payment has occurred
      • currencyExposure

        public MultiCurrencyAmount currencyExposure​(Payment payment,
                                                    BaseProvider provider)
        Calculates the currency exposure.
        Parameters:
        payment - the payment
        provider - the provider
        Returns:
        the currency exposure
      • currentCash

        public CurrencyAmount currentCash​(Payment payment,
                                          BaseProvider provider)
        Calculates the current cash.
        Parameters:
        payment - the payment
        provider - the provider
        Returns:
        the current cash