Package com.opengamma.util.time

Examples of com.opengamma.util.time.Tenor


        final String relativeStrike = nextLine[7];
        final String ticker = nextLine[8];

        if (ticker != null) {
          final Currency currency = Currency.of(currencyIso);
          final Tenor swapTenor = Tenor.parse("P" + swapPeriod + swapPeriodUnit);
          final Tenor optionExpiry = Tenor.parse("P" + expiry + expiryUnit);
          double sign;
          if ("PY".equals(payOrReceive)) {
            sign = -1;
          } else if ("RC".equals(payOrReceive)) {
            sign = 1;
View Full Code Here


    for (int i = 0; i < matIndex; i++) {
      temp = temp.plus(PAYMENT_INTERVAL);
    }
    final LocalDate maturity = temp;
    final double coupon = 0.0075;
    final Tenor paymentInt = Tenor.of(PAYMENT_INTERVAL);

    final CDSAnalytic cdsS = FACTORY.makeCDS(tradeDate, effectiveDate, maturity);
    final MultiCDSAnalytic cdsM = new MultiCDSAnalytic(tradeDate, stepinDate, valueDate, effectiveDate, nextIMM, new int[] {matIndex }, new double[] {coupon }, PAY_ACC_ON_DEFAULT, paymentInt, STUB,
        PROCTECTION_START, RECOVERY_RATE, FOLLOWING, DEFAULT_CALENDAR, ACT360, ACT365);
View Full Code Here

      }
      maturities[i] = tMat;
    }

    final double[] coupons = new double[] {0.0075, 0.008, 0.01, 0.01, 0.011, 0.01, 0.009 };
    final Tenor paymentInt = Tenor.of(PAYMENT_INTERVAL);

    final CDSAnalytic[] cdsS = FACTORY.makeCDS(tradeDate, effectiveDate, maturities);
    final MultiCDSAnalytic cdsM = new MultiCDSAnalytic(tradeDate, stepinDate, valueDate, effectiveDate, nextIMM, matIndex, coupons, PAY_ACC_ON_DEFAULT, paymentInt, STUB, PROCTECTION_START,
        RECOVERY_RATE, FOLLOWING, DEFAULT_CALENDAR, ACT360, ACT365);
View Full Code Here

      for (int j = 0; j < steps; j++) {
        tMat = tMat.plus(PAYMENT_INTERVAL);
      }
      maturities[i] = tMat;
    }
    final Tenor paymentInt = Tenor.of(PAYMENT_INTERVAL);

    final CDSAnalytic[] cdsS = FACTORY.makeCDS(tradeDate, effectiveDate, maturities);
    final MultiCDSAnalytic cdsM = new MultiCDSAnalytic(tradeDate, stepinDate, valueDate, effectiveDate, nextIMM, matIndex, coupons, PAY_ACC_ON_DEFAULT, paymentInt, STUB, PROCTECTION_START,
        RECOVERY_RATE, FOLLOWING, DEFAULT_CALENDAR, ACT360, ACT365);
View Full Code Here

    cashInstrumentProviders.put(Tenor.ofDays(7), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId("US0001W Curncy")));

    final Map<Tenor, CurveInstrumentProvider> fraInstrumentProviders = new LinkedHashMap<>();
    final Object[][] tenorsTickersFRAs = new Object[][] { {Tenor.THREE_MONTHS, "USFR00C Curncy"}, {Tenor.SIX_MONTHS, "USFR0CF Curncy"}};
    for (final Object[] tenorsTickersFRA : tenorsTickersFRAs) {
      final Tenor tenor = (Tenor) tenorsTickersFRA[0];
      final String ticker = (String) tenorsTickersFRA[1];
      fraInstrumentProviders.put(tenor, new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(ticker)));
    }

    final Map<Tenor, CurveInstrumentProvider> rateInstrumentProviders = new LinkedHashMap<>();
    final Object[][] tenorsTickers = new Object[][] { {Tenor.ONE_MONTH, "US0001M Index"}, {Tenor.THREE_MONTHS, "US0003M Index"}};

    for (final Object[] tenorsTicker : tenorsTickers) {
      final Tenor tenor = (Tenor) tenorsTicker[0];
      final String ticker = (String) tenorsTicker[1];
      rateInstrumentProviders.put(tenor, new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(ticker)));
    }

    final Map<Tenor, CurveInstrumentProvider> futureInstrumentProviders = new LinkedHashMap<>();
