예제 #1
0
        public virtual void test_bbsw6m()
        {
            IborIndex test = IborIndex.of("AUD-BBSW-6M");

            assertEquals(test.Currency, AUD);
            assertEquals(test.Name, "AUD-BBSW-6M");
            assertEquals(test.Tenor, TENOR_6M);
            assertEquals(test.FixingCalendar, AUSY);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofBusinessDays(-1, AUSY));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofBusinessDays(1, AUSY));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.of(TENOR_6M, PeriodAdditionConventions.NONE, BusinessDayAdjustment.of(MODIFIED_FOLLOWING_BI_MONTHLY, AUSY)));
            assertEquals(test.DayCount, ACT_365F);
            assertEquals(test.ToString(), "AUD-BBSW-6M");
        }
예제 #2
0
        public virtual void test_zar_jibar()
        {
            IborIndex test = IborIndex.of("ZAR-JIBAR-3M");

            assertEquals(test.Currency, ZAR);
            assertEquals(test.Name, "ZAR-JIBAR-3M");
            assertEquals(test.Tenor, TENOR_3M);
            assertEquals(test.FixingCalendar, ZAJO);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofCalendarDays(0, BusinessDayAdjustment.of(PRECEDING, ZAJO)));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofCalendarDays(0, BusinessDayAdjustment.of(FOLLOWING, ZAJO)));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.of(TENOR_3M, PeriodAdditionConventions.NONE, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, ZAJO)));
            assertEquals(test.DayCount, ACT_365F);
            assertEquals(test.DefaultFixedLegDayCount, ACT_365F);
            assertEquals(test.ToString(), "ZAR-JIBAR-3M");
        }
예제 #3
0
        public virtual void test_sek_stibor()
        {
            IborIndex test = IborIndex.of("SEK-STIBOR-3M");

            assertEquals(test.Currency, SEK);
            assertEquals(test.Name, "SEK-STIBOR-3M");
            assertEquals(test.Tenor, TENOR_3M);
            assertEquals(test.FixingCalendar, SEST);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofBusinessDays(-2, SEST));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofBusinessDays(2, SEST));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.of(TENOR_3M, PeriodAdditionConventions.NONE, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, SEST)));
            assertEquals(test.DayCount, ACT_360);
            assertEquals(test.DefaultFixedLegDayCount, THIRTY_U_360);
            assertEquals(test.ToString(), "SEK-STIBOR-3M");
        }
예제 #4
0
        public virtual void test_pln_wibor()
        {
            IborIndex test = IborIndex.of("PLN-WIBOR-3M");

            assertEquals(test.Currency, PLN);
            assertEquals(test.Name, "PLN-WIBOR-3M");
            assertEquals(test.Tenor, TENOR_3M);
            assertEquals(test.FixingCalendar, PLWA);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofBusinessDays(-2, PLWA));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofBusinessDays(2, PLWA));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.of(TENOR_3M, PeriodAdditionConventions.NONE, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, PLWA)));
            assertEquals(test.DayCount, ACT_365F);
            assertEquals(test.DefaultFixedLegDayCount, ACT_ACT_ISDA);
            assertEquals(test.ToString(), "PLN-WIBOR-3M");
        }
예제 #5
0
        public virtual void test_mxn_tiie()
        {
            IborIndex test = IborIndex.of("MXN-TIIE-4W");

            assertEquals(test.Currency, MXN);
            assertEquals(test.Name, "MXN-TIIE-4W");
            assertEquals(test.Tenor, TENOR_4W);
            assertEquals(test.FixingCalendar, MXMC);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofBusinessDays(-1, MXMC));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofBusinessDays(1, MXMC));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.of(TENOR_4W, PeriodAdditionConventions.NONE, BusinessDayAdjustment.of(FOLLOWING, MXMC)));
            assertEquals(test.DayCount, ACT_360);
            assertEquals(test.DefaultFixedLegDayCount, ACT_360);
            assertEquals(test.ToString(), "MXN-TIIE-4W");
        }
예제 #6
0
        public virtual void test_sgd_sibor()
        {
            HolidayCalendarId SGSI = HolidayCalendarId.of("SGSI");
            IborIndex         test = IborIndex.of("SGD-SIBOR-3M");

            assertEquals(test.Currency, SGD);
            assertEquals(test.Name, "SGD-SIBOR-3M");
            assertEquals(test.Tenor, TENOR_3M);
            assertEquals(test.FixingCalendar, SGSI);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofBusinessDays(-2, SGSI));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofBusinessDays(2, SGSI));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.of(TENOR_3M, PeriodAdditionConventions.NONE, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, SGSI)));
            assertEquals(test.DayCount, ACT_365F);
            assertEquals(test.DefaultFixedLegDayCount, ACT_365F);
            assertEquals(test.ToString(), "SGD-SIBOR-3M");
        }
