Examples of ISDACDSDerivative


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

    ArgumentChecker.isTrue(yieldCurveNames.length >= 1, "At least one curve required (discount, credit spread is optional)");

    final String discountCurveName = yieldCurveNames[0];
    final String spreadCurveName =  yieldCurveNames.length > 1 ? yieldCurveNames[1] : null;

    return new ISDACDSDerivative(
        discountCurveName, spreadCurveName,
        _premium.toDerivative(pricingDate, discountCurveName),
        getTimeBetween(pricingDate, _startDate),
        getTimeBetween(pricingDate, _maturity),
        getTimeBetween(pricingDate, stepinDate),
View Full Code Here

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

   * @param settlementDate The settlement date
   * @return The derivative form of a CDS
   */
  public ISDACDSDerivative toDerivative(final ZonedDateTime pricingDate, final ZonedDateTime stepinDate, final ZonedDateTime settlementDate) {

    return new ISDACDSDerivative(
        _premium.toDerivative(pricingDate),
        getTimeBetween(pricingDate, _startDate),
        getTimeBetween(pricingDate, _maturity),
        getTimeBetween(pricingDate, stepinDate),
        getTimeBetween(pricingDate, settlementDate),
View Full Code Here

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

    // 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();

    return DoublesPair.of(cleanPrice, dirtyPrice);
  }
View Full Code Here

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

        .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();

    return DoublesPair.of(cleanPrice, dirtyPrice);
  }
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.