Package com.opengamma.analytics.financial.instrument.swaption

Examples of com.opengamma.analytics.financial.instrument.swaption.SwaptionBermudaFixedIborDefinition


  /**
   * 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 looptest = 0; looptest < nbTest; looptest++) {
      swapDefinition[looptest] = SwapFixedIborDefinition.from(SETTLEMENT_DATE, CMS_INDEX, NOTIONAL, RATE + looptest * 0.0010 / nbTest, FIXED_IS_PAYER, CALENDAR);
      for (int loopexp = 0; loopexp < NB_EXPIRY; loopexp++) {
        swapExpiryDefinition[looptest][loopexp] = swapDefinition[looptest].trimStart(EXPIRY_DATE[loopexp]);
      }
      swaptionBermudaDefinition[looptest] = new SwaptionBermudaFixedIborDefinition(swapExpiryDefinition[looptest], IS_LONG, EXPIRY_DATE);
      swaptionBermuda[looptest] = swaptionBermudaDefinition[looptest].toDerivative(REFERENCE_DATE);
    }
    // Loop for pricing
    final MultipleCurrencyAmount[] pv = new MultipleCurrencyAmount[nbTest];

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

    for (int looptest = 0; looptest < nbTest; looptest++) {
      swapDefinition[looptest] = SwapFixedIborDefinition.from(SETTLEMENT_DATE, CMS_INDEX, NOTIONAL, RATE + looptest * 0.0010 / nbTest, FIXED_IS_PAYER, CALENDAR);
      for (int loopexp = 0; loopexp < NB_EXPIRY; loopexp++) {
        swapExpiryDefinition[looptest][loopexp] = swapDefinition[looptest].trimStart(EXPIRY_DATE[loopexp]);
      }
      swaptionBermudaDefinition[looptest] = new SwaptionBermudaFixedIborDefinition(swapExpiryDefinition[looptest], IS_LONG, EXPIRY_DATE);
      swaptionBermuda[looptest] = swaptionBermudaDefinition[looptest].toDerivative(REFERENCE_DATE, CURVES_NAME);
    }
    // Loop for pricing
    final CurrencyAmount[] pv = new CurrencyAmount[nbTest];
    startTime = System.currentTimeMillis();
View Full Code Here

    final SwapFixedIborDefinition swapDefinition = SwapFixedIborDefinition.from(SETTLEMENT_DATE, CMS_INDEX, NOTIONAL, RATE, FIXED_IS_PAYER, CALENDAR);
    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.instrument.swaption.SwaptionBermudaFixedIborDefinition

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.