Package com.opengamma.analytics.financial.interestrate.swaption.derivative

Examples of com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionBermudaFixedIbor


    for (int loopexp = 0; loopexp < nbExpiry; loopexp++) {
      expiryTime[loopexp] = TimeCalculator.getTimeBetween(date, _expiryDate[loopexp]);
      expirySwap[loopexp] = _underlyingSwap[loopexp].toDerivative(date, yieldCurveNames);
      settleTime[loopexp] = TimeCalculator.getTimeBetween(date, _underlyingSwap[loopexp].getFixedLeg().getNthPayment(0).getAccrualStartDate());
    }
    return new SwaptionBermudaFixedIbor(expirySwap, _isLong, expiryTime, settleTime);
  }
View Full Code Here


    for (int loopexp = 0; loopexp < nbExpiry; loopexp++) {
      expiryTime[loopexp] = TimeCalculator.getTimeBetween(date, _expiryDate[loopexp]);
      expirySwap[loopexp] = _underlyingSwap[loopexp].toDerivative(date);
      settleTime[loopexp] = TimeCalculator.getTimeBetween(date, _underlyingSwap[loopexp].getFixedLeg().getNthPayment(0).getAccrualStartDate());
    }
    return new SwaptionBermudaFixedIbor(expirySwap, _isLong, expiryTime, settleTime);
  }
View Full Code Here

   * Test the present value long/short parity.
   */
  public void longShortParity() {
    final MultipleCurrencyAmount pvLong = METHOD_BERMUDA.presentValue(BERMUDA_SWAPTION, HW_MULTICURVES);
    final SwaptionBermudaFixedIborDefinition bermudaShortDefinition = new SwaptionBermudaFixedIborDefinition(EXPIRY_SWAP_DEFINITION, !IS_LONG, EXPIRY_DATE);
    final SwaptionBermudaFixedIbor bermudShort = bermudaShortDefinition.toDerivative(REFERENCE_DATE);
    final MultipleCurrencyAmount pvShort = METHOD_BERMUDA.presentValue(bermudShort, HW_MULTICURVES);
    assertEquals("Bermuda swaption pv: short/long parity", pvLong.getAmount(CUR), -pvShort.getAmount(CUR), TOLERANCE_PV);
  }
View Full Code Here

    for (int loopexp = 0; loopexp < NB_EXPIRY; loopexp++) {
      expiryTime[loopexp] = actAct.getDayCountFraction(REFERENCE_DATE, EXPIRY_DATE[loopexp]);
      underlyingSwap[loopexp] = EXPIRY_SWAP_DEFINITION[loopexp].toDerivative(REFERENCE_DATE);
      settleTime[loopexp] = actAct.getDayCountFraction(REFERENCE_DATE, EXPIRY_SWAP_DEFINITION[loopexp].getFixedLeg().getNthPayment(0).getAccrualStartDate());
    }
    final SwaptionBermudaFixedIbor swaptionBermuda = new SwaptionBermudaFixedIbor(underlyingSwap, IS_LONG, expiryTime, settleTime);
    assertEquals("Swaption Bermuda: to derivatives", swaptionBermuda, BERMUDA_SWAPTION_DEFINITION.toDerivative(REFERENCE_DATE));
  }
View Full Code Here

    for (int loopexp = 0; loopexp < NB_EXPIRY; loopexp++) {
      expiryTime[loopexp] = actAct.getDayCountFraction(REFERENCE_DATE, EXPIRY_DATE[loopexp]);
      underlyingSwap[loopexp] = EXPIRY_SWAP_DEFINITION[loopexp].toDerivative(REFERENCE_DATE, CURVES_NAME);
      settleTime[loopexp] = actAct.getDayCountFraction(REFERENCE_DATE, EXPIRY_SWAP_DEFINITION[loopexp].getFixedLeg().getNthPayment(0).getAccrualStartDate());
    }
    final SwaptionBermudaFixedIbor swaptionBermuda = new SwaptionBermudaFixedIbor(underlyingSwap, IS_LONG, expiryTime, settleTime);
    assertEquals("Swaption Bermuda: to derivatives", swaptionBermuda, BERMUDA_SWAPTION_DEFINITION.toDerivative(REFERENCE_DATE, CURVES_NAME));
  }
View Full Code Here

   * Test the present value long/short parity.
   */
  public void longShortParity() {
    final CurrencyAmount pvLong = METHOD_BERMUDA.presentValue(BERMUDA_SWAPTION, BUNDLE_HW);
    final SwaptionBermudaFixedIborDefinition bermudaShortDefinition = new SwaptionBermudaFixedIborDefinition(EXPIRY_SWAP_DEFINITION, !IS_LONG, EXPIRY_DATE);
    final SwaptionBermudaFixedIbor bermudShort = bermudaShortDefinition.toDerivative(REFERENCE_DATE, CURVES_NAME);
    final CurrencyAmount pvShort = METHOD_BERMUDA.presentValue(bermudShort, BUNDLE_HW);
    assertEquals("Bermuda swaption pv: short/long parity", pvLong.getAmount(), -pvShort.getAmount(), 1.0E-2);
  }
View Full Code Here

    final SwapFixedIborDefinition[] swapExpiryDefinition = new SwapFixedIborDefinition[NB_EXPIRY];
    for (int loopexp = 0; loopexp < NB_EXPIRY; loopexp++) {
      swapExpiryDefinition[loopexp] = swapDefinition.trimStart(EXPIRY_DATE[loopexp]);
    }
    final SwaptionBermudaFixedIborDefinition swaptionBermudaDefinition = new SwaptionBermudaFixedIborDefinition(swapExpiryDefinition, IS_LONG, EXPIRY_DATE);
    final SwaptionBermudaFixedIbor swaptionBermuda = swaptionBermudaDefinition.toDerivative(REFERENCE_DATE, CURVES_NAME);

    // Loop for pricing
    startTime = System.currentTimeMillis();
    for (int looptest = 0; looptest < nbTest; looptest++) {
      totalPv = totalPv.plus(METHOD_BERMUDA.presentValue(swaptionBermuda, BUNDLE_HW));
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.interestrate.swaption.derivative.SwaptionBermudaFixedIbor

Copyright © 2018 www.massapicom. 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.