Package com.opengamma.financial.convention.frequency

Examples of com.opengamma.financial.convention.frequency.SimpleFrequency


  public static LocalDate[] getSchedule(final LocalDate startDate, final LocalDate endDate, final Frequency frequency, final boolean endOfMonth, final boolean fromEnd,
      final boolean generateRecursive) {
    Validate.notNull(startDate, "start date");
    Validate.notNull(endDate, "end date");
    Validate.notNull(frequency, "frequency");
    SimpleFrequency simple;
    if (frequency instanceof SimpleFrequency) {
      simple = (SimpleFrequency) frequency;
    } else if (frequency instanceof PeriodFrequency) {
      simple = ((PeriodFrequency) frequency).toSimpleFrequency();
    } else {
      throw new IllegalArgumentException("Can only handle SimpleFrequency and PeriodFrequency");
    }
    final int periodsPerYear = (int) simple.getPeriodsPerYear();
    return getSchedule(startDate, endDate, periodsPerYear, endOfMonth, fromEnd, generateRecursive);
  }
View Full Code Here


  public static ZonedDateTime[] getSchedule(final ZonedDateTime startDate, final ZonedDateTime endDate, final Frequency frequency, final boolean endOfMonth, final boolean fromEnd,
      final boolean generateRecursive) {
    Validate.notNull(startDate, "start date");
    Validate.notNull(endDate, "end date");
    Validate.notNull(frequency, "frequency");
    SimpleFrequency simple;
    if (frequency instanceof SimpleFrequency) {
      simple = (SimpleFrequency) frequency;
    } else if (frequency instanceof PeriodFrequency) {
      simple = ((PeriodFrequency) frequency).toSimpleFrequency();
    } else {
      throw new IllegalArgumentException("Can only handle SimpleFrequency and PeriodFrequency");
    }
    final int periodsPerYear = (int) simple.getPeriodsPerYear();
    return getSchedule(startDate, endDate, periodsPerYear, endOfMonth, fromEnd, generateRecursive);
  }
View Full Code Here

 
  private CDSSecurity makeOneCDS() {
   
    ZonedDateTime maturity = LocalDateTime.of(2020, 12, 20, 0, 0, 0, 0).atZone(ZoneOffset.UTC);
    ZonedDateTime startDate = LocalDateTime.of(2010, 12, 20, 0, 0, 0, 0).atZone(ZoneOffset.UTC);
    SimpleFrequency frequency = SimpleFrequency.ANNUAL;
    DayCount dayCount = DayCountFactory.INSTANCE.getDayCount("Actual/360");
    BusinessDayConvention businessDayConvention = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    final CDSSecurity cds1 = new CDSSecurity(1.0, 0.6, 0.4, Currency.USD, maturity, startDate,
                                             frequency,
                                             dayCount,
View Full Code Here

TOP

Related Classes of com.opengamma.financial.convention.frequency.SimpleFrequency

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.