Package com.opengamma.analytics.financial.credit.creditdefaultswap.definition.standard

Examples of com.opengamma.analytics.financial.credit.creditdefaultswap.definition.standard.StandardCreditDefaultSwapDefinition


  public static double parallelCS01(CreditDefaultSwapDefinition definition,
                             ISDACompliantYieldCurve yieldCurve,
                             ZonedDateTime[] times, double[] marketSpreads, CDSAnalytic analytic, double fracBump) {
    double cs01;
    if (definition instanceof StandardCreditDefaultSwapDefinition) {
      StandardCreditDefaultSwapDefinition cds = (StandardCreditDefaultSwapDefinition) definition;
      cs01 = CALCULATOR.parallelCS01(analytic, new QuotedSpread(cds.getQuotedSpread() * 1e-4, getCoupon(cds.getPremiumLegCoupon())), yieldCurve, fracBump);
    } else if (definition instanceof LegacyCreditDefaultSwapDefinition) {
      final CDSAnalyticFactory analyticFactory = new CDSAnalyticFactory(definition.getRecoveryRate(), definition.getCouponFrequency().getPeriod())
          .with(definition.getBusinessDayAdjustmentConvention())
          .with(definition.getCalendar()).with(definition.getStubType())
          .withAccualDCC(definition.getDayCountFractionConvention());
View Full Code Here


    }
    CDSAnalytic[] buckets = analyticFactory.makeIMMCDS(definition.getStartDate().toLocalDate(), tenors);

    double[] cs01Values;
    if (definition instanceof StandardCreditDefaultSwapDefinition) {
      StandardCreditDefaultSwapDefinition cds = (StandardCreditDefaultSwapDefinition) definition;
      cs01Values = CALCULATOR.bucketedCS01FromCreditCurve(analytic, getCoupon(definition), buckets, yieldCurve, hazardCurve, bump);
    } else if (definition instanceof LegacyCreditDefaultSwapDefinition) {
      LegacyCreditDefaultSwapDefinition cds = (LegacyCreditDefaultSwapDefinition) definition;
      cs01Values = CALCULATOR.bucketedCS01FromCreditCurve(analytic, getCoupon(definition), buckets, yieldCurve, hazardCurve, bump);
    } else {
View Full Code Here

TOP

Related Classes of com.opengamma.analytics.financial.credit.creditdefaultswap.definition.standard.StandardCreditDefaultSwapDefinition

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.