View Full Code Here

    cashInstrumentProviders.put(Tenor.ofDays(7), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId("US0001W Curncy")));

    final Map<Tenor, CurveInstrumentProvider> fra3MInstrumentProviders = new LinkedHashMap<>();
    final Object[][] tenorsTickers3MFRAs = new Object[][] { {Tenor.THREE_MONTHS, "USFR00C Curncy"}, {Tenor.SIX_MONTHS, "USFR0CF Curncy"}};
    for (final Object[] tenorsTickers3MFRA : tenorsTickers3MFRAs) {
      final Tenor tenor = (Tenor) tenorsTickers3MFRA[0];
      final String ticker = (String) tenorsTickers3MFRA[1];
      fra3MInstrumentProviders.put(tenor, new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(ticker)));
    }

    final Map<Tenor, CurveInstrumentProvider> fra6MInstrumentProviders = new LinkedHashMap<>();
    final Object[][] tenorsTickers6MFRAs = new Object[][] { {Tenor.SIX_MONTHS, "USFR00F Curncy"}, {Tenor.NINE_MONTHS, "USFR0CI Curncy"}};
    for (final Object[] tenorsTickers6MFRA : tenorsTickers6MFRAs) {
      final Tenor tenor = (Tenor) tenorsTickers6MFRA[0];
      final String ticker = (String) tenorsTickers6MFRA[1];
      fra3MInstrumentProviders.put(tenor, new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(ticker)));
    }

    final Map<Tenor, CurveInstrumentProvider> liborInstrumentProviders = new LinkedHashMap<>();
    final Object[][] tenorsTickers = new Object[][] { {Tenor.ONE_MONTH, "US0001M Index"}, {Tenor.THREE_MONTHS, "US0003M Index"}};

    for (final Object[] tenorsTicker : tenorsTickers) {
      final Tenor tenor = (Tenor) tenorsTicker[0];
      final String ticker = (String) tenorsTicker[1];
      liborInstrumentProviders.put(tenor, new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(ticker)));
    }

    final Map<Tenor, CurveInstrumentProvider> futureInstrumentProviders = new LinkedHashMap<>();
View Full Code Here

    cashInstrumentProviders.put(Tenor.ofDays(7), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId("EUR001W Curncy")));

    final Map<Tenor, CurveInstrumentProvider> fra3MInstrumentProviders = new LinkedHashMap<>();
    final Object[][] tenorsTickers3MFRAs = new Object[][] { {Tenor.THREE_MONTHS, "EUFR00C Curncy"}, {Tenor.SIX_MONTHS, "EUFR0CF Curncy"}};
    for (final Object[] tenorsTickers3MFRA : tenorsTickers3MFRAs) {
      final Tenor tenor = (Tenor) tenorsTickers3MFRA[0];
      final String ticker = (String) tenorsTickers3MFRA[1];
      fra3MInstrumentProviders.put(tenor, new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(ticker)));
    }

    final Map<Tenor, CurveInstrumentProvider> fra6MInstrumentProviders = new LinkedHashMap<>();
    final Object[][] tenorsTickers6MFRAs = new Object[][] { {Tenor.SIX_MONTHS, "EUFR00F Curncy"}, {Tenor.NINE_MONTHS, "EUFR0CI Curncy"}};
    for (final Object[] tenorsTickers6MFRA : tenorsTickers6MFRAs) {
      final Tenor tenor = (Tenor) tenorsTickers6MFRA[0];
      final String ticker = (String) tenorsTickers6MFRA[1];
      fra3MInstrumentProviders.put(tenor, new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(ticker)));
    }
    final Map<Tenor, CurveInstrumentProvider> liborInstrumentProviders = new LinkedHashMap<>();
    final Object[][] tenorsLiborTickers = new Object[][] { {Tenor.ONE_WEEK, "EU0003W Index"}, {Tenor.ONE_MONTH, "EU0001M Index"}};

    for (final Object[] tenorsLiborTicker : tenorsLiborTickers) {
      final Tenor tenor = (Tenor) tenorsLiborTicker[0];
      final String ticker = (String) tenorsLiborTicker[1];
      liborInstrumentProviders.put(tenor, new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(ticker)));
    }

    final Map<Tenor, CurveInstrumentProvider> euriborInstrumentProviders = new LinkedHashMap<>();
    final Object[][] tenorsEuriborTickers = new Object[][] { {Tenor.ONE_WEEK, "EUR003W Index"}, {Tenor.ONE_MONTH, "EUR001M Index"}};

    for (final Object[] tenorsEuriborTicker : tenorsEuriborTickers) {
      final Tenor tenor = (Tenor) tenorsEuriborTicker[0];
      final String ticker = (String) tenorsEuriborTicker[1];
      euriborInstrumentProviders.put(tenor, new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(ticker)));
    }

    final Map<Tenor, CurveInstrumentProvider> futureInstrumentProviders = new LinkedHashMap<>();
