Package com.opengamma.timeseries.date.localdate

Examples of com.opengamma.timeseries.date.localdate.LocalDateDoubleTimeSeries


            assertNotNull(added);
            assertNotNull(added.getUniqueId());
           
            Map<ExternalIdBundle, LocalDateDoubleTimeSeries> resultMap = _historicalTimeSeriesProvider.getHistoricalTimeSeries(
                Collections.singleton(bundleWithDates.toBundle()), BloombergConstants.BLOOMBERG_DATA_SOURCE_NAME, dataProvider, dataField, LocalDateRange.of(start, end, true));
            LocalDateDoubleTimeSeries timeSeries = resultMap.get(bundleWithDates.toBundle());
            UniqueId tsUid = _htsMaster.updateTimeSeriesDataPoints(added.getInfo().getTimeSeriesObjectId(), timeSeries);
           
            HistoricalTimeSeries hts = _htsMaster.getTimeSeries(tsUid);
            assertNotNull(hts);
            assertEquals(timeSeries, hts.getTimeSeries());
View Full Code Here


          start = cachedStart;
        }
        if (end.equals(LocalDate.MAX)) {
          end = previousWeekDay();
        }
        LocalDateDoubleTimeSeries timeSeries = makeRandomTimeSeries(start, end);
        tsMap.put(identifiers, timeSeries);
      }
      return new HistoricalTimeSeriesProviderGetResult(tsMap);
    }
View Full Code Here

    }
  }

  @Test
  public void testMissingDataWeekly() {
    LocalDateDoubleTimeSeries result = F.getSampledTimeSeries(TS_ONE_MISSING_DAY, FRIDAY_SCHEDULE);
    assertEquals(FRIDAY_SCHEDULE.length, result.size());
    int i = 0, j = 1;
    for (final Entry<LocalDate, Double> entry : result) {
      assertEquals(FRIDAY_SCHEDULE[i++], entry.getKey());
      if (entry.getKey().equals(MISSING_DAY_FRIDAY)) {
        assertEquals(j - 1, entry.getValue(), 0);
      } else {
        assertEquals(j, entry.getValue(), 0);
      }
      j += 5;
    }
    result = F.getSampledTimeSeries(TS_THREE_MISSING_DAYS, MONDAY_SCHEDULE);
    assertEquals(MONDAY_SCHEDULE.length, result.size());
    i = 0;
    j = 2;
    for (final Entry<LocalDate, Double> entry : result) {
      assertEquals(MONDAY_SCHEDULE[i++], entry.getKey());
      if (entry.getKey().equals(MISSING_DAY_MONDAY_1)) {
View Full Code Here

    }
  }

  @Test
  public void testThreeDaysMissingDataDaily() {
    final LocalDateDoubleTimeSeries result = F.getSampledTimeSeries(TS_THREE_MISSING_DAYS, DAILY_SCHEDULE);
    assertEquals(result.size(), DAILY_SCHEDULE.length);
    int i = 0;
    for (final Entry<LocalDate, Double> entry : result) {
      assertEquals(entry.getKey(), DAILY_SCHEDULE[i]);
      if (entry.getKey().equals(MISSING_DAY_FRIDAY)) {
        assertEquals(entry.getValue(), i - 1, 0);
View Full Code Here

    }
  }

  @Test
  public void testMissingMonth() {
    final LocalDateDoubleTimeSeries result = F.getSampledTimeSeries(TS_MISSING_MONTH, DAILY_SCHEDULE);
    assertEquals(result.size(), DAILY_SCHEDULE.length);
    int i = 0;
    for (final Entry<LocalDate, Double> entry : result) {
      assertEquals(entry.getKey(), DAILY_SCHEDULE[i]);
      if (entry.getKey().getMonth() == Month.FEBRUARY && entry.getKey().getYear() == 2009) {
        assertEquals(entry.getValue(), 21, 0);
View Full Code Here

      if (daily[i].isAfter(START)) {
        t.add(daily[i]);
        d.add(Double.valueOf(i));
      }
    }
    final LocalDateDoubleTimeSeries ts = ImmutableLocalDateDoubleTimeSeries.of(t, d);
    final LocalDateDoubleTimeSeries result = F.getSampledTimeSeries(ts, daily);
    assertEquals(result.size(), daily.length);
    final int offset = 16;
    int i = 0;
    for (final Entry<LocalDate, Double> entry : result) {
      assertEquals(entry.getKey(), daily[i]);
      if (i < 16) {
View Full Code Here

    }
  }

  @Test
  public void testNoMissingDataDaily() {
    final LocalDateDoubleTimeSeries result = F.getSampledTimeSeries(TS_NO_MISSING_DATA, DAILY_SCHEDULE);
    assertEquals(result.size(), DAILY_SCHEDULE.length);
    int i = 0;
    for (final Entry<LocalDate, Double> entry : result) {
      assertEquals(entry.getKey(), DAILY_SCHEDULE[i]);
      assertEquals(entry.getValue(), i++, 0);
    }
View Full Code Here

    }
  }

  @Test
  public void testMissingDataWeekly() {
    final LocalDateDoubleTimeSeries result = F.getSampledTimeSeries(TS_TWO_MISSING_DATA_POINTS, MONDAY_SCHEDULE);
    assertEquals(result.size(), MONDAY_SCHEDULE.length);
    int i = 0;
    int j = 2;
    for (final Entry<LocalDate, Double> entry : result) {
      assertEquals(entry.getKey(), MONDAY_SCHEDULE[i++]);
      if (entry.getKey().equals(MISSING_DAY_MONDAY_1) || entry.getKey().equals(MISSING_DAY_MONDAY_2)) {
View Full Code Here

    }
  }

  @Test
  public void testDaysMissingDataDaily() {
    final LocalDateDoubleTimeSeries result = F.getSampledTimeSeries(TS_TWO_MISSING_DATA_POINTS, DAILY_SCHEDULE);
    assertEquals(result.size(), DAILY_SCHEDULE.length);
    int i = 0;
    for (final Entry<LocalDate, Double> entry : result) {
      assertEquals(entry.getKey(), DAILY_SCHEDULE[i]);
      if (entry.getKey().equals(MISSING_DAY_MONDAY_1) || entry.getKey().equals(MISSING_DAY_MONDAY_2)) {
        assertEquals(entry.getValue(), i - 1, 0);
View Full Code Here

    while (date.isBefore(endDate)) {
      dates.add(date);
      fixings.add(FIXING_RATE);
      date = date.plusDays(1);
    }
    final LocalDateDoubleTimeSeries fixingSeries = ImmutableLocalDateDoubleTimeSeries.of(dates, fixings);
    final Set<InstrumentDefinition<?>> floatingInstruments = new HashSet<>(INSTRUMENTS_WITH_MANDATORY_FIXING_SERIES);
    floatingInstruments.addAll(INSTRUMENTS_WITH_OPTIONAL_FIXING_SERIES);
    for (final InstrumentDefinition<?> definition : floatingInstruments) {
      try {
        definition.accept(VISITOR, fixingSeries);
View Full Code Here

TOP

Related Classes of com.opengamma.timeseries.date.localdate.LocalDateDoubleTimeSeries

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.