Package com.opengamma.financial.security.swap

Examples of com.opengamma.financial.security.swap.SwapSecurity


        frequency = SEMI_ANNUAL;
        euribor = EURIBOR_6M;
        frequencyLabel = "6m Euribor";
      }
      final FloatingInterestRateLeg floatingLeg = new FloatingInterestRateLeg(ACT_360, frequency, REGION, MODIFIED_FOLLOWING, notional, false, euribor, FloatingRateType.IBOR);
      final SwapSecurity swap;
      final String name;
      if (RANDOM.nextBoolean()) {
        swap = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, fixedLeg, floatingLeg);
        name = years + "Y EUR " + FORMATTER.format(notional.getAmount() / 1000000) + "MM, pay " + FORMATTER.format(rate * 100) + "% vs " + frequencyLabel;
      } else {
        swap = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, floatingLeg, fixedLeg);
        name = years + "Y EUR " + FORMATTER.format(notional.getAmount() / 1000000) + "MM, receive " + FORMATTER.format(rate * 100) + "% vs " + frequencyLabel;
      }
      swap.setName(name);
      securities[i] = swap;
    }
    return new MySecurityGenerator<>(securities, tradeDate, "Vanilla swaps");
  }
View Full Code Here


        frequency = QUARTERLY;
      } else {
        frequency = SEMI_ANNUAL;
      }
      final FloatingInterestRateLeg floatingLeg = new FloatingInterestRateLeg(ACT_360, frequency, REGION, MODIFIED_FOLLOWING, notional, false, EONIA, FloatingRateType.OIS);
      final SwapSecurity swap;
      final String name;
      if (RANDOM.nextBoolean()) {
        swap = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, fixedLeg, floatingLeg);
        name = years + "Y EUR " + FORMATTER.format(notional.getAmount() / 1000000) + "MM, pay " + FORMATTER.format(rate * 100) + "% vs EONIA";
      } else {
        swap = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, floatingLeg, fixedLeg);
        name = years + "Y EUR " + FORMATTER.format(notional.getAmount() / 1000000) + "MM, receive " + FORMATTER.format(rate * 100) + "% vs EONIA";
      }
      swap.setName(name);
      securities[i] = swap;
    }
    return new MySecurityGenerator<>(securities, tradeDate, "OIS swaps");
  }
View Full Code Here

        receiveRate = EURIBOR_3M;
        payLeg = new FloatingInterestRateLeg(ACT_360, payFrequency, REGION, MODIFIED_FOLLOWING, notional, false, payRate, FloatingRateType.IBOR);
        receiveLeg = new FloatingSpreadIRLeg(ACT_360, receiveFrequency, REGION, MODIFIED_FOLLOWING, notional, false, receiveRate, FloatingRateType.IBOR, spread);
        frequencyLabel = "receive 3M Euribor + " + FORMATTER.format((int) (spread * 1000)) + "bp, pay 6M Euribor";
      }
      final SwapSecurity swap = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, payLeg, receiveLeg);
      final String name = years + "Y EUR " + FORMATTER.format(notional.getAmount() / 1000000) + "MM, " + frequencyLabel;
      swap.setName(name);
      securities[i] = swap;
    }
    return new MySecurityGenerator<>(securities, tradeDate, "Basis swaps");
  }
