Examples of accept()


Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.CouponCMS.accept()

    final CouponFixed cpnStrike = new CouponFixed(CUR, PAYMENT_TIME, FUNDING_CURVE_NAME, PAYMENT_ACCRUAL_FACTOR, NOTIONAL, STRIKE);
    // No extrapolation
    final CurrencyAmount pvCapLong = METHOD_CMS_SPREAD.presentValue(CMS_CAP_SPREAD, SABR_BUNDLE);
    final CurrencyAmount pvFloorLong = METHOD_CMS_SPREAD.presentValue(CMS_FLOOR_SPREAD, SABR_BUNDLE);
    final Double pvCMS1 = cms1.accept(PVC_SABR, SABR_BUNDLE);
    final Double pvCMS2 = cms2.accept(PVC_SABR, SABR_BUNDLE);
    final Double pvStrike = cpnStrike.accept(PVC_SABR, SABR_BUNDLE);
    assertEquals("CMS spread: Cap/Floor parity", pvCMS1 - pvCMS2 - pvStrike, pvCapLong.getAmount() - pvFloorLong.getAmount(), TOLERANCE_PRICE);
    // Extrapolation
    final CurrencyAmount pvCapLongExtra = METHOD_CMS_SPREAD_EXTRAPOLATION.presentValue(CMS_CAP_SPREAD, SABR_BUNDLE);
    final CurrencyAmount pvFloorLongExtra = METHOD_CMS_SPREAD_EXTRAPOLATION.presentValue(CMS_FLOOR_SPREAD, SABR_BUNDLE);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixed.accept()

    // No extrapolation
    final CurrencyAmount pvCapLong = METHOD_CMS_SPREAD.presentValue(CMS_CAP_SPREAD, SABR_BUNDLE);
    final CurrencyAmount pvFloorLong = METHOD_CMS_SPREAD.presentValue(CMS_FLOOR_SPREAD, SABR_BUNDLE);
    final Double pvCMS1 = cms1.accept(PVC_SABR, SABR_BUNDLE);
    final Double pvCMS2 = cms2.accept(PVC_SABR, SABR_BUNDLE);
    final Double pvStrike = cpnStrike.accept(PVC_SABR, SABR_BUNDLE);
    assertEquals("CMS spread: Cap/Floor parity", pvCMS1 - pvCMS2 - pvStrike, pvCapLong.getAmount() - pvFloorLong.getAmount(), TOLERANCE_PRICE);
    // Extrapolation
    final CurrencyAmount pvCapLongExtra = METHOD_CMS_SPREAD_EXTRAPOLATION.presentValue(CMS_CAP_SPREAD, SABR_BUNDLE);
    final CurrencyAmount pvFloorLongExtra = METHOD_CMS_SPREAD_EXTRAPOLATION.presentValue(CMS_FLOOR_SPREAD, SABR_BUNDLE);
    final Double pvCMS1Extra = cms1.accept(PVC_SABR_EXTRA, SABR_BUNDLE);
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.CouponIborSpread.accept()

    Map<String, List<DoublesPair>> sense = clean(payment1Curve.accept(PVSC, CURVES), eps, eps * notional);
    List<DoublesPair> sense5FD = curveSensitvityFDCalculator(payment1Curve, PVC, CURVES, FIVE_PC_CURVE_NAME, nodeTimes, eps);
    assertSensitivityEquals(sense5FD, sense.get(FIVE_PC_CURVE_NAME), eps * notional);

    //2 curves
    sense = clean(payment.accept(PVSC, CURVES), eps, eps * notional);
    final List<DoublesPair> sense0FD = curveSensitvityFDCalculator(payment, PVC, CURVES, ZERO_PC_CURVE_NAME, nodeTimes, eps);
    sense5FD = curveSensitvityFDCalculator(payment, PVC, CURVES, FIVE_PC_CURVE_NAME, nodeTimes, eps);
    assertSensitivityEquals(sense0FD, sense.get(ZERO_PC_CURVE_NAME), eps * notional);
    assertSensitivityEquals(sense5FD, sense.get(FIVE_PC_CURVE_NAME), eps * notional);
  }
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.Payment.accept()

    final int n = annuity.getNumberOfPayments();
    Payment payment;
    for (int i = 0; i < n; i++) {
      payment = annuity.getNthPayment(i);
      final double temp = payment.accept(PRESENT_VALUE_CALCULATOR, curves);
      sum += temp * Math.exp(-zSpread * payment.getPaymentTime());
    }
    return sum;
  }

