Package com.opengamma.strata.pricer.fx
Class DiscountingFxSingleProductPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.fx.DiscountingFxSingleProductPricer
-
public class DiscountingFxSingleProductPricer extends 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 Instance Methods Concrete 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, 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)
Calculates the par spread.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.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingFxSingleProductPricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingFxSingleProductPricer
public DiscountingFxSingleProductPricer(DiscountingPaymentPricer paymentPricer)
Creates an instance.- Parameters:
paymentPricer
- the pricer forPayment
-
-
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 productprovider
- 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 productprovider
- the rates provider- Returns:
- the point sensitivity of the present value
-
parSpread
public double parSpread(ResolvedFxSingle fx, RatesProvider provider)
Calculates the par spread.This is the spread that should be added to the FX points to have a zero value.
- Parameters:
fx
- the productprovider
- the rates provider- Returns:
- the spread
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFxSingle product, RatesProvider provider)
Calculates the currency exposure by discounting each payment in its own currency.- Parameters:
product
- the productprovider
- the rates provider- Returns:
- the currency exposure
-
currentCash
public MultiCurrencyAmount currentCash(ResolvedFxSingle fx, LocalDate valuationDate)
Calculates the current cash.- Parameters:
fx
- the productvaluationDate
- the valuation date- Returns:
- the current cash
-
forwardFxRate
public FxRate forwardFxRate(ResolvedFxSingle fx, RatesProvider provider)
Calculates the forward exchange rate.- Parameters:
fx
- the productprovider
- 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 productprovider
- 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 productprovider
- the rates provider- Returns:
- the sensitivity to spot
-
-