Examples of withRecoveryRate()


Examples of com.opengamma.analytics.financial.credit.creditdefaultswap.definition.legacy.LegacyVanillaCreditDefaultSwapDefinition.withRecoveryRate()

    // Create a calibration CDS (will be a modified version of the baseline CDS)
    LegacyVanillaCreditDefaultSwapDefinition calibrationCDS = cds;

    // Set the recovery rate of the calibration CDS used for the curve calibration (this appears in the calculation of the contingent leg)
    calibrationCDS = calibrationCDS.withRecoveryRate(calibrationRecoveryRate);

    // -------------------------------------------------------------------------------------

    // Create a calibrate survival curve object
    final CalibrateHazardRateCurveLegacyCreditDefaultSwap hazardRateCurve = new CalibrateHazardRateCurveLegacyCreditDefaultSwap();
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.creditdefaultswap.definition.legacy.LegacyVanillaCreditDefaultSwapDefinition.withRecoveryRate()

    tenors[0] = DateUtils.getUTCDate(2013, 6, 20);
    marketSpreads[0] = flatSpread;

    LegacyVanillaCreditDefaultSwapDefinition calibrationCDS = cds;

    calibrationCDS = calibrationCDS.withRecoveryRate(calibrationRecoveryRate);

    final CalibrateHazardRateCurveLegacyCreditDefaultSwap hazardRateCurve = new CalibrateHazardRateCurveLegacyCreditDefaultSwap();

    //final double[] calibratedHazardRateTermStructure = hazardRateCurve.getCalibratedHazardRateTermStructure(valuationDate, calibrationCDS, tenors, marketSpreads, yieldCurve, priceType);
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.creditdefaultswap.definition.legacy.LegacyVanillaCreditDefaultSwapDefinition.withRecoveryRate()

      //recoveryRateObject = 0.4;
    }
    final double recoveryRate = (Double) recoveryRateObject;
    LegacyVanillaCreditDefaultSwapDefinition definition = (LegacyVanillaCreditDefaultSwapDefinition) security.accept(converter);
    definition = definition.withEffectiveDate(FOLLOWING.adjustDate(calendar, valuationTime.withHour(0).withMinute(0).withSecond(0).withNano(0).plusDays(1)));
    definition = definition.withRecoveryRate(recoveryRate);
    final Object yieldCurveObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE);
    if (yieldCurveObject == null) {
      throw new OpenGammaRuntimeException("Could not get yield curve");
    }
    final Object spreadCurveObject = inputs.getValue(ValueRequirementNames.CREDIT_SPREAD_CURVE);
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.creditdefaultswap.definition.legacy.LegacyVanillaCreditDefaultSwapDefinition.withRecoveryRate()

    Object recoveryRateObject = inputs.getValue(new ValueRequirement(MarketDataRequirementNames.MARKET_VALUE, ComputationTargetType.PRIMITIVE, recoveryRateIdentifier.getExternalId()));
    if (recoveryRateObject == null) {
      //throw new OpenGammaRuntimeException("Could not get recovery rate");
      recoveryRateObject = 0.4;
    }
    cds = cds.withRecoveryRate((Double) recoveryRateObject);
    final Object yieldCurveObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE);
    if (yieldCurveObject == null) {
      throw new OpenGammaRuntimeException("Could not get yield curve");
    }
    final Object spreadCurveObject = inputs.getValue(ValueRequirementNames.CREDIT_SPREAD_CURVE);
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.creditdefaultswap.definition.legacy.LegacyVanillaCreditDefaultSwapDefinition.withRecoveryRate()

    }
    final double recoveryRate = underlyingDefinition.getRecoveryRate();
    final Calendar calendar = new HolidaySourceCalendarAdapter(holidaySource, FinancialSecurityUtils.getCurrency(security));
    LegacyVanillaCreditDefaultSwapDefinition definition = (LegacyVanillaCreditDefaultSwapDefinition) security.accept(converter);
    definition = definition.withEffectiveDate(FOLLOWING.adjustDate(calendar, valuationTime.withHour(0).withMinute(0).withSecond(0).withNano(0).plusDays(1)));
    definition = definition.withRecoveryRate(recoveryRate);
    final Object yieldCurveObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE);
    if (yieldCurveObject == null) {
      throw new OpenGammaRuntimeException("Could not get yield curve");
    }
    final Object spreadCurveObject = inputs.getValue(ValueRequirementNames.CREDIT_SPREAD_CURVE);
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.creditdefaultswap.definition.vanilla.CreditDefaultSwapDefinition.withRecoveryRate()

    // Extract the underlying CDS from the CDS Swaption contract
    CreditDefaultSwapDefinition modifiedCDS = getUnderlyingCDS();

    // Modify the recovery rate of the underlying CDS
    modifiedCDS = modifiedCDS.withRecoveryRate(recoveryRate);

    // Return the modified CDS Swaption contract
    return new CreditDefaultSwapOptionDefinition(
        getBuySellProtection(),
        getProtectionBuyer(),
View Full Code Here

Examples of com.opengamma.analytics.financial.credit.creditdefaultswapoption.definition.CreditDefaultSwapOptionDefinition.withRecoveryRate()

    if (recoveryRateObject == null) {
      throw new OpenGammaRuntimeException("Could not get recovery rate");
    }
    final double recoveryRate = (Double) recoveryRateObject;
    CreditDefaultSwapOptionDefinition definition = security.accept(converter);
    definition = definition.withRecoveryRate(recoveryRate);
    final Object yieldCurveObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE);
    if (yieldCurveObject == null) {
      throw new OpenGammaRuntimeException("Could not get yield curve");
    }
    final Object spreadCurveObject = inputs.getValue(ValueRequirementNames.CREDIT_SPREAD_CURVE);
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.