View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.payments.derivative.PaymentFixed.accept()

    final double pvCoupon = bond.getBondTransaction().getCoupon().accept(PVC, curves);
    final double settlementAmount = -(bond.getTransactionPrice() * bond.getBondTransaction().getCoupon().getNthPayment(0).getNotional() + bond.getBondTransaction().getAccruedInterest())
        * bond.getQuantity();
    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;
  }

  /**
   * Compute the present value of a Ibor coupon bond (FRN) transaction.
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionCashFixedIbor.accept()

      throw new IllegalStateException("Expecting a single payment in the currency of the swaption");
    }
    final Currency currency = definition.getCurrency();
    final PresentValueBlackCalculator pvCalculator = PresentValueBlackCalculator.getInstance();
    final YieldCurveWithBlackSwaptionBundle tomorrowData = SWAPTION_ROLLDOWN.rollDown(data, shiftTime);
    final double result = swaptionTomorrow.accept(pvCalculator, tomorrowData) - swaptionToday.accept(pvCalculator, data) + paymentToday.getAmount(currency);
    return MultipleCurrencyAmount.of(CurrencyAmount.of(currency, result));
  }

  public MultipleCurrencyAmount getTheta(final InterestRateFutureTransactionDefinition definition, final ZonedDateTime date, final String[] yieldCurveNames, final YieldCurveBundle data,
      final Double lastMarginPrice, final int daysForward) {
View Full Code Here

Examples of com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionPhysicalFixedIbor.accept()

      throw new IllegalStateException("Expecting a single payment in the currency of the swaption");
    }
    final Currency currency = definition.getCurrency();
    final PresentValueBlackCalculator pvCalculator = PresentValueBlackCalculator.getInstance();
    final YieldCurveWithBlackSwaptionBundle tomorrowData = SWAPTION_ROLLDOWN.rollDown(data, shiftTime);
    final double result = swaptionTomorrow.accept(pvCalculator, tomorrowData) - swaptionToday.accept(pvCalculator, data) + paymentToday.getAmount(currency);
    return MultipleCurrencyAmount.of(CurrencyAmount.of(currency, result));
  }

  public MultipleCurrencyAmount getTheta(final SwaptionCashFixedIborDefinition definition, final ZonedDateTime date, final String[] yieldCurveNames,
      final YieldCurveWithBlackSwaptionBundle data, final int daysForward) {
View Full Code Here

Examples of com.opengamma.analytics.financial.simpleinstruments.derivative.SimpleFuture.accept()

  private static final CommodityFuturePresentValueCalculator CALCULATOR = new CommodityFuturePresentValueCalculator();

  @Override
  protected Object computeValues(InstrumentDerivative derivative, SimpleFutureDataBundle market) {
    SimpleFuture simpleFuture = derivative.accept(SimpleFutureConverter.getInstance());
    final Double pv = simpleFuture.accept(CALCULATOR, market);
    return pv;
  }

}
View Full Code Here

Examples of com.opengamma.analytics.financial.simpleinstruments.derivative.SimpleInstrument.accept()

    }
    final YieldAndDiscountCurve curve = (YieldAndDiscountCurve) curveObject;
    final double spot = (Double) spotObject;
    final SimpleFutureDataBundleDeprecated data = new SimpleFutureDataBundleDeprecated(curve, null, spot, 0., 0.);
    final SimpleInstrument instrument = security.accept(CONVERTER).toDerivative(now);
    final CurrencyAmount pv = instrument.accept(CALCULATOR, data);
    final ValueProperties properties = createValueProperties()
        .with(ValuePropertyNames.CURVE, _curveName)
        .with(ValuePropertyNames.CURRENCY, pv.getCurrency().getCode()).get();
    final ValueSpecification spec = new ValueSpecification(ValueRequirementNames.PRESENT_VALUE, target.toSpecification(), properties);
    return Collections.singleton(new ComputedValue(spec, pv.getAmount()));
View Full Code Here

Examples of com.opengamma.engine.cache.msg.CacheMessage.accept()

  @Override
  public void messageReceived(final FudgeContext fudgeContext, final FudgeMsgEnvelope msgEnvelope) {
    final FudgeDeserializer deserializer = new FudgeDeserializer(fudgeContext);
    final CacheMessage message = deserializer.fudgeMsgToObject(CacheMessage.class, msgEnvelope.getMessage());
    message.accept(_messageReceiver);
  }

}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.