Package com.opengamma.financial.convention.frequency

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


      final InterestRateNotional notional = new InterestRateNotional(CURRENCY, 10000000 * (1 + RANDOM.nextInt(9)));
      final int years = 1 + RANDOM.nextInt(30);
      final ZonedDateTime maturityDate = tradeDate.plusYears(years);
      final double rate = years * 0.001 + RANDOM.nextDouble() / 5000;
      final FixedInterestRateLeg fixedLeg = new FixedInterestRateLeg(ACT_360, SEMI_ANNUAL, REGION, MODIFIED_FOLLOWING, notional, false, rate);
      final Frequency frequency;
      final ExternalId euribor;
      final String frequencyLabel;
      if (RANDOM.nextBoolean()) {
        frequency = QUARTERLY;
        euribor = EURIBOR_3M;
View Full Code Here


      final InterestRateNotional notional = new InterestRateNotional(CURRENCY, 10000000 * (1 + RANDOM.nextInt(9)));
      final int years = 1 + RANDOM.nextInt(30);
      final ZonedDateTime maturityDate = tradeDate.plusYears(years);
      final double rate = years * 0.001 + RANDOM.nextDouble() / 5000;
      final FixedInterestRateLeg fixedLeg = new FixedInterestRateLeg(ACT_360, SEMI_ANNUAL, REGION, MODIFIED_FOLLOWING, notional, false, rate);
      final Frequency frequency;
      if (RANDOM.nextBoolean()) {
        frequency = QUARTERLY;
      } else {
        frequency = SEMI_ANNUAL;
      }
View Full Code Here

    for (int i = 0; i < N_BASIS_SWAPS; i++) {
      final InterestRateNotional notional = new InterestRateNotional(CURRENCY, 10000000 * (1 + RANDOM.nextInt(9)));
      final int years = 1 + RANDOM.nextInt(30);
      final ZonedDateTime maturityDate = tradeDate.plusYears(years);
      final double spread = years * 0.002 + RANDOM.nextDouble() / 1000.;
      final Frequency payFrequency, receiveFrequency;
      final ExternalId payRate, receiveRate;
      final FloatingInterestRateLeg payLeg, receiveLeg;
      final String frequencyLabel;
      if (RANDOM.nextBoolean()) {
        payFrequency = QUARTERLY;
View Full Code Here

  public static synchronized void addFixedIncomeInstrumentConventions(final InMemoryConventionBundleMaster conventionMaster) {
    ArgumentChecker.notNull(conventionMaster, "convention master");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    final BusinessDayConvention modifiedFollowing = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following");
    final DayCount bus252 = DayCountFactory.INSTANCE.getDayCount("Business/252");
    final Frequency annual = PeriodFrequency.ANNUAL;
    final ExternalId br = ExternalSchemes.financialRegionId("BR");

    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);

    for (int i = 1; i < 3; i++) {
      final String dayDepositName = "BRL DEPOSIT " + i + "d";
      final ExternalId dayBbgDeposit = bloombergTickerSecurityId("BCDR" + i + "T Curncy");
      final ExternalId daySimpleDeposit = simpleNameSecurityId(dayDepositName);
      final String weekDepositName = "BRL DEPOSIT " + i + "w";
      final ExternalId weekBbgDeposit = bloombergTickerSecurityId("BCDR" + i + "Z Curncy");
      final ExternalId weekSimpleDeposit = simpleNameSecurityId(weekDepositName);
      utils.addConventionBundle(ExternalIdBundle.of(dayBbgDeposit, daySimpleDeposit), dayDepositName, bus252, following, Period.ofDays(i), 2, false, br);
      utils.addConventionBundle(ExternalIdBundle.of(weekBbgDeposit, weekSimpleDeposit), weekDepositName, bus252, following, Period.ofDays(i * 7), 2, false, br);
    }

    for (int i = 1; i < 12; i++) {
      final String depositName = "BRL DEPOSIT " + i + "m";
      final ExternalId bbgDeposit = bloombergTickerSecurityId("BCDR" + BBG_MONTH_CODES[i - 1] + " Curncy");
      final ExternalId simpleDeposit = simpleNameSecurityId(depositName);
      final String impliedDepositName = "BRL IMPLIED DEPOSIT " + i + "m";
      final ExternalId tullettImpliedDeposit = tullettPrebonSecurityId("LMIDPBRLSPT" + (i < 10 ? "0" : "") + i + "M");
      final ExternalId simpleImpliedDeposit = simpleNameSecurityId(impliedDepositName);
      utils.addConventionBundle(ExternalIdBundle.of(bbgDeposit, simpleDeposit), depositName, bus252, following, Period.ofMonths(i), 2, false, br);
      utils.addConventionBundle(ExternalIdBundle.of(tullettImpliedDeposit, simpleImpliedDeposit), impliedDepositName, bus252, following, Period.ofMonths(i), 2, false, br);
    }

    for (int i = 1; i < 2; i++) {
      final String depositName = "BRL DEPOSIT " + i + "y";
      final ExternalId bbgDeposit = bloombergTickerSecurityId("BCDR" + i + " Curncy");
      final ExternalId simpleDeposit = simpleNameSecurityId(depositName);
      utils.addConventionBundle(ExternalIdBundle.of(bbgDeposit, simpleDeposit), depositName, bus252, following, Period.ofYears(i), 2, false, br);
    }

    final DayCount swapFixedLegDayCount = DayCountFactory.INSTANCE.getDayCount("Bus/252");
    final BusinessDayConvention swapFixedLegBusinessDayConvention = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following");
    final Frequency swapFixedLegPaymentFrequency = PeriodFrequency.ANNUAL;
    final int swapFixedLegSettlementDays = 2;
    final ExternalId swapFixedLegRegion = br;
    final Frequency swapFixedLegCompoundingFrequency = PeriodFrequency.DAILY;
    final InterestRate.Type swapFixedLegCompoundingType = InterestRate.Type.CONTINUOUS;
    final DayCount swapFloatingLegDayCount = DayCountFactory.INSTANCE.getDayCount("Bus/252");
    final BusinessDayConvention swapFloatingLegBusinessDayConvention = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following");
    final Frequency swapFloatingLegPaymentFrequency = PeriodFrequency.ANNUAL;
    final int swapFloatingLegSettlementDays = 2;
    final ExternalId swapFloatingLegInitialRate = bloombergTickerSecurityId("BZDIOVRA Index");
    final ExternalId swapFloatingLegRegion = br;
    final Frequency swapFloatingLegCompoundingFrequency = PeriodFrequency.DAILY;
    final InterestRate.Type swapFloatingLegCompoundingType = InterestRate.Type.CONTINUOUS;
    final boolean isEOM = true;

    utils.addConventionBundle(
        ExternalIdBundle.of(bloombergTickerSecurityId("BZDIOVRA Index"), simpleNameSecurityId("Brazil Cetip Interbank Deposit Rate")),
View Full Code Here

  public static synchronized void addFixedIncomeInstrumentConventions(final InMemoryConventionBundleMaster 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;
View Full Code Here

    Validate.notNull(conventionMaster, "convention master");
    final BusinessDayConvention modified = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    final DayCount act360 = DayCountFactory.INSTANCE.getDayCount("Actual/360");
    final DayCount thirty360 = DayCountFactory.INSTANCE.getDayCount("30/360");
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);

    final ExternalId dk = ExternalSchemes.financialRegionId("DK");

    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);
   
View Full Code Here

    Validate.notNull(conventionMaster, "convention master");
    final BusinessDayConvention modified = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    final DayCount act360 = DayCountFactory.INSTANCE.getDayCount("Actual/360");
    final DayCount thirty360 = DayCountFactory.INSTANCE.getDayCount("30/360");
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);
    final ExternalId ch = ExternalSchemes.financialRegionId("CH");

    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);

    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("CHFLIBORP7D"), simpleNameSecurityId("CHF LIBOR 7d")), "CHF LIBOR 7d",
