public InterestRateCurveSensitivity presentValueSensitivity( final BondIborTransaction bond, final YieldCurveBundle curves) { final InterestRateCurveSensitivity pvsNominal = new InterestRateCurveSensitivity( bond.getBondTransaction().getNominal().accept(PVSC, curves)); final InterestRateCurveSensitivity pvsCoupon = new InterestRateCurveSensitivity( bond.getBondTransaction().getCoupon().accept(PVSC, curves)); final double settlementAmount = bond.getTransactionPrice() * bond.getBondTransaction() .getCoupon() .getNthPayment(0) .getNotional(); // FIXME: add accrued. LOGGER.error("The FRN settlement amount does not include the accrued interests."); final PaymentFixed settlement = new PaymentFixed( bond.getBondTransaction().getCurrency(), bond.getBondTransaction().getSettlementTime(), settlementAmount, bond.getBondTransaction().getRepoCurveName()); final InterestRateCurveSensitivity pvsSettlement = new InterestRateCurveSensitivity(settlement.accept(PVSC, curves)); return pvsNominal.plus(pvsCoupon).multipliedBy(bond.getQuantity()).plus(pvsSettlement); }
/** * Compute the present value of a Ibor coupon bond (FRN) transaction. * * @param bond The bond transaction. * @param curves The curve bundle. * @return The present value. */ public double presentValue(final BondIborTransaction bond, final YieldCurveBundle curves) { final double pvNominal = bond.getBondTransaction().getNominal().accept(PVC, curves); final double pvCoupon = bond.getBondTransaction().getCoupon().accept(PVC, curves); final double settlementAmount = bond.getTransactionPrice() * bond.getBondTransaction() .getCoupon() .getNthPayment(0) .getNotional(); // FIXME: add accrued. LOGGER.error("The FRN settlement amount does not include the accrued interests."); final PaymentFixed settlement = new PaymentFixed( bond.getBondTransaction().getCurrency(), bond.getBondTransaction().getSettlementTime(), settlementAmount, bond.getBondTransaction().getRepoCurveName()); final double pvSettlement = settlement.accept(PVC, curves); return (pvNominal + pvCoupon) * bond.getQuantity() + pvSettlement; }