Class OvernightFutureTradeCalculations
- java.lang.Object
-
- com.opengamma.strata.measure.index.OvernightFutureTradeCalculations
-
public class OvernightFutureTradeCalculations extends Object
Calculates pricing and risk measures for trades in a futures contract based on an Overnight rate index.This provides a high-level entry point for future pricing and risk measures.
Each method takes a
ResolvedOvernightFutureTrade
, whereas application code will typically work withOvernightFutureTrade
. CallOvernightFutureTrade::resolve(ReferenceData)
to convertOvernightFutureTrade
toResolvedOvernightFutureTrade
.Price
The price of an Overnight rate future is based on the interest rate of the underlying index. It is defined as(100 - percentRate)
.Strata uses decimal prices for Overnight rate futures in the trade model, pricers and market data. The decimal price is based on the decimal rate equivalent to the percentage. For example, a price of 99.32 implies an interest rate of 0.68% which is represented in Strata by 0.9932.
-
-
Field Summary
Fields Modifier and Type Field Description static OvernightFutureTradeCalculations
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description OvernightFutureTradeCalculations(DiscountingOvernightFutureTradePricer tradePricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleScenarioArray
parSpread(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates par spread across one or more scenarios.double
parSpread(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates par spread for a single set of market data.CurrencyScenarioArray
presentValue(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value across one or more scenarios.CurrencyAmount
presentValue(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates present value for a single set of market data.ScenarioArray<CurrencyParameterSensitivities>
pv01CalibratedBucketed(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value sensitivity across one or more scenarios.CurrencyParameterSensitivities
pv01CalibratedBucketed(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates present value sensitivity for a single set of market data.MultiCurrencyScenarioArray
pv01CalibratedSum(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value sensitivity across one or more scenarios.MultiCurrencyAmount
pv01CalibratedSum(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates present value sensitivity for a single set of market data.ScenarioArray<CurrencyParameterSensitivities>
pv01MarketQuoteBucketed(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value sensitivity across one or more scenarios.CurrencyParameterSensitivities
pv01MarketQuoteBucketed(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates present value sensitivity for a single set of market data.MultiCurrencyScenarioArray
pv01MarketQuoteSum(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value sensitivity across one or more scenarios.MultiCurrencyAmount
pv01MarketQuoteSum(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates present value sensitivity for a single set of market data.DoubleScenarioArray
unitPrice(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates unit price across one or more scenarios.double
unitPrice(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates unit price for a single set of market data.
-
-
-
Field Detail
-
DEFAULT
public static final OvernightFutureTradeCalculations DEFAULT
Default implementation.
-
-
Constructor Detail
-
OvernightFutureTradeCalculations
public OvernightFutureTradeCalculations(DiscountingOvernightFutureTradePricer tradePricer)
Creates an instance.In most cases, applications should use the
DEFAULT
instance.- Parameters:
tradePricer
- the pricer forResolvedOvernightFutureTrade
-
-
Method Detail
-
presentValue
public CurrencyScenarioArray presentValue(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value across one or more scenarios.- Parameters:
trade
- the tradelookup
- the lookup used to query the market datamarketData
- the market data- Returns:
- the present value, one entry per scenario
-
presentValue
public CurrencyAmount presentValue(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates present value for a single set of market data.- Parameters:
trade
- the traderatesProvider
- the market data- Returns:
- the present value
-
pv01CalibratedSum
public MultiCurrencyScenarioArray pv01CalibratedSum(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
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 tradelookup
- the lookup used to query the market datamarketData
- the market data- Returns:
- the present value sensitivity, one entry per scenario
-
pv01CalibratedSum
public MultiCurrencyAmount pv01CalibratedSum(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
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 data- Returns:
- the present value sensitivity
-
pv01CalibratedBucketed
public ScenarioArray<CurrencyParameterSensitivities> pv01CalibratedBucketed(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
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 tradelookup
- the lookup used to query the market datamarketData
- the market data- Returns:
- the present value sensitivity, one entry per scenario
-
pv01CalibratedBucketed
public CurrencyParameterSensitivities pv01CalibratedBucketed(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
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 data- Returns:
- the present value sensitivity
-
pv01MarketQuoteSum
public MultiCurrencyScenarioArray pv01MarketQuoteSum(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
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 tradelookup
- the lookup used to query the market datamarketData
- the market data- Returns:
- the present value sensitivity, one entry per scenario
-
pv01MarketQuoteSum
public MultiCurrencyAmount pv01MarketQuoteSum(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
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 data- Returns:
- the present value sensitivity
-
pv01MarketQuoteBucketed
public ScenarioArray<CurrencyParameterSensitivities> pv01MarketQuoteBucketed(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
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 tradelookup
- the lookup used to query the market datamarketData
- the market data- Returns:
- the present value sensitivity, one entry per scenario
-
pv01MarketQuoteBucketed
public CurrencyParameterSensitivities pv01MarketQuoteBucketed(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
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 data- Returns:
- the present value sensitivity
-
parSpread
public DoubleScenarioArray parSpread(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates par spread across one or more scenarios.- Parameters:
trade
- the tradelookup
- the lookup used to query the market datamarketData
- the market data- Returns:
- the par spread, one entry per scenario
-
parSpread
public double parSpread(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates par spread for a single set of market data.- Parameters:
trade
- the traderatesProvider
- the market data- Returns:
- the par spread
-
unitPrice
public DoubleScenarioArray unitPrice(ResolvedOvernightFutureTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates unit price across one or more scenarios.This is the price of a single unit of the security.
Strata uses decimal prices for Overnight rate futures in the trade model, pricers and market data. The decimal price is based on the decimal rate equivalent to the percentage. For example, a price of 99.32 implies an interest rate of 0.68% which is represented in Strata by 0.9932.
- Parameters:
trade
- the tradelookup
- the lookup used to query the market datamarketData
- the market data- Returns:
- the present value, one entry per scenario
-
unitPrice
public double unitPrice(ResolvedOvernightFutureTrade trade, RatesProvider ratesProvider)
Calculates unit price for a single set of market data.This is the price of a single unit of the security.
Strata uses decimal prices for Overnight rate futures in the trade model, pricers and market data. The decimal price is based on the decimal rate equivalent to the percentage. For example, a price of 99.32 implies an interest rate of 0.68% which is represented in Strata by 0.9932.
- Parameters:
trade
- the traderatesProvider
- the market data- Returns:
- the present value
-
-