• java.lang.Object

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

This provides the ability to price an ResolvedFxSingleTrade.

• ### Field Summary

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

Constructors
Constructor Description
DiscountingFxSingleTradePricer​(DiscountingFxSingleProductPricer productPricer)
Creates an instance.
• ### Method Summary

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

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

• #### DEFAULT

public static final DiscountingFxSingleTradePricer DEFAULT
Default implementation.
• ### Constructor Detail

public DiscountingFxSingleTradePricer​(DiscountingFxSingleProductPricer productPricer)
Creates an instance.
Parameters:
productPricer - the pricer for ResolvedFxSingle
• ### 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

public double parSpread​(ResolvedFxSingleTrade trade,
RatesProvider provider)

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:
• #### 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