Class ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer
- java.lang.Object
-
- com.opengamma.strata.pricer.fxopt.ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer
-
public class ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer extends Object
Pricer for FX barrier option products under implied trinomial tree.This function provides the ability to price an
ResolvedFxSingleBarrierOption
.All of the computation is be based on the counter currency of the underlying FX transaction. For example, price, PV and risk measures of the product will be expressed in USD for an option on EUR/USD.
-
-
Field Summary
Fields Modifier and Type Field Description static ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer()
Pricer with the default number of time steps.ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer(int nSteps)
Pricer with the specified number of time steps.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmount
currencyExposure(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the currency exposure of the FX barrier option product.MultiCurrencyAmount
currencyExposure(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities, RecombiningTrinomialTreeData treeData)
Calculates the currency exposure of the FX barrier option product.ImpliedTrinomialTreeFxOptionCalibrator
getCalibrator()
Obtains the calibrator.CurrencyAmount
presentValue(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value of the FX barrier option product.CurrencyAmount
presentValue(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities, RecombiningTrinomialTreeData treeData)
Calculates the present value of the FX barrier option product.CurrencyParameterSensitivities
presentValueSensitivityRates(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value sensitivity of the FX barrier option product.CurrencyParameterSensitivities
presentValueSensitivityRates(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities, RecombiningTrinomialTreeData baseTreeData)
Calculates the present value sensitivity of the FX barrier option product.double
price(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the price of the FX barrier option product.double
price(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities, RecombiningTrinomialTreeData treeData)
Calculates the price of the FX barrier option product.
-
-
-
Field Detail
-
DEFAULT
public static final ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer
public ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer()
Pricer with the default number of time steps.
-
ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer
public ImpliedTrinomialTreeFxSingleBarrierOptionProductPricer(int nSteps)
Pricer with the specified number of time steps.- Parameters:
nSteps
- number of time steps
-
-
Method Detail
-
getCalibrator
public ImpliedTrinomialTreeFxOptionCalibrator getCalibrator()
Obtains the calibrator.- Returns:
- the calibrator
-
price
public double price(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the price of the FX barrier option product.The price of the product is the value on the valuation date for one unit of the base currency and is expressed in the counter currency. The price does not take into account the long/short flag. See presentValue for scaling and currency.
The trinomial tree is first calibrated to Black volatilities, then the price is computed based on the calibrated tree.
- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the price of the product
-
price
public double price(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities, RecombiningTrinomialTreeData treeData)
Calculates the price of the FX barrier option product.The price of the product is the value on the valuation date for one unit of the base currency and is expressed in the counter currency. The price does not take into account the long/short flag. See presnetValue for scaling and currency.
This assumes the tree is already calibrated and the tree data is stored as
RecombiningTrinomialTreeData
. The tree data should be consistent with the pricer and other inputs, seevalidateData(com.opengamma.strata.product.fxopt.ResolvedFxSingleBarrierOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities, com.opengamma.strata.pricer.fxopt.RecombiningTrinomialTreeData)
.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility providertreeData
- the trinomial tree data- Returns:
- the price of the product
-
presentValue
public CurrencyAmount presentValue(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value of the FX barrier option product.The present value of the product is the value on the valuation date. It is expressed in the counter currency.
The trinomial tree is first calibrated to Black volatilities, then the price is computed based on the calibrated tree.
- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value of the product
-
presentValue
public CurrencyAmount presentValue(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities, RecombiningTrinomialTreeData treeData)
Calculates the present value of the FX barrier option product.The present value of the product is the value on the valuation date. It is expressed in the counter currency.
This assumes the tree is already calibrated and the tree data is stored as
RecombiningTrinomialTreeData
. The tree data should be consistent with the pricer and other inputs, seevalidateData(com.opengamma.strata.product.fxopt.ResolvedFxSingleBarrierOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities, com.opengamma.strata.pricer.fxopt.RecombiningTrinomialTreeData)
.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility providertreeData
- the trinomial tree data- Returns:
- the present value of the product
-
presentValueSensitivityRates
public CurrencyParameterSensitivities presentValueSensitivityRates(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the present value sensitivity of the FX barrier option product.The present value sensitivity of the product is the sensitivity of
presentValue(com.opengamma.strata.product.fxopt.ResolvedFxSingleBarrierOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
to the underlying curve parameters.The sensitivity is computed by bump and re-price.
- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the present value of the product
-
presentValueSensitivityRates
public CurrencyParameterSensitivities presentValueSensitivityRates(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities, RecombiningTrinomialTreeData baseTreeData)
Calculates the present value sensitivity of the FX barrier option product.The present value sensitivity of the product is the sensitivity of
presentValue(com.opengamma.strata.product.fxopt.ResolvedFxSingleBarrierOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities)
to the underlying curve parameters.The sensitivity is computed by bump and re-price.
- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility providerbaseTreeData
- the trinomial tree data- Returns:
- the present value of the product
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities)
Calculates the currency exposure of the FX barrier option product.The trinomial tree is first calibrated to Black volatilities, then the price is computed based on the calibrated tree.
- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility provider- Returns:
- the currency exposure
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFxSingleBarrierOption option, RatesProvider ratesProvider, BlackFxOptionVolatilities volatilities, RecombiningTrinomialTreeData treeData)
Calculates the currency exposure of the FX barrier option product.This assumes the tree is already calibrated and the tree data is stored as
RecombiningTrinomialTreeData
. The tree data should be consistent with the pricer and other inputs, seevalidateData(com.opengamma.strata.product.fxopt.ResolvedFxSingleBarrierOption, com.opengamma.strata.pricer.rate.RatesProvider, com.opengamma.strata.pricer.fxopt.BlackFxOptionVolatilities, com.opengamma.strata.pricer.fxopt.RecombiningTrinomialTreeData)
.- Parameters:
option
- the option productratesProvider
- the rates providervolatilities
- the Black volatility providertreeData
- the trinomial tree data- Returns:
- the currency exposure
-
-