Class MarketQuoteMeasure<T extends ResolvedTrade>
- java.lang.Object
-
- com.opengamma.strata.pricer.curve.MarketQuoteMeasure<T>
-
- Type Parameters:
T
- the trade type
- All Implemented Interfaces:
CalibrationMeasure<T>
public final class MarketQuoteMeasure<T extends ResolvedTrade> extends Object implements CalibrationMeasure<T>
Provides market quote measures for a single type of trade based on functions.This is initialized using functions that typically refer to pricers.
-
-
Field Summary
Fields Modifier and Type Field Description static MarketQuoteMeasure<ResolvedFraTrade>
FRA_MQ
The measure forResolvedFraTrade
using par rate discounting.static MarketQuoteMeasure<ResolvedIborFixingDepositTrade>
IBOR_FIXING_DEPOSIT_MQ
The measure forResolvedIborFixingDepositTrade
using par rate discounting.static MarketQuoteMeasure<ResolvedIborFutureTrade>
IBOR_FUTURE_MQ
The measure forResolvedIborFutureTrade
using price discounting.static MarketQuoteMeasure<ResolvedOvernightFutureTrade>
OVERNIGHT_FUTURE_MQ
The measure forResolvedOvernightFutureTrade
using price discounting.static MarketQuoteMeasure<ResolvedSwapTrade>
SWAP_MQ
The measure forResolvedSwapTrade
using par rate discounting.static MarketQuoteMeasure<ResolvedTermDepositTrade>
TERM_DEPOSIT_MQ
The measure forResolvedTermDepositTrade
using par rate discounting.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<T>
getTradeType()
Gets the trade type of the calibrator.static <R extends ResolvedTrade>
MarketQuoteMeasure<R>of(String name, Class<R> tradeType, ToDoubleBiFunction<R,RatesProvider> valueFn, BiFunction<R,RatesProvider,PointSensitivities> sensitivityFn)
Obtains a calibrator for a specific type of trade.CurrencyParameterSensitivities
sensitivities(T trade, RatesProvider provider)
Calculates the parameter sensitivities that relate to the value.String
toString()
double
value(T trade, RatesProvider provider)
Calculates the value, such as par spread.
-
-
-
Field Detail
-
FRA_MQ
public static final MarketQuoteMeasure<ResolvedFraTrade> FRA_MQ
The measure forResolvedFraTrade
using par rate discounting.
-
IBOR_FUTURE_MQ
public static final MarketQuoteMeasure<ResolvedIborFutureTrade> IBOR_FUTURE_MQ
The measure forResolvedIborFutureTrade
using price discounting.
-
OVERNIGHT_FUTURE_MQ
public static final MarketQuoteMeasure<ResolvedOvernightFutureTrade> OVERNIGHT_FUTURE_MQ
The measure forResolvedOvernightFutureTrade
using price discounting.
-
SWAP_MQ
public static final MarketQuoteMeasure<ResolvedSwapTrade> SWAP_MQ
The measure forResolvedSwapTrade
using par rate discounting. Apply only to swap with a fixed leg.
-
IBOR_FIXING_DEPOSIT_MQ
public static final MarketQuoteMeasure<ResolvedIborFixingDepositTrade> IBOR_FIXING_DEPOSIT_MQ
The measure forResolvedIborFixingDepositTrade
using par rate discounting.
-
TERM_DEPOSIT_MQ
public static final MarketQuoteMeasure<ResolvedTermDepositTrade> TERM_DEPOSIT_MQ
The measure forResolvedTermDepositTrade
using par rate discounting.
-
-
Method Detail
-
of
public static <R extends ResolvedTrade> MarketQuoteMeasure<R> of(String name, Class<R> tradeType, ToDoubleBiFunction<R,RatesProvider> valueFn, BiFunction<R,RatesProvider,PointSensitivities> sensitivityFn)
Obtains a calibrator for a specific type of trade.The functions typically refer to pricers.
- Type Parameters:
R
- the trade type- Parameters:
name
- the nametradeType
- the trade typevalueFn
- the function for calculating the valuesensitivityFn
- the function for calculating the sensitivity- Returns:
- the calibrator
-
getTradeType
public Class<T> getTradeType()
Description copied from interface:CalibrationMeasure
Gets the trade type of the calibrator.- Specified by:
getTradeType
in interfaceCalibrationMeasure<T extends ResolvedTrade>
- Returns:
- the trade type
-
value
public double value(T trade, RatesProvider provider)
Description copied from interface:CalibrationMeasure
Calculates the value, such as par spread.The value must be calculated using the specified rates provider.
- Specified by:
value
in interfaceCalibrationMeasure<T extends ResolvedTrade>
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the sensitivity
-
sensitivities
public CurrencyParameterSensitivities sensitivities(T trade, RatesProvider provider)
Description copied from interface:CalibrationMeasure
Calculates the parameter sensitivities that relate to the value.The sensitivities must be calculated using the specified rates provider.
- Specified by:
sensitivities
in interfaceCalibrationMeasure<T extends ResolvedTrade>
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the sensitivity
-
-