Class FxVanillaOptionTradeCalculations
- java.lang.Object
-
- com.opengamma.strata.measure.fxopt.FxVanillaOptionTradeCalculations
-
public class FxVanillaOptionTradeCalculations extends Object
Calculates pricing and risk measures for FX vanilla option trades.This provides a high-level entry point for FX vanilla option pricing and risk measures. Pricing is performed using the Black method.
Each method takes a
ResolvedFxVanillaOptionTrade
, whereas application code will typically work withFxVanillaOptionTrade
. CallFxVanillaOptionTrade::resolve(ReferenceData)
to convertFxVanillaOptionTrade
toResolvedFxVanillaOptionTrade
.
-
-
Field Summary
Fields Modifier and Type Field Description static FxVanillaOptionTradeCalculations
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description FxVanillaOptionTradeCalculations(BlackFxVanillaOptionTradePricer blackPricer, VannaVolgaFxVanillaOptionTradePricer vannaVolgaPricer)
Creates an instance.
-
Method Summary
-
-
-
Field Detail
-
DEFAULT
public static final FxVanillaOptionTradeCalculations DEFAULT
Default implementation.
-
-
Constructor Detail
-
FxVanillaOptionTradeCalculations
public FxVanillaOptionTradeCalculations(BlackFxVanillaOptionTradePricer blackPricer, VannaVolgaFxVanillaOptionTradePricer vannaVolgaPricer)
Creates an instance.In most cases, applications should use the
DEFAULT
instance.- Parameters:
blackPricer
- the pricer forResolvedFxVanillaOptionTrade
using BlackvannaVolgaPricer
- the pricer forResolvedFxVanillaOptionTrade
using Vanna-Volga
-
-
Method Detail
-
presentValue
public MultiCurrencyScenarioArray presentValue(ResolvedFxVanillaOptionTrade trade, RatesMarketDataLookup ratesLookup, FxOptionMarketDataLookup fxLookup, ScenarioMarketData marketData, FxVanillaOptionMethod method)
Calculates present value across one or more scenarios.- Parameters:
trade
- the traderatesLookup
- the lookup used to query the market datafxLookup
- the lookup used to query the option market datamarketData
- the market datamethod
- the pricing method- Returns:
- the present value, one entry per scenario
-
presentValue
public MultiCurrencyAmount presentValue(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, FxOptionVolatilities volatilities, FxVanillaOptionMethod method)
Calculates present value for a single set of market data.- Parameters:
trade
- the traderatesProvider
- the market datavolatilities
- the option volatilitiesmethod
- the pricing method- Returns:
- the present value
-
pv01RatesCalibratedSum
public MultiCurrencyScenarioArray pv01RatesCalibratedSum(ResolvedFxVanillaOptionTrade trade, RatesMarketDataLookup ratesLookup, FxOptionMarketDataLookup fxLookup, ScenarioMarketData marketData, FxVanillaOptionMethod method)
Calculates present value sensitivity across one or more scenarios.This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is the sum of the sensitivities of all affected curves.
- Parameters:
trade
- the traderatesLookup
- the lookup used to query the market datafxLookup
- the lookup used to query the option market datamarketData
- the market datamethod
- the pricing method- Returns:
- the present value sensitivity, one entry per scenario
-
pv01RatesCalibratedSum
public MultiCurrencyAmount pv01RatesCalibratedSum(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, FxOptionVolatilities volatilities, FxVanillaOptionMethod method)
Calculates present value sensitivity for a single set of market data.This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is the sum of the sensitivities of all affected curves.
- Parameters:
trade
- the traderatesProvider
- the market datavolatilities
- the option volatilitiesmethod
- the pricing method- Returns:
- the present value sensitivity
-
pv01RatesCalibratedBucketed
public ScenarioArray<CurrencyParameterSensitivities> pv01RatesCalibratedBucketed(ResolvedFxVanillaOptionTrade trade, RatesMarketDataLookup ratesLookup, FxOptionMarketDataLookup fxLookup, ScenarioMarketData marketData, FxVanillaOptionMethod method)
Calculates present value sensitivity across one or more scenarios.This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is provided for each affected curve and currency, bucketed by curve node.
- Parameters:
trade
- the traderatesLookup
- the lookup used to query the market datafxLookup
- the lookup used to query the option market datamarketData
- the market datamethod
- the pricing method- Returns:
- the present value sensitivity, one entry per scenario
-
pv01RatesCalibratedBucketed
public CurrencyParameterSensitivities pv01RatesCalibratedBucketed(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, FxOptionVolatilities volatilities, FxVanillaOptionMethod method)
Calculates present value sensitivity for a single set of market data.This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is provided for each affected curve and currency, bucketed by curve node.
- Parameters:
trade
- the traderatesProvider
- the market datavolatilities
- the option volatilitiesmethod
- the pricing method- Returns:
- the present value sensitivity
-
pv01RatesMarketQuoteSum
public MultiCurrencyScenarioArray pv01RatesMarketQuoteSum(ResolvedFxVanillaOptionTrade trade, RatesMarketDataLookup ratesLookup, FxOptionMarketDataLookup fxLookup, ScenarioMarketData marketData, FxVanillaOptionMethod method)
Calculates present value sensitivity across one or more scenarios.This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is the sum of the sensitivities of all affected curves.
- Parameters:
trade
- the traderatesLookup
- the lookup used to query the market datafxLookup
- the lookup used to query the option market datamarketData
- the market datamethod
- the pricing method- Returns:
- the present value sensitivity, one entry per scenario
-
pv01RatesMarketQuoteSum
public MultiCurrencyAmount pv01RatesMarketQuoteSum(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, FxOptionVolatilities volatilities, FxVanillaOptionMethod method)
Calculates present value sensitivity for a single set of market data.This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is the sum of the sensitivities of all affected curves.
- Parameters:
trade
- the traderatesProvider
- the market datavolatilities
- the option volatilitiesmethod
- the pricing method- Returns:
- the present value sensitivity
-
pv01RatesMarketQuoteBucketed
public ScenarioArray<CurrencyParameterSensitivities> pv01RatesMarketQuoteBucketed(ResolvedFxVanillaOptionTrade trade, RatesMarketDataLookup ratesLookup, FxOptionMarketDataLookup fxLookup, ScenarioMarketData marketData, FxVanillaOptionMethod method)
Calculates present value sensitivity across one or more scenarios.This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is provided for each affected curve and currency, bucketed by curve node.
- Parameters:
trade
- the traderatesLookup
- the lookup used to query the market datamarketData
- the market datafxLookup
- the lookup used to query the option market datamethod
- the pricing method- Returns:
- the present value sensitivity, one entry per scenario
-
pv01RatesMarketQuoteBucketed
public CurrencyParameterSensitivities pv01RatesMarketQuoteBucketed(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, FxOptionVolatilities volatilities, FxVanillaOptionMethod method)
Calculates present value sensitivity for a single set of market data.This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is provided for each affected curve and currency, bucketed by curve node.
- Parameters:
trade
- the traderatesProvider
- the market datavolatilities
- the option volatilitiesmethod
- the pricing method- Returns:
- the present value sensitivity
-
vegaMarketQuoteBucketed
public ScenarioArray<CurrencyParameterSensitivities> vegaMarketQuoteBucketed(ResolvedFxVanillaOptionTrade trade, RatesMarketDataLookup ratesLookup, FxOptionMarketDataLookup fxLookup, ScenarioMarketData marketData, FxVanillaOptionMethod method)
Calculates present value vega sensitivity across one or more scenarios.This is the sensitivity of present value to the implied volatilities used to calibrate the curves.
- Parameters:
trade
- the traderatesLookup
- the lookup used to query the market datamarketData
- the market datafxLookup
- the lookup used to query the option market datamethod
- the pricing method- Returns:
- the present value sensitivity, one entry per scenario
-
vegaMarketQuoteBucketed
public CurrencyParameterSensitivities vegaMarketQuoteBucketed(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, FxOptionVolatilities volatilities, FxVanillaOptionMethod method)
Calculates present value vega sensitivity for a single set of market data.This is the sensitivity of present value of the implied volatilities used to calibrate the curves.
- Parameters:
trade
- the traderatesProvider
- the market datavolatilities
- the option volatilitiesmethod
- the pricing method- Returns:
- the present value sensitivity
-
currencyExposure
public MultiCurrencyScenarioArray currencyExposure(ResolvedFxVanillaOptionTrade trade, RatesMarketDataLookup ratesLookup, FxOptionMarketDataLookup fxLookup, ScenarioMarketData marketData, FxVanillaOptionMethod method)
Calculates currency exposure across one or more scenarios.The currency risk, expressed as the equivalent amount in each currency.
- Parameters:
trade
- the traderatesLookup
- the lookup used to query the market datafxLookup
- the lookup used to query the option market datamarketData
- the market datamethod
- the pricing method- Returns:
- the currency exposure, one entry per scenario
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, FxOptionVolatilities volatilities, FxVanillaOptionMethod method)
Calculates currency exposure for a single set of market data.The currency risk, expressed as the equivalent amount in each currency.
- Parameters:
trade
- the traderatesProvider
- the market datavolatilities
- the option volatilitiesmethod
- the pricing method- Returns:
- the currency exposure
-
currentCash
public CurrencyScenarioArray currentCash(ResolvedFxVanillaOptionTrade trade, RatesMarketDataLookup ratesLookup, FxOptionMarketDataLookup fxLookup, ScenarioMarketData marketData, FxVanillaOptionMethod method)
Calculates current cash across one or more scenarios.The sum of all cash flows paid on the valuation date.
- Parameters:
trade
- the traderatesLookup
- the lookup used to query the market datafxLookup
- the lookup used to query the option market datamarketData
- the market datamethod
- the pricing method- Returns:
- the current cash, one entry per scenario
-
currentCash
public CurrencyAmount currentCash(ResolvedFxVanillaOptionTrade trade, RatesProvider ratesProvider, FxOptionVolatilities volatilities, FxVanillaOptionMethod method)
Calculates current cash for a single set of market data.The sum of all cash flows paid on the valuation date.
- Parameters:
trade
- the traderatesProvider
- the market datavolatilities
- the option volatilitiesmethod
- the pricing method- Returns:
- the current cash
-
-