Class DiscountingFxSingleProductPricer


  • public class DiscountingFxSingleProductPricer
    extends Object
    Pricer for foreign exchange transaction products.

    This provides the ability to price an ResolvedFxSingle.

    • Constructor Detail

      • DiscountingFxSingleProductPricer

        public DiscountingFxSingleProductPricer​(DiscountingPaymentPricer paymentPricer)
        Creates an instance.
        Parameters:
        paymentPricer - the pricer for Payment
    • Method Detail

      • presentValue

        public MultiCurrencyAmount presentValue​(ResolvedFxSingle fx,
                                                RatesProvider provider)
        Calculates the present value of the FX product by discounting each payment in its own currency.
        Parameters:
        fx - the product
        provider - the rates provider
        Returns:
        the present value in the two natural currencies
      • presentValueSensitivity

        public PointSensitivities presentValueSensitivity​(ResolvedFxSingle fx,
                                                          RatesProvider provider)
        Calculates the present value curve sensitivity of the FX product.

        The present value sensitivity of the product is the sensitivity of the present value to the underlying curves.

        Parameters:
        fx - the product
        provider - the rates provider
        Returns:
        the point sensitivity of the present value
      • parSpread

        public double parSpread​(ResolvedFxSingle fx,
                                RatesProvider provider)
        Calculates the par spread.

        This is the spread that should be added to the FX points to have a zero value.

        Parameters:
        fx - the product
        provider - the rates provider
        Returns:
        the spread
      • currencyExposure

        public MultiCurrencyAmount currencyExposure​(ResolvedFxSingle product,
                                                    RatesProvider provider)
        Calculates the currency exposure by discounting each payment in its own currency.
        Parameters:
        product - the product
        provider - the rates provider
        Returns:
        the currency exposure
      • currentCash

        public MultiCurrencyAmount currentCash​(ResolvedFxSingle fx,
                                               LocalDate valuationDate)
        Calculates the current cash.
        Parameters:
        fx - the product
        valuationDate - the valuation date
        Returns:
        the current cash
      • forwardFxRate

        public FxRate forwardFxRate​(ResolvedFxSingle fx,
                                    RatesProvider provider)
        Calculates the forward exchange rate.
        Parameters:
        fx - the product
        provider - the rates provider
        Returns:
        the forward rate
      • forwardFxRatePointSensitivity

        public PointSensitivityBuilder forwardFxRatePointSensitivity​(ResolvedFxSingle fx,
                                                                     RatesProvider provider)
        Calculates the forward exchange rate point sensitivity.

        The returned value is based on the direction of the FX product.

        Parameters:
        fx - the product
        provider - the rates provider
        Returns:
        the point sensitivity
      • forwardFxRateSpotSensitivity

        public double forwardFxRateSpotSensitivity​(ResolvedFxSingle fx,
                                                   RatesProvider provider)
        Calculates the sensitivity of the forward exchange rate to the spot rate.

        The returned value is based on the direction of the FX product.

        Parameters:
        fx - the product
        provider - the rates provider
        Returns:
        the sensitivity to spot