Package com.opengamma.strata.pricer.fx
Class DiscountingFxSingleTradePricer
- java.lang.Object
-
- com.opengamma.strata.pricer.fx.DiscountingFxSingleTradePricer
-
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 Instance Methods Concrete 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)
Calculates the par spread.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.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingFxSingleTradePricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingFxSingleTradePricer
public DiscountingFxSingleTradePricer(DiscountingFxSingleProductPricer productPricer)
Creates an instance.- Parameters:
productPricer
- the pricer forResolvedFxSingle
-
-
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 tradeprovider
- 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 tradeprovider
- 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 tradeprovider
- 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 tradeprovider
- 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 tradeprovider
- 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 tradeprovider
- 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 tradeprovider
- 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 tradeprovider
- the rates provider- Returns:
- the sensitivity to spot
-
-