Examples of CurrencyAmount


Examples of com.opengamma.util.money.CurrencyAmount

    Validate.notNull(curves);
    if (!(curves instanceof HullWhiteOneFactorPiecewiseConstantDataBundle)) {
      throw new UnsupportedOperationException("The PresentValueHullWhiteMonteCarloCalculator visitor visitSwaptionPhysicalFixedIbor requires a HullWhiteOneFactorPiecewiseConstantDataBundle as data.");
    }
    final HullWhiteMonteCarloMethod methodMC = new HullWhiteMonteCarloMethod(new NormalRandomNumberGenerator(0.0, 1.0, new MersenneTwister()), _nbPath);
    final CurrencyAmount pvMC = methodMC
        .presentValue(swaption, swaption.getCurrency(), swaption.getUnderlyingSwap().getFirstLeg().getDiscountCurve(), (HullWhiteOneFactorPiecewiseConstantDataBundle) curves);
    return pvMC.getAmount();
  }
View Full Code Here

Examples of com.opengamma.util.money.CurrencyAmount

    Validate.notNull(curves);
    if (!(curves instanceof HullWhiteOneFactorPiecewiseConstantDataBundle)) {
      throw new UnsupportedOperationException("The PresentValueHullWhiteMonteCarloCalculator visitor visitSwaptionPhysicalFixedIbor requires a HullWhiteOneFactorPiecewiseConstantDataBundle as data.");
    }
    final HullWhiteMonteCarloMethod methodMC = new HullWhiteMonteCarloMethod(new NormalRandomNumberGenerator(0.0, 1.0, new MersenneTwister()), _nbPath);
    final CurrencyAmount pvMC = methodMC.presentValue(annuity, annuity.getCurrency(), annuity.getDiscountCurve(), (HullWhiteOneFactorPiecewiseConstantDataBundle) curves);
    return pvMC.getAmount();
  }
View Full Code Here

Examples of com.opengamma.util.money.CurrencyAmount

   * @return The present value.
   */
  public CurrencyAmount presentValue(final AnnuityCouponFixed annuity, final YieldCurveBundle curves) {
    Validate.notNull(curves);
    Validate.notNull(annuity);
    CurrencyAmount pv = CurrencyAmount.of(annuity.getCurrency(), 0);
    for (final CouponFixed cpn : annuity.getPayments()) {
      pv = pv.plus(METHOD_CPN_FIXED.presentValue(cpn, curves));
    }
    return pv;
  }
View Full Code Here

Examples of com.opengamma.util.money.CurrencyAmount

   * @return The present value.
   */
  public CurrencyAmount presentValuePositiveNotional(final AnnuityCouponFixed annuity, final YieldCurveBundle curves) {
    Validate.notNull(curves);
    Validate.notNull(annuity);
    CurrencyAmount pv = CurrencyAmount.of(annuity.getCurrency(), 0);
    for (final CouponFixed cpn : annuity.getPayments()) {
      pv = pv.plus(METHOD_CPN_FIXED.presentValuePositiveNotional(cpn, curves));
    }
    return pv;
  }
View Full Code Here

Examples of com.opengamma.util.money.CurrencyAmount

   * @return The present value.
   */
  public CurrencyAmount presentValuePositiveNotional(final Annuity<CouponFixedAccruedCompounding> annuity, final YieldCurveBundle curves) {
    Validate.notNull(curves);
    Validate.notNull(annuity);
    CurrencyAmount pv = CurrencyAmount.of(annuity.getCurrency(), 0);
    for (final Payment cpn : annuity.getPayments()) {
      pv = pv.plus(METHOD_CPN_ACCRUED.presentValuePositiveNotional((CouponFixedAccruedCompounding) cpn, curves));
    }
    return pv;
  }
View Full Code Here

Examples of com.opengamma.util.money.CurrencyAmount

    final double forward = spot * dfForeign / dfDomestic;
    final double volatility = FXVolatilityUtils.getVolatility(smile, foreignCcy, domesticCcy, optionForex.getExpirationTime(), forward, forward);
    final double sigmaRootT = volatility * Math.sqrt(expiry);
    final double dM = Math.log(forward / strike) / sigmaRootT - 0.5 * sigmaRootT;
    final double pv = amount * dfDomestic * NORMAL.getCDF(omega * dM) * (optionForex.isLong() ? 1.0 : -1.0);
    final CurrencyAmount priceCurrency = CurrencyAmount.of(domesticCcy, pv);
    return MultipleCurrencyAmount.of(priceCurrency);
  }
View Full Code Here

Examples of com.opengamma.util.money.CurrencyAmount

   * @return The present value.
   */
  public CurrencyAmount presentValue(final BillTransaction bill, final YieldCurveBundle curves) {
    ArgumentChecker.notNull(bill, "Bill");
    ArgumentChecker.notNull(curves, "Curves");
    final CurrencyAmount pvBill = METHOD_SECURITY.presentValue(bill.getBillPurchased(), curves);
    final double pvSettle = bill.getSettlementAmount() * curves.getCurve(bill.getBillPurchased().getDiscountingCurveName()).getDiscountFactor(bill.getBillPurchased().getSettlementTime());
    return pvBill.multipliedBy(bill.getQuantity()).plus(pvSettle);
  }
View Full Code Here

Examples of com.opengamma.util.money.CurrencyAmount

   * @param priceFuture The price of the underlying future.
   * @return The present value.
   */
  public CurrencyAmount presentValueFromFuturePrice(final InterestRateFutureOptionMarginTransaction transaction, final YieldCurveBundle curves, final double priceFuture) {
    final double priceSecurity = _securityMethod.optionPriceFromFuturePrice(transaction.getUnderlyingOption(), curves, priceFuture);
    final CurrencyAmount priceTransaction = presentValueFromPrice(transaction, priceSecurity);
    return priceTransaction;
  }
View Full Code Here

Examples of com.opengamma.util.money.CurrencyAmount

  @Override
  public CurrencyAmount presentValue(final InstrumentDerivative instrument, final YieldCurveBundle curves) {
    ArgumentChecker.isTrue(instrument instanceof InterestRateFutureOptionMarginTransaction, "The instrument should be a InterestRateFutureOptionMarginTransaction");
    final InterestRateFutureOptionMarginTransaction transaction = (InterestRateFutureOptionMarginTransaction) instrument;
    final double priceSecurity = _securityMethod.optionPrice(transaction.getUnderlyingOption(), curves);
    final CurrencyAmount pvTransaction = presentValueFromPrice(transaction, priceSecurity);
    return pvTransaction;
  }
View Full Code Here

Examples of com.opengamma.util.money.CurrencyAmount

    final double volatility = FXVolatilityUtils.getVolatility(smile, optionForex.getCurrency1(), optionForex.getCurrency2(), optionForex.getUnderlyingOption()
        .getTimeToExpiry(), optionForex.getUnderlyingOption().getStrike(), forward);
    double price = BARRIER_FUNCTION.getPrice(optionForex.getUnderlyingOption(), optionForex.getBarrier(), rebateByForeignUnit, spot, rateDomestic - rateForeign,
        rateDomestic, volatility);
    price *= Math.abs(foreignAmount) * sign;
    final CurrencyAmount priceCurrency = CurrencyAmount.of(optionForex.getUnderlyingOption().getUnderlyingForex().getCurrency2(), price);
    return MultipleCurrencyAmount.of(priceCurrency);
  }
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.