View Full Code Here

    Validate.notNull(conventionMaster, "convention master");
    final BusinessDayConvention modified = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following");
    final BusinessDayConvention following = BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following");
    final DayCount act360 = DayCountFactory.INSTANCE.getDayCount("Actual/360");
    final DayCount act365 = DayCountFactory.INSTANCE.getDayCount("Actual/365");
    final Frequency annual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.ANNUAL_NAME);
    final Frequency semiAnnual = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.SEMI_ANNUAL_NAME);
    final Frequency quarterly = SimpleFrequencyFactory.INSTANCE.getFrequency(Frequency.QUARTERLY_NAME);
    final ExternalId jp = ExternalSchemes.financialRegionId("JP");

    final ConventionBundleMasterUtils utils = new ConventionBundleMasterUtils(conventionMaster);

    utils.addConventionBundle(ExternalIdBundle.of(syntheticSecurityId("JPYLIBORP7D"), simpleNameSecurityId("JPY LIBOR 1w")), "JPY LIBOR 1w", act360, following, Period.ofDays(7), 2, false, jp);
View Full Code Here

    final double notional = 1.0e7;
    final double spread = spreadBasisPoints/10000.0;
    final double recoveryRate = 0.4;

    final Frequency premiumFrequency = SimpleFrequency.QUARTERLY;
    final Calendar calendar = new MondayToFridayCalendar("TestCalendar");
    final DayCount dayCount = new ActualThreeSixty();
    final BusinessDayConvention businessDays = new FollowingBusinessDayConvention();
    final Convention convention = new Convention(settlementDays, dayCount, businessDays, calendar, "");
    final StubType stubType = StubType.SHORT_START;
View Full Code Here

    final ZonedDateTime startDate = zdt(2008, 3, 20, 0, 0, 0, 0, ZoneOffset.UTC);
    final ZonedDateTime maturity = zdt(2013, 3, 20, 0, 0, 0, 0, ZoneOffset.UTC);
    final int settlementDays = 3;
    final double notional = 10000000, spread = 0.01 /* 100bp */, recoveryRate = 0.4;

    final Frequency couponFrequency = SimpleFrequency.QUARTERLY;
    final Calendar calendar = new MondayToFridayCalendar("TestCalendar");
    final DayCount dayCount = new ActualThreeSixty();
    final BusinessDayConvention businessDays = new FollowingBusinessDayConvention();
    final Convention convention = new Convention(settlementDays, dayCount, businessDays, calendar, "");
    final StubType stubType = StubType.SHORT_START;
View Full Code Here

TOP

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

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.