<commit_before>/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 * 
 * Please see distribution for license.
 */
package com.opengamma.financial.convention;

import javax.time.calendar.Period;

import org.apache.commons.lang.Validate;

import com.opengamma.core.id.ExternalSchemes;
import com.opengamma.financial.convention.businessday.BusinessDayConvention;
import com.opengamma.financial.convention.businessday.BusinessDayConventionFactory;
import com.opengamma.financial.convention.daycount.DayCount;
import com.opengamma.financial.convention.daycount.DayCountFactory;
import com.opengamma.financial.convention.frequency.Frequency;
import com.opengamma.financial.convention.frequency.SimpleFrequencyFactory;
import com.opengamma.id.ExternalId;
import com.opengamma.id.ExternalIdBundle;

/**
 * 
 */
public class AUConventions {

  public static synchronized void addFixedIncomeInstrumentConventions(final ConventionBundleMaster conventionMaster) {
    Validate.notNull(conventionMaster, "convention master");
    final BusinessDayConvention modified = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    final DayCount act365 = DayCountFactory.INSTANCE.getDayCount("Actual/365");
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);

    //TODO holiday associated with AUD swaps is Sydney
    final ExternalId au = ExternalSchemes.financialRegionId("AU");

    final Integer overnightPublicationLag = 0;

    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU00O/N Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR O/N")), "AUD LIBOR O/N", act365,
        following, Period.ofDays(1), 0, false, au);
    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU00S/N Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR S/N")), "AUD LIBOR S/N", act365,
        following, Period.ofDays(1), 0, false, au);
    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU00T/N Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR T/N")), "AUD LIBOR T/N", act365,
        following, Period.ofDays(1), 0, false, au);
    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU0001W Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR 1w")), "AUD LIBOR 1w", act365,
        following, Period.ofDays(1), 2, false, au);
    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU0002W Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR 2w")), "AUD LIBOR 2w", act365,
        following, Period.ofDays(1), 2, false, au);
    conventionMaster.addConventionBundle(<commit_msg>Added AUD rate futures conventions.<commit_after>/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 * 
 * Please see distribution for license.
 */
package com.opengamma.financial.convention;

import javax.time.calendar.Period;

import org.apache.commons.lang.Validate;

import com.opengamma.core.id.ExternalSchemes;
import com.opengamma.financial.convention.businessday.BusinessDayConvention;
import com.opengamma.financial.convention.businessday.BusinessDayConventionFactory;
import com.opengamma.financial.convention.daycount.DayCount;
import com.opengamma.financial.convention.daycount.DayCountFactory;
import com.opengamma.financial.convention.frequency.Frequency;
import com.opengamma.financial.convention.frequency.SimpleFrequencyFactory;
import com.opengamma.id.ExternalId;
import com.opengamma.id.ExternalIdBundle;

/**
 * 
 */
public class AUConventions {

  public static synchronized void addFixedIncomeInstrumentConventions(final ConventionBundleMaster conventionMaster) {
    Validate.notNull(conventionMaster, "convention master");
    final BusinessDayConvention modified = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    final DayCount act365 = DayCountFactory.INSTANCE.getDayCount("Actual/365");
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);

    //TODO holiday associated with AUD swaps is Sydney
    final ExternalId au = ExternalSchemes.financialRegionId("AU");

    final Integer overnightPublicationLag = 0;

    // IR FUTURES
    conventionMaster.addConventionBundle(ExternalIdBundle.of(ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD_IR_FUTURE")), "AUD_IR_FUTURE", act365, modified, Period.ofMonths(3),
        0, true, au);

    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU00O/N Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR O/N")), "AUD LIBOR O/N", act365,
        following, Period.ofDays(1), 0, false, au);
    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU00S/N Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR S/N")), "AUD LIBOR S/N", act365,
        following, Period.ofDays(1), 0, false, au);
    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU00T/N Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR T/N")), "AUD LIBOR T/N", act365,
        following, Period.ofDays(1), 0, false, au);
    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU0001W Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR 1w")), "AUD LIBOR 1w", act365,
        following, Period.ofDays(1), 2, false, au);
    conventionMaster.addConventionBundle(
        ExternalIdBundle.of(ExternalSchemes.bloombergTickerSecurityId("AU0002W Index"), ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, "AUD LIBOR 2w")), "AUD LIBOR 2w", act365,
        following, Period.ofDays(1), 2, false, au);
    conventionMaster.addConventionBundle(
{'fraction_non_alphanumeric': 0.09644234890698672, 'fraction_numerical': 0.016145163594799256, 'mean_word_length': 6.070707070707071, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3439683', 'n_tokens_mistral': 2251, 'n_tokens_neox': 2057, 'n_words': 370}