## Class DiscountingFxSingleProductPricer

• java.lang.Object
• com.opengamma.strata.pricer.fx.DiscountingFxSingleProductPricer

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

This provides the ability to price an ResolvedFxSingle.

• ### Field Summary

Fields
Modifier and Type Field Description
static DiscountingFxSingleProductPricer DEFAULT
Default implementation.
• ### Constructor Summary

Constructors
Constructor Description
DiscountingFxSingleProductPricer​(DiscountingPaymentPricer paymentPricer)
Creates an instance.
• ### Method Summary

All Methods
Modifier and Type Method Description
MultiCurrencyAmount currencyExposure​(ResolvedFxSingle product, RatesProvider provider)
Calculates the currency exposure by discounting each payment in its own currency.
MultiCurrencyAmount currentCash​(ResolvedFxSingle fx, java.time.LocalDate valuationDate)
Calculates the current cash.
FxRate forwardFxRate​(ResolvedFxSingle fx, RatesProvider provider)
Calculates the forward exchange rate.
PointSensitivityBuilder forwardFxRatePointSensitivity​(ResolvedFxSingle fx, RatesProvider provider)
Calculates the forward exchange rate point sensitivity.
double forwardFxRateSpotSensitivity​(ResolvedFxSingle fx, RatesProvider provider)
Calculates the sensitivity of the forward exchange rate to the spot rate.
double parSpread​(ResolvedFxSingle fx, RatesProvider provider)
MultiCurrencyAmount presentValue​(ResolvedFxSingle fx, RatesProvider provider)
Calculates the present value of the FX product by discounting each payment in its own currency.
PointSensitivities presentValueSensitivity​(ResolvedFxSingle fx, RatesProvider provider)
Calculates the present value curve sensitivity of the FX product.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Field Detail

• #### DEFAULT

public static final DiscountingFxSingleProductPricer DEFAULT
Default implementation.
• ### 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

public double parSpread​(ResolvedFxSingle fx,
RatesProvider provider)

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:
• #### 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,
java.time.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