Class DiscountingFixedCouponBondTradePricer


  • public class DiscountingFixedCouponBondTradePricer
    extends java.lang.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.
    • 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
      • 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 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
      • 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 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
      • 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 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
      • 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 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,
                                          java.time.LocalDate valuationDate)
        Calculates the current cash 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)
        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