View Full Code Here

        PortfolioLoaderHelper.NOTIONAL_FORMATTER.format(capFloorSec.getNotional()), capFloorSec.isPayer() ? " Short" : " Long");
  }

  private List<FinancialSecurity> getIborSwaps() {
    final List<FinancialSecurity> securities = new ArrayList<FinancialSecurity>();
    final SwapSecurity swap1 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 40, 5, 1, 11, 0), ZoneOffset.UTC),
        "Cpty",
        new FixedInterestRateLeg(DAY_COUNT,
            SimpleFrequency.SEMI_ANNUAL,
            ExternalSchemes.countryRegionId(Country.of("US")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.USD, 15000000),
            true,
            0.05),
        new FloatingInterestRateLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("US")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.USD, 15000000),
            true,
            USDLIBOR3M,
            FloatingRateType.IBOR));
    swap1.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap1.setName("Swap: pay 5% fixed vs 3m Libor, start=" + swap1.getEffectiveDate().toLocalDate() + ", maturity=" + swap1.getMaturityDate().toLocalDate() + ", notional=USD 15MM");
    final SwapSecurity swap2 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 30, 5, 1, 11, 0), ZoneOffset.UTC),
        "Cpty",
        new FixedInterestRateLeg(DAY_COUNT,
            SimpleFrequency.SEMI_ANNUAL,
            ExternalSchemes.countryRegionId(Country.of("DE")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.EUR, 20000000),
            true,
            0.04),
        new FloatingInterestRateLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("DE")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.EUR, 20000000),
            true,
            ExternalId.of(ExternalSchemes.OG_SYNTHETIC_TICKER, "USDLIBORP6M"),
            FloatingRateType.IBOR));
    swap2.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap2.setName("Swap: pay 4% fixed vs 6m Euribor, start=" + swap2.getEffectiveDate().toLocalDate() + ", maturity=" + swap2.getMaturityDate().toLocalDate() + ", notional=EUR 20MM");
    final SwapSecurity swap3 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 13, 5, 1, 11, 0), ZoneOffset.UTC),
        "Cpty",
        new FixedInterestRateLeg(DAY_COUNT,
            SimpleFrequency.SEMI_ANNUAL,
            ExternalSchemes.countryRegionId(Country.of("GB")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.GBP, 15000000),
            true,
            0.03),
        new FloatingInterestRateLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("GB")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.GBP, 15000000),
            true,
            ExternalId.of(ExternalSchemes.OG_SYNTHETIC_TICKER, "GBPLIBORP6M"),
            FloatingRateType.IBOR));
    swap3.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap3.setName("Swap: pay 3% fixed vs 6m Libor, start=" + swap3.getEffectiveDate().toLocalDate() + ", maturity=" + swap3.getMaturityDate().toLocalDate() + ", notional=GBP 15MM");
    final SwapSecurity swap4 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 25, 5, 1, 11, 0), ZoneOffset.UTC),
        "Cpty",
        new FixedInterestRateLeg(DAY_COUNT,
            SimpleFrequency.SEMI_ANNUAL,
            ExternalSchemes.countryRegionId(Country.of("JP")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.JPY, 100000000),
            true,
            0.02),
        new FloatingInterestRateLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("JP")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.JPY, 100000000),
            true,
            ExternalId.of(ExternalSchemes.OG_SYNTHETIC_TICKER, "JPYLIBORP6M"),
            FloatingRateType.IBOR));
    swap4.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap4.setName("Swap: pay 2% fixed vs 6m Libor, start=" + swap4.getEffectiveDate().toLocalDate() + ", maturity=" + swap4.getMaturityDate().toLocalDate() + ", notional=JPY 100MM");
    final SwapSecurity swap5 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 40, 5, 1, 11, 0), ZoneOffset.UTC),
        "Cpty",
        new FixedInterestRateLeg(DAY_COUNT,
            SimpleFrequency.SEMI_ANNUAL,
            ExternalSchemes.countryRegionId(Country.of("CH")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.CHF, 5000000),
            true,
            0.07),
        new FloatingInterestRateLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("CH")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.CHF, 5000000),
            true,
            ExternalId.of(ExternalSchemes.OG_SYNTHETIC_TICKER, "CHFLIBORP6M"),
            FloatingRateType.IBOR));
    swap5.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap5.setName("Swap: pay 7% fixed vs 6m Libor, start=" + swap5.getEffectiveDate().toLocalDate() + ", maturity=" + swap5.getMaturityDate().toLocalDate() + ", notional=CHF 50MM");

    final SwapSecurity swap6 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 1, 5, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(TODAY.getYear() + 20, 5, 1, 11, 0), ZoneOffset.UTC),
        "Cpty",
        new FixedInterestRateLeg(DAY_COUNT,
            SimpleFrequency.SEMI_ANNUAL,
            ExternalSchemes.countryRegionId(Country.of("DK")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.DKK, 90000000),
            true,
            0.05),
        new FloatingInterestRateLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("DK")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.DKK, 90000000),
            true,
            ExternalId.of(ExternalSchemes.OG_SYNTHETIC_TICKER, "DKKLIBORP6M"),
            FloatingRateType.IBOR));
    swap6.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap6.setName("Swap: pay 5% fixed vs 6m Cibor, start=" + swap6.getEffectiveDate().toLocalDate() + ", maturity=" + swap6.getMaturityDate().toLocalDate() + ", notional=DKK 90MM");
    securities.add(swap1);
    securities.add(swap2);
    securities.add(swap3);
    securities.add(swap4);
    securities.add(swap5);