예제 #7
0
        public virtual void test_tibor_euroyen3m()
        {
            IborIndex test = IborIndex.of("JPY-TIBOR-EUROYEN-3M");

            assertEquals(test.Currency, JPY);
            assertEquals(test.Name, "JPY-TIBOR-EUROYEN-3M");
            assertEquals(test.Tenor, TENOR_3M);
            assertEquals(test.FixingCalendar, JPTO);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofBusinessDays(-2, JPTO));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofBusinessDays(2, JPTO));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, JPTO)));
            assertEquals(test.DayCount, ACT_360);
            assertEquals(test.DefaultFixedLegDayCount, ACT_365F);
            assertEquals(test.FloatingRateName, FloatingRateName.of("JPY-TIBOR-EUROYEN"));
            assertEquals(test.ToString(), "JPY-TIBOR-EUROYEN-3M");
        }
예제 #8
0
        public virtual void test_euribor3m()
        {
            IborIndex test = IborIndex.of("EUR-EURIBOR-3M");

            assertEquals(test.Currency, EUR);
            assertEquals(test.Name, "EUR-EURIBOR-3M");
            assertEquals(test.Tenor, TENOR_3M);
            assertEquals(test.FixingCalendar, EUTA);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofBusinessDays(-2, EUTA));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofBusinessDays(2, EUTA));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA)));
            assertEquals(test.DayCount, ACT_360);
            assertEquals(test.DefaultFixedLegDayCount, THIRTY_U_360);
            assertEquals(test.FloatingRateName, FloatingRateName.of("EUR-EURIBOR"));
            assertEquals(test.ToString(), "EUR-EURIBOR-3M");
        }
예제 #9
0
        //-------------------------------------------------------------------------
        public virtual void test_usdLibor3m()
        {
            IborIndex test = IborIndex.of("USD-LIBOR-3M");

            assertEquals(test.Currency, USD);
            assertEquals(test.Name, "USD-LIBOR-3M");
            assertEquals(test.Tenor, TENOR_3M);
            assertEquals(test.FixingCalendar, GBLO);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofBusinessDays(-2, GBLO));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofBusinessDays(2, GBLO, BusinessDayAdjustment.of(FOLLOWING, GBLO.combinedWith(USNY))));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO.combinedWith(USNY))));
            assertEquals(test.DayCount, ACT_360);
            assertEquals(test.DefaultFixedLegDayCount, ACT_360);
            assertEquals(test.FloatingRateName, FloatingRateName.of("USD-LIBOR"));
            assertEquals(test.ToString(), "USD-LIBOR-3M");
        }
예제 #10
0
        private static readonly HolidayCalendarId NZBD = HolidayCalendarId.of("NZBD");   // no constant for this

        public virtual void test_gbpLibor3m()
        {
            IborIndex test = IborIndex.of("GBP-LIBOR-3M");

            assertEquals(test.Name, "GBP-LIBOR-3M");
            assertEquals(test.Currency, GBP);
            assertEquals(test.Active, true);
            assertEquals(test.Tenor, TENOR_3M);
            assertEquals(test.FixingCalendar, GBLO);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofCalendarDays(0, BusinessDayAdjustment.of(PRECEDING, GBLO)));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofCalendarDays(0, BusinessDayAdjustment.of(FOLLOWING, GBLO)));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO)));
            assertEquals(test.DayCount, ACT_365F);
            assertEquals(test.DefaultFixedLegDayCount, ACT_365F);
            assertEquals(test.FloatingRateName, FloatingRateName.of("GBP-LIBOR"));
            assertEquals(test.ToString(), "GBP-LIBOR-3M");
        }
