Class DiscountingFixedCouponBondTradePricer
- java.lang.Object
-
- com.opengamma.strata.pricer.bond.DiscountingFixedCouponBondTradePricer
-
public class DiscountingFixedCouponBondTradePricer extends Object
Pricer for fixed coupon bond trades.This function provides the ability to price a
ResolvedFixedCouponBondTrade
.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 DiscountingFixedCouponBondTradePricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingFixedCouponBondTradePricer(DiscountingFixedCouponBondProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyAmount
currencyExposure(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider)
Calculates the currency exposure of the fixed coupon bond trade.MultiCurrencyAmount
currencyExposureWithZSpread(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the currency exposure of the fixed coupon bond trade with z-spread.CurrencyAmount
currentCash(ResolvedFixedCouponBondTrade trade, LocalDate valuationDate)
Calculates the current cash of the fixed coupon bond trade.CurrencyAmount
presentValue(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider)
Calculates the present value of the fixed coupon bond trade.CurrencyAmount
presentValueFromCleanPrice(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, ReferenceData refData, double cleanPrice)
Calculates the present value of the fixed coupon bond trade from the clean price of the underlying product.CurrencyAmount
presentValueFromCleanPriceWithZSpread(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, ReferenceData refData, double cleanPrice, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the fixed coupon bond trade with z-spread from the clean price of the underlying product.PointSensitivities
presentValueSensitivity(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider)
Calculates the present value sensitivity of the fixed coupon bond trade.PointSensitivities
presentValueSensitivityWithZSpread(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the fixed coupon bond trade with z-spread.CurrencyAmount
presentValueWithZSpread(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the fixed coupon bond trade with z-spread.Payment
upfrontPayment(ResolvedFixedCouponBondTrade trade)
Calculates the payment that was made for the trade.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingFixedCouponBondTradePricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingFixedCouponBondTradePricer
public DiscountingFixedCouponBondTradePricer(DiscountingFixedCouponBondProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.- Parameters:
productPricer
- the pricer forResolvedFixedCouponBond
paymentPricer
- the pricer forPayment
-
-
Method Detail
-
presentValue
public CurrencyAmount presentValue(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider)
Calculates the present value of the fixed coupon 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 tradeprovider
- the discounting provider- Returns:
- the present value of the fixed coupon bond trade
-
presentValueWithZSpread
public CurrencyAmount presentValueWithZSpread(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the fixed coupon 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 tradeprovider
- the discounting providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the present value of the fixed coupon bond trade
-
presentValueFromCleanPrice
public CurrencyAmount presentValueFromCleanPrice(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, ReferenceData refData, double cleanPrice)
Calculates the present value of the fixed coupon bond trade from the clean price of the underlying product.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 tradeprovider
- the discounting providerrefData
- the reference data used to calculate the settlement datecleanPrice
- the clean price- Returns:
- the present value of the fixed coupon bond trade
-
presentValueFromCleanPriceWithZSpread
public CurrencyAmount presentValueFromCleanPriceWithZSpread(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, ReferenceData refData, double cleanPrice, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value of the fixed coupon bond trade with z-spread from the clean price of the underlying product.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 tradeprovider
- the discounting providerrefData
- the reference data used to calculate the settlement datecleanPrice
- the clean pricezSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the present value of the fixed coupon bond trade
-
presentValueSensitivity
public PointSensitivities presentValueSensitivity(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider)
Calculates the present value sensitivity of the fixed coupon 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 tradeprovider
- the discounting provider- Returns:
- the present value curve sensitivity of the trade
-
presentValueSensitivityWithZSpread
public PointSensitivities presentValueSensitivityWithZSpread(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the present value sensitivity of the fixed coupon bond trade with z-spread.The present value sensitivity of the trade is the sensitivity of the present value to the underlying curves.
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 tradeprovider
- the discounting providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the present value curve sensitivity of the trade
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider)
Calculates the currency exposure of the fixed coupon bond trade.- Parameters:
trade
- the tradeprovider
- the discounting provider- Returns:
- the currency exposure of the fixed coupon bond trade
-
currencyExposureWithZSpread
public MultiCurrencyAmount currencyExposureWithZSpread(ResolvedFixedCouponBondTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
Calculates the currency exposure of the fixed coupon bond trade with z-spread.- Parameters:
trade
- the tradeprovider
- the discounting providerzSpread
- the z-spreadcompoundedRateType
- the compounded rate typeperiodsPerYear
- the number of periods per year- Returns:
- the currency exposure of the fixed coupon bond trade
-
currentCash
public CurrencyAmount currentCash(ResolvedFixedCouponBondTrade trade, LocalDate valuationDate)
Calculates the current cash of the fixed coupon bond trade.- Parameters:
trade
- the tradevaluationDate
- the valuation date- Returns:
- the current cash amount
-
upfrontPayment
public Payment upfrontPayment(ResolvedFixedCouponBondTrade trade)
Calculates the payment that was made for the trade.This is the payment that was made on the settlement date, based on the quantity and clean price.
- Parameters:
trade
- the trade- Returns:
- the payment that was made
-
-