Package com.opengamma.financial.security.swap

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


        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);
View Full Code Here


  private MySecurityGenerator<ManageableSecurity> getSwapParityGenerator() {
    final ZonedDateTime tradeDate = DateUtils.previousWeekDay().atStartOfDay(ZoneOffset.UTC);
    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);
View Full Code Here

  private MySecurityGenerator<ManageableSecurity> getSwaptionLongShortGenerator(final SecurityMaster securityMaster) {
    final ZonedDateTime tradeDate = DateUtils.previousWeekDay().atStartOfDay(ZoneOffset.UTC);
    final ZonedDateTime effectiveDate = tradeDate.plusYears(1);
    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();
View Full Code Here

  private MySecurityGenerator<ManageableSecurity> getSwaptionConventionGenerator(final SecurityMaster securityMaster) {
    final ZonedDateTime tradeDate = DateUtils.previousWeekDay().atStartOfDay(ZoneOffset.UTC);
    final ZonedDateTime effectiveDate = tradeDate.plusYears(1);
    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 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");
View Full Code Here

  private MySecurityGenerator<ManageableSecurity> getSwaptionParityGenerator(final SecurityMaster securityMaster) {
    final ZonedDateTime tradeDate = DateUtils.previousWeekDay().atStartOfDay(ZoneOffset.UTC);
    final ZonedDateTime effectiveDate = tradeDate.plusYears(1);
    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 underlyingSwap1 = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, payLeg, receiveLeg);
    underlyingSwap1.setName("Receive fixed @ 2% v USD 3m Libor");
    final SwapSecurity underlyingSwap2 = new SwapSecurity(tradeDate, effectiveDate, maturityDate, COUNTERPARTY, receiveLeg, payLeg);
View Full Code Here

                                                                    ExternalId.of("EXTERNAL_CODE" ,"ProtSeller"), ExternalSchemes.markItRedCode("39FF64"),
                                                                    DebtSeniority.SNRFOR, RestructuringClause.MM, ExternalSchemes.financialRegionId("US"),
                                                                    createZdt(2013, 3, 20), createZdt(2013, 3, 21), createZdt(2014,3,20), StubType.SHORT_START,
                                                                    SimpleFrequency.SEMI_ANNUAL, DayCountFactory.INSTANCE.getDayCount("Actual/360"),
                                                                    BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following"),
                                                                    true, true, true, new InterestRateNotional(Currency.USD, 10000000), true, true, 500,
                                                                    new InterestRateNotional(Currency.USD, 500000), 500, createZdt(2013,3,21), true);
    ExternalId secId = ExternalId.of("SEC_ID", "12345");
    cds.addExternalId(secId);
    document.setSecurity(cds);
    _securityMaster.add(document);
View Full Code Here

  private SecuritySource createSecuritySource() {
    final InMemorySecuritySource securities = new InMemorySecuritySource();
    final ZonedDateTime zdt = ZonedDateTime.now();
    final SwapLeg leg = new FixedInterestRateLeg(DayCountFactory.INSTANCE.getDayCount("ACT/365"), SimpleFrequency.ANNUAL, ExternalId.of("Test", "Region"),
        BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following"), new InterestRateNotional(Currency.USD, 0d), false, 0d);
    final SwapSecurity security = new SwapSecurity(zdt, zdt, zdt, "Counterparty", leg, leg);
    security.addExternalId(ExternalId.of("Security", "Swap"));
    securities.addSecurity(security);
    return securities;
  }
View Full Code Here

    _fooEquity.setName("Foo");
    _barEquity = new EquitySecurity("exchange", "exchangeCode", "Bar", Currency.USD);
    _barEquity.addExternalId(ExternalId.of("Test", "BarEquity"));
    _barEquity.setName("Bar");
    final SwapLeg swapLeg = new FixedInterestRateLeg(DayCountFactory.INSTANCE.getDayCount("ACT/365"), SimpleFrequency.SEMI_ANNUAL,
        ExternalId.of("Financial", "US"), BusinessDayConventionFactory.INSTANCE.getBusinessDayConvention("Following"), new InterestRateNotional(Currency.USD, 10e6), false, 0.01);
    _swap = new SwapSecurity(ZonedDateTime.now(), ZonedDateTime.now(), ZonedDateTime.now(), "counterParty", swapLeg, swapLeg);
    _swap.addExternalId(ExternalId.of("Test", "Swap"));
  }
View Full Code Here

    return Pair.of(new FixedInterestRateLeg(dayCount,
                                            PeriodFrequency.of(paymentPeriod),
                                            convention.getRegionCalendar(),
                                            businessDayConvention,
                                            new InterestRateNotional(currency, _amount),
                                            eomLeg,
                                            _rate),
                   Triple.of(startDate, spotDateLeg, _valuationTime.plus(maturityTenor)));
  }
View Full Code Here

      //return AnnuityCouponIborSpreadDefinition.from(startDate, maturityTenor, 1, iborIndex, spread, isPayer, calendar);
      return Pair.of(new FloatingSpreadIRLeg(dayCount,
                                             PeriodFrequency.of(convention.getResetTenor().getPeriod()),
                                             indexConvention.getRegionCalendar(),
                                             businessDayConvention,
                                             new InterestRateNotional(currency, _amount),
                                             eomLeg,
                                             floatingReferenceRateId,
                                             FloatingRateType.IBOR,
                                             _rate),
                     Triple.of(startDate, spotDateLeg, _valuationTime.plus(maturityTenor)));
    }
    //return AnnuityCouponIborDefinition.from(startDate, maturityTenor, 1, iborIndex, isPayer, calendar);
    return Pair.of(new FloatingInterestRateLeg(dayCount,
                                               PeriodFrequency.of(maturityTenor),
                                               indexConvention.getRegionCalendar(),
                                               businessDayConvention,
                                               new InterestRateNotional(currency, _amount),
                                               eomLeg,
                                               floatingReferenceRateId, FloatingRateType.IBOR),
                   Triple.of(startDate, spotDateLeg, _valuationTime.plus(maturityTenor)));

  }
View Full Code Here

TOP

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

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.