예제 #11
0
        public virtual void test_krw_cd()
        {
            HolidayCalendarId KRSE = HolidayCalendarId.of("KRSE");
            IborIndex         test = IborIndex.of("KRW-CD-13W");

            assertEquals(test.Currency, KRW);
            assertEquals(test.Name, "KRW-CD-13W");
            assertEquals(test.Tenor, TENOR_13W);
            assertEquals(test.FixingCalendar, KRSE);
            assertEquals(test.FixingDateOffset, DaysAdjustment.ofBusinessDays(-1, KRSE));
            assertEquals(test.EffectiveDateOffset, DaysAdjustment.ofBusinessDays(1, KRSE));
            assertEquals(test.MaturityDateOffset, TenorAdjustment.of(TENOR_13W, PeriodAdditionConventions.NONE, BusinessDayAdjustment.of(FOLLOWING, KRSE)));
            assertEquals(test.DayCount, ACT_365F);
            assertEquals(test.DefaultFixedLegDayCount, ACT_365F);
            assertEquals(test.ToString(), "KRW-CD-13W");

            IborIndex test2 = IborIndex.of("KRW-CD-3M");

            assertEquals(test2.Name, "KRW-CD-13W");
        }
예제 #12
0
        public virtual void test_serialization()
        {
            IborIndex index = ImmutableIborIndex.builder().name("Test-3M").currency(Currency.GBP).fixingCalendar(GBLO).fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, GBLO)).effectiveDateOffset(DaysAdjustment.ofBusinessDays(2, GBLO)).maturityDateOffset(TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.NONE)).dayCount(ACT_360).fixingTime(LocalTime.NOON).fixingZone(ZoneId.of("Europe/London")).build();

            assertSerialization(index);
        }
예제 #13
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ImmutableIborIndex index = ImmutableIborIndex.builder().name("Test-3M").currency(Currency.GBP).fixingCalendar(GBLO).fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, GBLO)).effectiveDateOffset(DaysAdjustment.ofBusinessDays(2, GBLO)).maturityDateOffset(TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.NONE)).dayCount(ACT_360).fixingTime(LocalTime.NOON).fixingZone(ZoneId.of("Europe/London")).build();

            coverImmutableBean(index);
            coverPrivateConstructor(typeof(IborIndices));
        }
예제 #14
0
        //-------------------------------------------------------------------------
        public virtual void test_equals()
        {
            ImmutableIborIndex a = ImmutableIborIndex.builder().name("Test-3M").currency(Currency.GBP).fixingCalendar(GBLO).fixingDateOffset(DaysAdjustment.ofBusinessDays(-2, GBLO)).effectiveDateOffset(DaysAdjustment.ofBusinessDays(2, GBLO)).maturityDateOffset(TenorAdjustment.ofLastBusinessDay(TENOR_3M, BusinessDayAdjustment.NONE)).dayCount(ACT_360).fixingTime(LocalTime.NOON).fixingZone(ZoneId.of("Europe/London")).build();
            IborIndex          b = a.toBuilder().name("Rubbish-3M").build();

            assertEquals(a.Equals(b), false);
        }
예제 #15
0
        public virtual void test_builder_NZD()
        {
            ImmutableIborIndex dummyIndex = ImmutableIborIndex.builder().name("NZD-INDEX-3M").currency(NZD).dayCount(ACT_360).fixingDateOffset(MINUS_TWO_DAYS).effectiveDateOffset(PLUS_TWO_DAYS).maturityDateOffset(TenorAdjustment.ofLastDay(TENOR_3M, BDA_MOD_FOLLOW)).fixingCalendar(SAT_SUN).fixingTime(LocalTime.NOON).fixingZone(ZoneId.of("NZ")).build();
            Fra test = Fra.builder().buySell(BUY).notional(NOTIONAL_1M).startDate(date(2015, 6, 15)).endDate(date(2015, 9, 15)).paymentDate(AdjustableDate.of(date(2015, 6, 16))).fixedRate(FIXED_RATE).index(dummyIndex).fixingDateOffset(MINUS_TWO_DAYS).build();

            assertEquals(test.BuySell, BUY);
            assertEquals(test.Currency, NZD);     // defaulted
            assertEquals(test.Notional, NOTIONAL_1M, 0d);
            assertEquals(test.StartDate, date(2015, 6, 15));
            assertEquals(test.EndDate, date(2015, 9, 15));
            assertEquals(test.BusinessDayAdjustment, null);
            assertEquals(test.PaymentDate, AdjustableDate.of(date(2015, 6, 16)));
            assertEquals(test.FixedRate, FIXED_RATE, 0d);
            assertEquals(test.Index, dummyIndex);
            assertEquals(test.IndexInterpolated, null);
            assertEquals(test.FixingDateOffset, MINUS_TWO_DAYS);
            assertEquals(test.DayCount, ACT_360);     // defaulted
            assertEquals(test.Discounting, AFMA);     // defaulted
        }