/** * Calculates the present value sensitivity of the bond future trade. * <p> * The present value sensitivity of the trade is the sensitivity of the present value to * the underlying curves. * * @param trade the trade * @param discountingProvider the discounting provider * @return the present value curve sensitivity of the trade */ public PointSensitivities presentValueSensitivity( ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider discountingProvider) { ResolvedBondFuture product = trade.getProduct(); PointSensitivities priceSensi = productPricer.priceSensitivity(product, discountingProvider); PointSensitivities marginIndexSensi = productPricer.marginIndexSensitivity(product, priceSensi); return marginIndexSensi.multipliedBy(trade.getQuantity()); }
/** * Calculates the present value sensitivity of the bond future trade with z-spread. * <p> * The present value sensitivity of the trade is the sensitivity of the present value to * the underlying curves. * <p> * The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates * of the issuer discounting curve. * * @param trade the trade * @param discountingProvider the discounting provider * @param zSpread the z-spread * @param compoundedRateType the compounded rate type * @param periodPerYear the number of periods per year * @return the present value curve sensitivity of the trade */ public PointSensitivities presentValueSensitivityWithZSpread( ResolvedBondFutureTrade trade, LegalEntityDiscountingProvider discountingProvider, double zSpread, CompoundedRateType compoundedRateType, int periodPerYear) { ResolvedBondFuture product = trade.getProduct(); PointSensitivities priceSensi = productPricer.priceSensitivityWithZSpread(product, discountingProvider, zSpread, compoundedRateType, periodPerYear); PointSensitivities marginIndexSensi = productPricer.marginIndexSensitivity(product, priceSensi); return marginIndexSensi.multipliedBy(trade.getQuantity()); }