Class BondFutureTradeCalculations
- java.lang.Object
-
- com.opengamma.strata.measure.bond.BondFutureTradeCalculations
-
public class BondFutureTradeCalculations extends Object
Calculates pricing and risk measures for trades in a futures contract based on a basket of bonds.This provides a high-level entry point for future pricing and risk measures.
Each method takes a
ResolvedBondFutureTrade, whereas application code will typically work withBondFutureTrade. CallBondFutureTrade::resolve(ReferenceData)to convertBondFutureTradetoResolvedBondFutureTrade.Price
Strata uses decimal prices for bond futures in the trade model, pricers and market data. This is coherent with the pricing ofFixedCouponBond. The bond futures delivery is a bond for an amount computed from the bond future price, a conversion factor and the accrued interest.
-
-
Field Summary
Fields Modifier and Type Field Description static BondFutureTradeCalculationsDEFAULTDefault implementation.
-
Constructor Summary
Constructors Constructor Description BondFutureTradeCalculations(DiscountingBondFutureTradePricer tradePricer)Creates an instance.
-
Method Summary
-
-
-
Field Detail
-
DEFAULT
public static final BondFutureTradeCalculations DEFAULT
Default implementation.
-
-
Constructor Detail
-
BondFutureTradeCalculations
public BondFutureTradeCalculations(DiscountingBondFutureTradePricer tradePricer)
Creates an instance.In most cases, applications should use the
DEFAULTinstance.- Parameters:
tradePricer- the pricer forResolvedBondFutureTrade
-
-
Method Detail
-
presentValue
public CurrencyScenarioArray presentValue(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup 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(ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider discountingProvider)
Calculates present value for a single set of market data.- Parameters:
trade- the tradediscountingProvider- the market data- Returns:
- the present value
-
pv01CalibratedSum
public MultiCurrencyScenarioArray pv01CalibratedSum(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup 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(ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider discountingProvider)
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 tradediscountingProvider- the market data- Returns:
- the present value sensitivity
-
pv01CalibratedBucketed
public ScenarioArray<CurrencyParameterSensitivities> pv01CalibratedBucketed(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup 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(ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider discountingProvider)
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 tradediscountingProvider- the market data- Returns:
- the present value sensitivity
-
pv01MarketQuoteSum
public MultiCurrencyScenarioArray pv01MarketQuoteSum(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup 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(ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider 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(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup 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(ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider 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(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup 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(ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider discountingProvider)
Calculates par spread for a single set of market data.- Parameters:
trade- the tradediscountingProvider- the market data- Returns:
- the par spread
-
unitPrice
public DoubleScenarioArray unitPrice(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates unit price across one or more scenarios.This is the price of a single unit of the security.
Price
Strata uses decimal prices for bond futures in the trade model, pricers and market data. This is coherent with the pricing ofFixedCouponBond. The bond futures delivery is a bond for an amount computed from the bond future price, a conversion factor and the accrued interest.- 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(ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider discountingProvider)
Calculates unit price for a single set of market data.This is the price of a single unit of the security.
Price
Strata uses decimal prices for bond futures in the trade model, pricers and market data. This is coherent with the pricing ofFixedCouponBond. The bond futures delivery is a bond for an amount computed from the bond future price, a conversion factor and the accrued interest.- Parameters:
trade- the tradediscountingProvider- the market data- Returns:
- the present value
-
currencyExposure
public MultiCurrencyScenarioArray currencyExposure(ResolvedBondFutureTrade trade, LegalEntityDiscountingMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates currency exposure across one or more scenarios.The currency risk, expressed as the equivalent amount in each currency.
- Parameters:
trade- the tradelookup- the lookup used to query the market datamarketData- the market data- Returns:
- the currency exposure, one entry per scenario
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider discountingProvider)
Calculates currency exposure for a single set of market data.The currency risk, expressed as the equivalent amount in each currency.
- Parameters:
trade- the tradediscountingProvider- the market data- Returns:
- the currency exposure
-
-