View Full Code Here

  }

  private Collection<FinancialSecurity> getCMSwaps() {
    final List<FinancialSecurity> securities = new ArrayList<FinancialSecurity>();
    final int year = TODAY.getYear();
    final SwapSecurity swap1 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(year + 1, 12, 20, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 1, 12, 20, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 5, 12, 20, 11, 0), ZoneOffset.UTC),
        "Cpty",
        new FixedInterestRateLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("US")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.USD, 21000000),
            true,
            0.035),
        new FloatingInterestRateLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("US")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.USD, 21000000),
            true,
            ExternalId.of(ExternalSchemes.OG_SYNTHETIC_TICKER, "USDISDA10P10Y"),
            FloatingRateType.CMS));
    swap1.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap1.setName("CMSwap: pay 5Y fixed @ 3.5% vs USDISDA10P10Y, start=" + swap1.getEffectiveDate().toLocalDate() + ", maturity=" + swap1.getMaturityDate().toLocalDate() + ", notional=USD 21MM");
    final SwapSecurity swap2 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(year + 1, 4, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 1, 4, 1, 11, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 7, 4, 1, 11, 0), ZoneOffset.UTC),
        "Cpty",
        new FloatingInterestRateLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("US")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.USD, 123000000),
            true,
            ExternalId.of(ExternalSchemes.OG_SYNTHETIC_TICKER, "USDISDA10P1Y"),
            FloatingRateType.CMS),
        new FloatingSpreadIRLeg(DAY_COUNT,
            SimpleFrequency.QUARTERLY,
            ExternalSchemes.countryRegionId(Country.of("US")),
            BUSINESS_DAY,
            new InterestRateNotional(Currency.USD, 123000000),
            true,
            USDLIBOR3M,
            FloatingRateType.IBOR, 0.005));
    swap2.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap2.setName("CMSwap: pay USDISDA10P1Y vs 3m Libor, start=" + swap2.getEffectiveDate().toLocalDate() + ", maturity=" + swap2.getMaturityDate().toLocalDate() + ", notional=USD 123MM");
    securities.add(swap1);
    securities.add(swap2);
    return securities;
  }
