Class DiscountingFxSingleTradePricer


  • public class DiscountingFxSingleTradePricer
    extends Object
    Pricer for foreign exchange transaction trades.

    This provides the ability to price an ResolvedFxSingleTrade.

    • Method Detail

      • presentValue

        public MultiCurrencyAmount presentValue​(ResolvedFxSingleTrade trade,
                                                RatesProvider provider)
        Calculates the present value of the trade.

        The present value of the trade is the value on the valuation date. The present value is returned in the settlement currency.

        Parameters:
        trade - the trade
        provider - the rates provider
        Returns:
        the present value of the trade in the settlement currency
      • presentValueSensitivity

        public PointSensitivities presentValueSensitivity​(ResolvedFxSingleTrade trade,
                                                          RatesProvider provider)
        Calculates the present value curve sensitivity of the trade.

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

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

        public double parSpread​(ResolvedFxSingleTrade trade,
                                RatesProvider provider)
        Calculates the par spread.

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

        Parameters:
        trade - the trade
        provider - the rates provider
        Returns:
        the spread
      • currencyExposure

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

        public MultiCurrencyAmount currentCash​(ResolvedFxSingleTrade trade,
                                               RatesProvider provider)
        Calculates the current cash of the trade.
        Parameters:
        trade - the trade
        provider - the rates provider
        Returns:
        the current cash of the trade in the settlement currency
      • forwardFxRate

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

        public PointSensitivities forwardFxRatePointSensitivity​(ResolvedFxSingleTrade trade,
                                                                RatesProvider provider)
        Calculates the forward exchange rate point sensitivity.

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

        Parameters:
        trade - the trade
        provider - the rates provider
        Returns:
        the point sensitivity
      • forwardFxRateSpotSensitivity

        public double forwardFxRateSpotSensitivity​(ResolvedFxSingleTrade trade,
                                                   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:
        trade - the trade
        provider - the rates provider
        Returns:
        the sensitivity to spot