View Full Code Here

          int i = 0;
          final DayCount dayCount = DayCountFactory.INSTANCE.getDayCount("Act/360"); //TODO
          final String impliedDepositCurveName = _impliedCurveCalculationConfig + "_" + _currency.getCode();
          final List<InstrumentDerivative> derivatives = new ArrayList<>();
          for (final FixedIncomeStrip strip : _impliedDefinition.getStrips()) {
            final Tenor tenor = strip.getCurveNodePointTime();
            final ZonedDateTime paymentDate = spotDate.plus(tenor.getPeriod()); // ScheduleCalculator.getAdjustedDate(spotDate, tenor.getPeriod(), MOD_FOL, calendar, true);
            final double startTime = 0.0; // TimeCalculator.getTimeBetween(valuationDateTime, spotDate);
            final double endTime = tenor.getPeriod().toTotalMonths() / 12.0d; // TimeCalculator.getTimeBetween(valuationDateTime, paymentDate);
            final double accrualFactor = dayCount.getDayCountFraction(valuationDateTime, valuationDateTime.plus(tenor.getPeriod()), calendar);
            final Cash cashFXCurve = new Cash(_currency, startTime, endTime, 1, 0, accrualFactor, fullYieldCurveName);
            final double parRate = METHOD_CASH.parRate(cashFXCurve, curves);
            final Cash cashDepositCurve = new Cash(_currency, startTime, endTime, 1, 0, accrualFactor, impliedDepositCurveName);
            derivatives.add(cashDepositCurve);
            t[i] = endTime;
View Full Code Here

          throw new OpenGammaRuntimeException("Could not get number of settlement days");
        }
        final Calendar calendar = new HolidaySourceCalendarAdapter(holidaySource, currency);
        final LocalDate localNow = now.toLocalDate();
        final Period forwardPeriod = Period.parse(forwardTenorName);
        final Tenor forwardTenor = Tenor.of(forwardPeriod);
        final LocalDate forwardStart = ScheduleCalculator.getAdjustedDate(localNow.plus(forwardPeriod), settlementDays, calendar); //TODO check adjustments
        for (final Tenor tenor : definition.getTenors()) {
          final ExternalId identifier = provider.getInstrument(localNow, tenor, forwardTenor);
          if (data.containsKey(identifier)) {
            final LocalDate expiry = ScheduleCalculator.getAdjustedDate(forwardStart.plus(tenor.getPeriod()), settlementDays, calendar);
View Full Code Here

        }
        final Double fxForward = data.getDataPoint(nodeWithId.getIdentifier());
        if (fxForward == null) {
          throw new OpenGammaRuntimeException("Could not get FX forward rate for " + node);
        }
        final Tenor tenor = node.getResolvedMaturity();
        tList.add(DateUtils.getDifferenceInYears(now, now.plus(tenor.getPeriod())));
        fxList.add(fxForward);
      }
      final Interpolator1D interpolator = CombinedInterpolatorExtrapolatorFactory.getInterpolator(interpolatorName,
          leftExtrapolatorName, rightExtrapolatorName);
      return InterpolatedDoublesCurve.from(tList.toDoubleArray(), fxList.toDoubleArray(), interpolator);
View Full Code Here

TOP

Related Classes of com.opengamma.util.time.Tenor

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.