View Full Code Here

  private Collection<FinancialSecurity> getSwaptions() {
    final List<FinancialSecurity> securities = new ArrayList<FinancialSecurity>();
    final int year = TODAY.getYear();
    final EuropeanExerciseType europeanExerciseType = new EuropeanExerciseType();
    final SwapSecurity swap1 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(year + 1, 6, 1, 1, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 1, 6, 1, 1, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 11, 6, 1, 1, 0), ZoneOffset.UTC),
        "Cpty",
        new FloatingInterestRateLeg(DAY_COUNT, SimpleFrequency.QUARTERLY,
            ExternalSchemes.financialRegionId("US+GB"),
            BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following"),
            new InterestRateNotional(Currency.USD, 1.0E7),
            false,
            USDLIBOR3M,
            FloatingRateType.IBOR),
        new FixedInterestRateLeg(DayCountFactory.INSTANCE.getDayCount("30U/360"),
            SimpleFrequency.SEMI_ANNUAL,
            ExternalSchemes.financialRegionId("US+GB"),
            BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following"),
            new InterestRateNotional(Currency.USD, 1.0E7),
            false,
            0.04));
    swap1.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap1.setName("Swap: pay 3m Libor vs 4% fixed, start=" + swap1.getEffectiveDate().toLocalDate() + ", maturity=" + swap1.getMaturityDate().toLocalDate() + ", notional=USD 10MM");
    storeFinancialSecurity(swap1);
    final SwaptionSecurity swaption1 = new SwaptionSecurity(false, swap1.getExternalIdBundle().getExternalId(ExternalScheme.of(ID_SCHEME)),
        true, new Expiry(ZonedDateTime.of(LocalDateTime.of(year + 1, 6, 1, 1, 0), ZoneOffset.UTC)),
        true, Currency.USD, null, europeanExerciseType, null);
    swaption1.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swaption1.setName("Vanilla swaption, 1Y x 10Y, USD 10,000,000 @ 4%");
    securities.add(swaption1);

    final SwapSecurity swap2 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(year + 2, 6, 1, 1, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 2, 6, 1, 1, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 4, 6, 1, 1, 0), ZoneOffset.UTC),
        "Cpty",
        new FloatingInterestRateLeg(DAY_COUNT, SimpleFrequency.QUARTERLY,
            ExternalSchemes.financialRegionId("US+GB"),
            BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following"),
            new InterestRateNotional(Currency.USD, 3000000.0),
            false,
            USDLIBOR3M,
            FloatingRateType.IBOR),
        new FixedInterestRateLeg(DayCountFactory.INSTANCE.getDayCount("30U/360"),
            SimpleFrequency.SEMI_ANNUAL,
            ExternalSchemes.financialRegionId("US+GB"),
            BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following"),
            new InterestRateNotional(Currency.USD, 3000000.0),
            false,
            0.01));
    swap2.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap2.setName("Swap: pay 3m Libor vs 1% fixed, start=" + swap2.getEffectiveDate().toLocalDate() + ", maturity=" + swap2.getMaturityDate().toLocalDate() + ", notional=USD 3MM");
    storeFinancialSecurity(swap2);
    final SwaptionSecurity swaption2 = new SwaptionSecurity(false, swap2.getExternalIdBundle().getExternalId(ExternalScheme.of(ID_SCHEME)),
        false, new Expiry(ZonedDateTime.of(LocalDateTime.of(year + 2, 6, 1, 1, 0), ZoneOffset.UTC)),
        true, Currency.USD, null, europeanExerciseType, null);
    swaption2.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swaption2.setName("Vanilla swaption, 2Y x 2Y, USD 3,000,000 @ 1%");
    securities.add(swaption2);

    final SwapSecurity swap3 = new SwapSecurity(
        ZonedDateTime.of(LocalDateTime.of(year + 5, 6, 1, 1, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 5, 6, 1, 1, 0), ZoneOffset.UTC),
        ZonedDateTime.of(LocalDateTime.of(year + 20, 6, 1, 1, 0), ZoneOffset.UTC),
        "Cpty",
        new FloatingInterestRateLeg(DAY_COUNT, SimpleFrequency.QUARTERLY,
            ExternalSchemes.financialRegionId("US+GB"),
            BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following"),
            new InterestRateNotional(Currency.USD, 6000000.0),
            false,
            USDLIBOR3M,
            FloatingRateType.IBOR),
        new FixedInterestRateLeg(DayCountFactory.INSTANCE.getDayCount("30U/360"),
            SimpleFrequency.SEMI_ANNUAL,
            ExternalSchemes.financialRegionId("US+GB"),
            BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Modified Following"),
            new InterestRateNotional(Currency.USD, 6000000.0),
            false,
            0.035));
    swap3.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swap3.setName("Swap: pay 3m Libor vs 3.5% fixed, start=" + swap3.getEffectiveDate().toLocalDate() + ", maturity=" + swap3.getMaturityDate().toLocalDate() + ", notional=USD 6MM");
    storeFinancialSecurity(swap3);
    final SwaptionSecurity swaption3 = new SwaptionSecurity(false, swap3.getExternalIdBundle().getExternalId(ExternalScheme.of(ID_SCHEME)),
        false, new Expiry(ZonedDateTime.of(LocalDateTime.of(year + 5, 6, 1, 1, 0), ZoneOffset.UTC)),
        true, Currency.USD, null, europeanExerciseType, null);
    swaption3.addExternalId(ExternalId.of(ID_SCHEME, GUIDGenerator.generate().toString()));
    swaption3.setName("Vanilla swaption, 5Y x 15Y, USD 6,000,000 @ 3.5%");
    securities.add(swaption3);
View Full Code Here

      @Override
      public SwapSecurity createSecurity() {
        if (_count > 3) {
          throw new IllegalStateException("Should not ask for more than 4 securities");
        }
        final SwapSecurity swap = SWAPS[_count++];
        return swap;
      }

    };
    configure(securities);
