Package com.opengamma.strata.pricer.fx
Class DiscountingFxSwapProductPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.fx.DiscountingFxSwapProductPricer
-
public class DiscountingFxSwapProductPricer extends Object
Pricer for foreign exchange swap transaction products.This provides the ability to price an
ResolvedFxSwap.
-
-
Field Summary
Fields Modifier and Type Field Description static DiscountingFxSwapProductPricerDEFAULTDefault implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingFxSwapProductPricer(DiscountingFxSingleProductPricer fxPricer)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmountcurrencyExposure(ResolvedFxSwap product, RatesProvider provider)Calculates the currency exposure of the FX swap product.MultiCurrencyAmountcurrentCash(ResolvedFxSwap swap, LocalDate valuationDate)Calculates the current cash of the FX swap product.doubleparSpread(ResolvedFxSwap swap, RatesProvider provider)Calculates the par spread.PointSensitivitiesparSpreadSensitivity(ResolvedFxSwap swap, RatesProvider provider)Calculates the par spread sensitivity to the curves.MultiCurrencyAmountpresentValue(ResolvedFxSwap swap, RatesProvider provider)Calculates the present value of the FX swap product.PointSensitivitiespresentValueSensitivity(ResolvedFxSwap swap, RatesProvider provider)Calculates the present value sensitivity of the FX swap product.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingFxSwapProductPricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingFxSwapProductPricer
public DiscountingFxSwapProductPricer(DiscountingFxSingleProductPricer fxPricer)
Creates an instance.- Parameters:
fxPricer- the pricer forResolvedFxSingle
-
-
Method Detail
-
presentValue
public MultiCurrencyAmount presentValue(ResolvedFxSwap swap, RatesProvider provider)
Calculates the present value of the FX swap product.This discounts each payment on each leg in its own currency.
- Parameters:
swap- the productprovider- the rates provider- Returns:
- the present value in the two natural currencies
-
presentValueSensitivity
public PointSensitivities presentValueSensitivity(ResolvedFxSwap swap, RatesProvider provider)
Calculates the present value sensitivity of the FX swap product.The present value sensitivity of the product is the sensitivity of the present value to the underlying curves.
- Parameters:
swap- the productprovider- the rates provider- Returns:
- the present value sensitivity
-
parSpread
public double parSpread(ResolvedFxSwap swap, 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:
swap- the productprovider- the rates provider- Returns:
- the spread
-
parSpreadSensitivity
public PointSensitivities parSpreadSensitivity(ResolvedFxSwap swap, 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:
swap- the productprovider- the rates provider- Returns:
- the spread curve sensitivity
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFxSwap product, RatesProvider provider)
Calculates the currency exposure of the FX swap product.This discounts each payment on each leg in its own currency.
- Parameters:
product- the productprovider- the rates provider- Returns:
- the currency exposure
-
currentCash
public MultiCurrencyAmount currentCash(ResolvedFxSwap swap, LocalDate valuationDate)
Calculates the current cash of the FX swap product.- Parameters:
swap- the productvaluationDate- the valuation date- Returns:
- the current cash
-
-