Package com.opengamma.analytics.financial.credit.cds

Examples of com.opengamma.analytics.financial.credit.cds.ISDACurve


   
    final double offset = deserializer.fieldValueToObject(double.class, message.getByName(OFFSET_FIELD_NAME)).doubleValue();
    final double zeroDiscountFactor = deserializer.fieldValueToObject(double.class, message.getByName(ZERO_DISCOUNT_FACTOR_FIELD_NAME)).doubleValue();
    final double[] shiftedTimePoints = deserializer.fieldValueToObject(double[].class, message.getByName(SHIFTED_TIME_POINTS_FIELD_NAME));
   
    return new ISDACurve(name, curve, offset, zeroDiscountFactor, shiftedTimePoints);
  }
View Full Code Here


    if (sourceCurve == null) {
      throw new OpenGammaRuntimeException("Could not get source discount curve to translate for ISDA");
    }
   
    final Curve<Double, Double> curveData = sourceCurve.getCurve();
    final ISDACurve isdaCurve = ISDACurve.fromBoxed(sourceCurve.getName(), curveData.getXData(), curveData.getYData(), 0.0);
   
    ComputedValue result = new ComputedValue(new ValueSpecification(ValueRequirementNames.YIELD_CURVE, target.toSpecification(), createValueProperties().get()), isdaCurve);
   
    return Collections.singleton(result);
  }
View Full Code Here

    final ZonedDateTime pricingDate = ZonedDateTime.now(executionContext.getValuationClock());
    final ZonedDateTime stepinDate = pricingDate.plusDays(1);
    final ZonedDateTime settlementDate = findSettlementDate(pricingDate, cdsDefinition.getConvention());

    // Discount curve
    final ISDACurve discountCurve = (ISDACurve) inputs.getValue(ValueRequirementNames.YIELD_CURVE);
    final double flatSpread = (Double) inputs.getValue(ValueRequirementNames.SPOT_RATE);

    // Convert security in to format suitable for pricing
    final ISDACDSDerivative cdsDerivative = cdsDefinition.toDerivative(pricingDate, stepinDate, settlementDate, discountCurve.getName());

    // Go price!
    final double dirtyPrice = ISDA_APPROX_METHOD.calculateUpfrontCharge(cdsDerivative, discountCurve, flatSpread, false, pricingDate, stepinDate, settlementDate, CALENDAR);
    final double cleanPrice = dirtyPrice - cdsDerivative.getAccruedInterest();
View Full Code Here

    final ZonedDateTime pricingDate = ZonedDateTime.now(executionContext.getValuationClock());
    final ZonedDateTime stepinDate = pricingDate.plusDays(1);
    final ZonedDateTime settlementDate = findSettlementDate(pricingDate, cdsDefinition.getConvention());

    // Discount curve
    final ISDACurve discountCurve = (ISDACurve) inputs.getValue(new ValueRequirement(
        ValueRequirementNames.YIELD_CURVE, ComputationTargetSpecification.of(cds.getCurrency()),
      ValueProperties.with(ValuePropertyNames.CALCULATION_METHOD, ISDAFunctionConstants.ISDA_METHOD_NAME).get()));

    // Hazard rate curve
    final ISDACurve hazardRateCurve = (ISDACurve) inputs.getValue(new ValueRequirement(
        ValueRequirementNames.YIELD_CURVE, ComputationTargetSpecification.of(cds.getCurrency()),
      ValueProperties
        .with(ValuePropertyNames.CURVE, "HAZARD_" + cds.getUnderlyingIssuer() + "_" + cds.getUnderlyingSeniority() + "_" + cds.getRestructuringClause())
        .with(ValuePropertyNames.CALCULATION_METHOD, ISDAFunctionConstants.ISDA_METHOD_NAME)
        .get()));

    // Convert security in to format suitable for pricing
    final ISDACDSDerivative cdsDerivative = cdsDefinition.toDerivative(pricingDate, stepinDate, settlementDate, discountCurve.getName(), hazardRateCurve.getName());

    // Go price!
    final double dirtyPrice = ISDA_APPROX_METHOD.calculateUpfrontCharge(cdsDerivative, discountCurve, hazardRateCurve, false);
    final double cleanPrice = dirtyPrice - cdsDerivative.getAccruedInterest();
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.credit.cds.ISDACurve

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.