Package com.opengamma.strata.pricer.fx
Class DiscountingFxSwapTradePricer
- java.lang.Object
-
- com.opengamma.strata.pricer.fx.DiscountingFxSwapTradePricer
-
public class DiscountingFxSwapTradePricer extends 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 Instance Methods Concrete 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)
Calculates the par spread.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.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingFxSwapTradePricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingFxSwapTradePricer
public DiscountingFxSwapTradePricer(DiscountingFxSwapProductPricer productPricer)
Creates an instance.- Parameters:
productPricer
- the pricer forResolvedFxSwap
-
-
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 tradeprovider
- 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 tradeprovider
- the rates provider- Returns:
- the point sensitivity of the present value
-
parSpread
public double parSpread(ResolvedFxSwapTrade trade, RatesProvider provider)
Calculates the par spread.The par spread is the spread that should be added to the FX forward points to have a zero value.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the spread
-
parSpreadSensitivity
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 tradeprovider
- the rates provider- Returns:
- the spread curve sensitivity
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFxSwapTrade trade, RatesProvider provider)
Calculates the currency exposure by discounting each payment in its own currency.- Parameters:
trade
- the tradeprovider
- 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 tradeprovider
- the rates provider- Returns:
- the current cash of the trade in the settlement currency
-
-