• java.lang.Object

• public class DiscountingFxSwapTradePricer
extends java.lang.Object
Pricer for foreign exchange swap transaction trades.

This provides the ability to price an ResolvedFxSwapTrade.

• ### Field Summary

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

Constructors
Constructor Description
DiscountingFxSwapTradePricer​(DiscountingFxSwapProductPricer productPricer)
Creates an instance.
• ### Method Summary

All Methods
Modifier and Type Method Description
MultiCurrencyAmount currencyExposure​(ResolvedFxSwapTrade trade, RatesProvider provider)
Calculates the currency exposure by discounting each payment in its own currency.
MultiCurrencyAmount currentCash​(ResolvedFxSwapTrade trade, RatesProvider provider)
Calculates the current cash of the trade.
double parSpread​(ResolvedFxSwapTrade trade, RatesProvider provider)
PointSensitivities parSpreadSensitivity​(ResolvedFxSwapTrade trade, RatesProvider provider)
Calculates the par spread sensitivity to the curves.
MultiCurrencyAmount presentValue​(ResolvedFxSwapTrade trade, RatesProvider provider)
Calculates the present value of the trade.
PointSensitivities presentValueSensitivity​(ResolvedFxSwapTrade 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 DiscountingFxSwapTradePricer DEFAULT
Default implementation.
• ### Constructor Detail

public DiscountingFxSwapTradePricer​(DiscountingFxSwapProductPricer productPricer)
Creates an instance.
Parameters:
productPricer - the pricer for ResolvedFxSwap
• ### Method Detail

• #### presentValue

public MultiCurrencyAmount presentValue​(ResolvedFxSwapTrade 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​(ResolvedFxSwapTrade 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​(ResolvedFxSwapTrade trade,
RatesProvider provider)

The par spread is the spread that should be added to the FX forward points to have a zero value.

Parameters:
trade - the trade
provider - the rates provider
Returns:

public PointSensitivities parSpreadSensitivity​(ResolvedFxSwapTrade trade,
RatesProvider provider)
Calculates the par spread sensitivity to the curves.

The sensitivity is reported in the counter currency of the product, but is actually dimensionless.

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

public MultiCurrencyAmount currencyExposure​(ResolvedFxSwapTrade 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​(ResolvedFxSwapTrade 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