Class DiscountingCapitalIndexedBondTradePricer
- java.lang.Object
-
- com.opengamma.strata.pricer.bond.DiscountingCapitalIndexedBondTradePricer
-
public class DiscountingCapitalIndexedBondTradePricer extends Object
Pricer for for capital index bond trades.This function provides the ability to price a
ResolvedCapitalIndexedBondTrade
.Price
Strata uses decimal prices for bonds in the trade model, pricers and market data. For example, a price of 99.32% is represented in Strata by 0.9932.
-
-
Field Summary
Fields Modifier and Type Field Description static DiscountingCapitalIndexedBondTradePricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingCapitalIndexedBondTradePricer(DiscountingCapitalIndexedBondProductPricer productPricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmount
currencyExposure(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the currency exposure of the bond trade.MultiCurrencyAmount
currencyExposureFromCleanPrice(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice)
Calculates the currency exposure of the bond trade.MultiCurrencyAmount
currencyExposureFromCleanPriceWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the currency exposure of the bond trade with z-spread.MultiCurrencyAmount
currencyExposureWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the currency exposure of the bond trade with z-spread.CurrencyAmount
currentCash(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider)
Calculates the current cash of the bond trade.CurrencyAmount
netAmount(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider)
Calculates the net amount of the settlement of the bond trade.CurrencyAmount
presentValue(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the present value of the bond trade.CurrencyAmount
presentValueFromCleanPrice(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice)
Calculates the present value of the bond trade from the clean price.CurrencyAmount
presentValueFromCleanPriceWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the settlement of the bond trade from the clean price with z-spread.PointSensitivities
presentValueSensitivity(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the present value sensitivity of the bond trade.PointSensitivities
presentValueSensitivityFromCleanPrice(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice)
Calculates the present value sensitivity of the settlement of the bond trade from the real clean price.PointSensitivities
presentValueSensitivityFromCleanPriceWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the settlement of the bond trade from the real clean price with z-spread.PointSensitivities
presentValueSensitivityWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the bond trade with z-spread.CurrencyAmount
presentValueWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the bond trade with z-spread.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingCapitalIndexedBondTradePricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingCapitalIndexedBondTradePricer
public DiscountingCapitalIndexedBondTradePricer(DiscountingCapitalIndexedBondProductPricer productPricer)
Creates an instance.- Parameters:
productPricer
- pricer forResolvedCapitalIndexedBond
-
-
Method Detail
-
presentValue
public CurrencyAmount presentValue(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the present value of the bond trade.The present value of the trade is the value on the valuation date. The result is expressed using the payment currency of the bond.
Coupon payments of the underlying product are considered based on the settlement date of the trade.
- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors provider- Returns:
- the present value of the bond trade
-
presentValueWithZSpread
public CurrencyAmount presentValueWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the bond trade with z-spread.The present value of the trade is the value on the valuation date. The result is expressed using the payment currency of the bond.
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
Coupon payments of the underlying product are considered based on the settlement date of the trade.
- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the present value of the bond trade
-
presentValueSensitivity
public PointSensitivities presentValueSensitivity(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the present value sensitivity of the bond trade.The present value sensitivity of the trade is the sensitivity of the present value to the underlying curves.
Coupon payments of the underlying product are considered based on the settlement date of the trade.
- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors provider- Returns:
- the present value sensitivity of the bond trade
-
presentValueSensitivityWithZSpread
public PointSensitivities presentValueSensitivityWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the bond trade with z-spread.The present value sensitivity of the trade is the sensitivity of the present value to the underlying curves.
Coupon payments of the underlying product are considered based on the settlement date of the trade.
- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the present value sensitivity of the bond trade
-
presentValueFromCleanPrice
public CurrencyAmount presentValueFromCleanPrice(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice)
Calculates the present value of the bond trade from the clean price.Since the sign of the settlement notional is opposite to that of the product, negative amount will be returned for positive quantity of trade.
- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesrefData
- the reference data used to calculate the settlement datediscountingProvider
- the discount factors providercleanRealPrice
- the clean real price- Returns:
- the present value of the settlement
-
presentValueFromCleanPriceWithZSpread
public CurrencyAmount presentValueFromCleanPriceWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the settlement of the bond trade from the clean price with z-spread.Since the sign of the settlement notional is opposite to that of the product, negative amount will be returned for positive quantity of trade.
The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the discounting curve.
- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement datezSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per yearcleanRealPrice
- the clean real price- Returns:
- the present value of the settlement
-
presentValueSensitivityFromCleanPrice
public PointSensitivities presentValueSensitivityFromCleanPrice(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice)
Calculates the present value sensitivity of the settlement of the bond trade from the real clean price.The present value sensitivity of the settlement is the sensitivity of the present value to the underlying curves.
- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesrefData
- the reference data used to calculate the settlement datediscountingProvider
- the discount factors providercleanRealPrice
- the clean real price- Returns:
- the present value sensitivity of the settlement
-
presentValueSensitivityFromCleanPriceWithZSpread
public PointSensitivities presentValueSensitivityFromCleanPriceWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the settlement of the bond trade from the real clean price with z-spread.The present value sensitivity of the settlement is the sensitivity of the present value to the underlying curves.
- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesrefData
- the reference data used to calculate the settlement datediscountingProvider
- the discount factors providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per yearcleanRealPrice
- the clean real price- Returns:
- the present value sensitivity of the settlement
-
currencyExposureFromCleanPrice
public MultiCurrencyAmount currencyExposureFromCleanPrice(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice)
Calculates the currency exposure of the bond trade.- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement datecleanRealPrice
- the clean real price- Returns:
- the currency exposure of the trade
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider)
Calculates the currency exposure of the bond trade.- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors provider- Returns:
- the currency exposure of the trade
-
currencyExposureFromCleanPriceWithZSpread
public MultiCurrencyAmount currencyExposureFromCleanPriceWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, ReferenceData refData, double cleanRealPrice, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the currency exposure of the bond trade with z-spread.- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerrefData
- the reference data used to calculate the settlement datezSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per yearcleanRealPrice
- the clean real price- Returns:
- the currency exposure of the trade
-
currencyExposureWithZSpread
public MultiCurrencyAmount currencyExposureWithZSpread(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the currency exposure of the bond trade with z-spread.- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index valuesdiscountingProvider
- the discount factors providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the currency exposure of the trade
-
currentCash
public CurrencyAmount currentCash(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider)
Calculates the current cash of the bond trade.- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index values- Returns:
- the current cash
-
netAmount
public CurrencyAmount netAmount(ResolvedCapitalIndexedBondTrade trade, RatesProvider ratesProvider)
Calculates the net amount of the settlement of the bond trade.Since the sign of the settlement notional is opposite to that of the product, negative amount will be returned for positive quantity of trade.
- Parameters:
trade
- the traderatesProvider
- the rates provider, used to determine price index values- Returns:
- the net amount
-
-