View Full Code Here

    final ZonedDateTime effectiveDate = tradeDate;
    final ZonedDateTime maturity = DateUtils.getUTCDate(2024, 9, 5);
    final InterestRateNotional notional = new InterestRateNotional(CURRENCY, 10000000);
    final FloatingInterestRateLeg receiveLeg1 = new FloatingInterestRateLeg(ACT_360, QUARTERLY, REGION, MODIFIED_FOLLOWING, notional, true, LIBOR_3M, FloatingRateType.IBOR);
    final FixedInterestRateLeg payLeg1 = new FixedInterestRateLeg(THIRTYU_360, SEMI_ANNUAL, REGION, MODIFIED_FOLLOWING, notional, true, 0.02);
    final SwapSecurity swap1 = new SwapSecurity(tradeDate, effectiveDate, maturity, COUNTERPARTY, payLeg1, receiveLeg1);
    swap1.setName("Pay Fixed @ 2% v USD 3m Libor");
    final SwapSecurity swap2 = new SwapSecurity(tradeDate, effectiveDate, maturity, COUNTERPARTY, receiveLeg1, payLeg1);
    swap2.setName("Receive Fixed @ 2% v USD 3m Libor");
    final SwapSecurity[] swapParity = new SwapSecurity[] {swap1, swap2};
    final ZonedDateTime[] tradeDates = new ZonedDateTime[] {tradeDate, tradeDate};
    return new MySecurityGenerator<>(swapParity, tradeDates, "Swap payer / receiver parity");
  }
View Full Code Here

    final ZonedDateTime maturityDate = effectiveDate.plusYears(10);
    final Expiry expiry = new Expiry(effectiveDate.minusDays(2));
    final InterestRateNotional notional = new InterestRateNotional(CURRENCY, 10000000);
    final FloatingInterestRateLeg payLeg = new FloatingInterestRateLeg(ACT_360, QUARTERLY, REGION, MODIFIED_FOLLOWING, notional, true, LIBOR_3M, FloatingRateType.IBOR);
    final FixedInterestRateLeg receiveLeg = new FixedInterestRateLeg(THIRTYU_360, SEMI_ANNUAL, REGION, MODIFIED_FOLLOWING, notional, true, 0.02);
    final SwapSecurity underlyingSwap = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, payLeg, receiveLeg);
    underlyingSwap.setName("Receive fixed @ 2% v USD 3m Libor");
    final SecurityDocument toAddDoc = new SecurityDocument();
    toAddDoc.setSecurity(underlyingSwap);
    securityMaster.add(toAddDoc);
    final ZonedDateTime[] tradeDates = new ZonedDateTime[] {tradeDate, tradeDate};
    final ExternalId underlyingId = getSecurityPersister().storeSecurity(underlyingSwap).iterator().next();
View Full Code Here

    final Expiry expiry = new Expiry(effectiveDate.minusDays(2));
    final InterestRateNotional notional = new InterestRateNotional(CURRENCY, 10000000);
    final FloatingInterestRateLeg payLeg = new FloatingInterestRateLeg(ACT_360, QUARTERLY, REGION, MODIFIED_FOLLOWING, notional, true, LIBOR_3M, FloatingRateType.IBOR);
    final FixedInterestRateLeg receiveLeg1 = new FixedInterestRateLeg(ACT_360, SEMI_ANNUAL, REGION, MODIFIED_FOLLOWING, notional, true, 0.018);
    final FixedInterestRateLeg receiveLeg2 = new FixedInterestRateLeg(ACT_365, SEMI_ANNUAL, REGION, MODIFIED_FOLLOWING, notional, true, 0.01825);
    final SwapSecurity underlyingSwap1 = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, payLeg, receiveLeg1);
    underlyingSwap1.setName("Receive fixed @ 1.8% v USD 3m Libor");
    final SwapSecurity underlyingSwap2 = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, payLeg, receiveLeg2);
    underlyingSwap2.setName("Receive fixed @ 1.825% v USD 3m Libor");
    SecurityDocument toAddDoc = new SecurityDocument();
    toAddDoc.setSecurity(underlyingSwap1);
    securityMaster.add(toAddDoc);
    toAddDoc = new SecurityDocument();
    toAddDoc.setSecurity(underlyingSwap2);
View Full Code Here

TOP

Related Classes of com.opengamma.financial.security.swap.SwapSecurity

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.