com.opengamma.strata.pricer.bond

• java.lang.Object

• public class DiscountingFixedCouponBondTradePricer
extends Object
Pricer for for rate 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 and Description
static DiscountingFixedCouponBondTradePricer DEFAULT
Default implementation.
• ### Constructor Summary

Constructors
Constructor and Description
DiscountingFixedCouponBondTradePricer(DiscountingFixedCouponBondProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.
• ### Method Summary

All Methods
Modifier and Type Method and 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 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)
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Field Detail

• #### DEFAULT

public static final DiscountingFixedCouponBondTradePricer DEFAULT
Default implementation.
• ### Constructor Detail

public DiscountingFixedCouponBondTradePricer(DiscountingFixedCouponBondProductPricer productPricer,
DiscountingPaymentPricer paymentPricer)
Creates an instance.
Parameters:
productPricer - the pricer for ResolvedFixedCouponBond
paymentPricer - the pricer for Payment
• ### 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 trade
provider - the discounting provider
Returns:
the present value of the fixed coupon bond trade

public CurrencyAmount presentValueWithZSpread(ResolvedFixedCouponBondTrade trade,
LegalEntityDiscountingProvider provider,
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 trade
provider - the discounting provider
zSpread - the z-spread
compoundedRateType - the compounded rate type
periodsPerYear - 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 trade
provider - the discounting provider
refData - the reference data used to calculate the settlement date
cleanPrice - the clean price
Returns:
the present value of the fixed coupon bond trade

public CurrencyAmount presentValueFromCleanPriceWithZSpread(ResolvedFixedCouponBondTrade trade,
LegalEntityDiscountingProvider provider,
ReferenceData refData,
double cleanPrice,
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 trade
provider - the discounting provider
refData - the reference data used to calculate the settlement date
cleanPrice - the clean price
zSpread - the z-spread
compoundedRateType - the compounded rate type
periodsPerYear - 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 trade
provider - the discounting provider
Returns:
the present value curve sensitivity of the trade

public PointSensitivities presentValueSensitivityWithZSpread(ResolvedFixedCouponBondTrade trade,
LegalEntityDiscountingProvider provider,
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 trade
provider - the discounting provider
zSpread - the z-spread
compoundedRateType - the compounded rate type
periodsPerYear - 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 trade
provider - the discounting provider
Returns:
the currency exposure of the fixed coupon bond trade

public MultiCurrencyAmount currencyExposureWithZSpread(ResolvedFixedCouponBondTrade trade,
LegalEntityDiscountingProvider provider,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Calculates the currency exposure of the fixed coupon bond trade with z-spread.
Parameters:
trade - the trade
provider - the discounting provider
zSpread - the z-spread
compoundedRateType - the compounded rate type
periodsPerYear - 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 of the fixed coupon bond trade.
Parameters:
trade - the trade
valuationDate - the valuation date
Returns:
the current cash amount
• #### upfrontPayment

public Payment upfrontPayment(ResolvedFixedCouponBondTrade trade)
trade - the trade