Exemple #1
0
        public virtual void test_summarize_irs_weird()
        {
            PeriodicSchedule       accrual  = PeriodicSchedule.of(date(2018, 2, 12), date(2020, 2, 12), Frequency.P3M, BusinessDayAdjustment.NONE, SHORT_INITIAL, false);
            PaymentSchedule        payment  = PaymentSchedule.builder().paymentFrequency(Frequency.P3M).paymentDateOffset(DaysAdjustment.NONE).build();
            NotionalSchedule       notional = NotionalSchedule.of(GBP, ValueSchedule.builder().initialValue(1_000_000).stepSequence(ValueStepSequence.of(date(2018, 8, 12), date(2019, 8, 12), Frequency.P6M, ofDeltaAmount(-50_000))).build());
            RateCalculationSwapLeg payLeg   = RateCalculationSwapLeg.builder().payReceive(PAY).accrualSchedule(accrual).paymentSchedule(payment).notionalSchedule(notional).calculation(FixedRateCalculation.builder().dayCount(ACT_360).rate(ValueSchedule.builder().initialValue(0.0012).stepSequence(ValueStepSequence.of(date(2018, 8, 12), date(2019, 8, 12), Frequency.P6M, ofDeltaAmount(0.0001))).build()).build()).build();
            RateCalculationSwapLeg recLeg   = RateCalculationSwapLeg.builder().payReceive(RECEIVE).accrualSchedule(accrual).paymentSchedule(payment).notionalSchedule(notional).calculation(IborRateCalculation.builder().index(IborIndices.GBP_LIBOR_3M).gearing(ValueSchedule.of(1.1)).spread(ValueSchedule.of(0.002)).build()).build();
            Swap test = Swap.of(payLeg, recLeg);

            assertEquals(test.summaryDescription(), "2Y GBP 1mm variable Rec GBP-LIBOR-3M * 1.1 + 0.2% / Pay 0.12% variable : 12Feb18-12Feb20");
        }
Exemple #2
0
        public virtual void test_summarize_knownAmountVarying()
        {
            Swap test = Swap.of(KnownAmountSwapLeg.builder().accrualSchedule(PeriodicSchedule.of(date(2018, 2, 12), date(2020, 2, 12), Frequency.P3M, BusinessDayAdjustment.NONE, SHORT_INITIAL, false)).amount(ValueSchedule.builder().initialValue(145_000).stepSequence(ValueStepSequence.of(date(2018, 8, 12), date(2019, 8, 12), Frequency.P6M, ofDeltaAmount(-20_000))).build()).currency(GBP).payReceive(PAY).paymentSchedule(PaymentSchedule.builder().paymentFrequency(Frequency.P3M).paymentDateOffset(DaysAdjustment.NONE).build()).build());

            assertEquals(test.summaryDescription(), "2Y Pay GBP 145k variable : 12Feb18-12Feb20");
        }
Exemple #3
0
        public virtual void test_summarize_xccy()
        {
            Swap test = XCcyIborIborSwapConventions.GBP_LIBOR_3M_USD_LIBOR_3M.createTrade(date(2018, 2, 12), Tenor.TENOR_2Y, BuySell.BUY, 2_500_000d, 3_000_000d, 0.007d, REF_DATA).Product;

            assertEquals(test.summaryDescription(), "2Y Rec USD-LIBOR-3M USD 3mm / Pay GBP-LIBOR-3M + 0.7% GBP 2.5mm : 14Feb18-14Feb20");
        }
Exemple #4
0
        public virtual void test_summarize_bas()
        {
            Swap test = IborIborSwapConventions.USD_LIBOR_3M_LIBOR_6M.createTrade(date(2018, 2, 12), Tenor.TENOR_2Y, BuySell.BUY, 2_500_000d, 0.007d, REF_DATA).Product;

            assertEquals(test.summaryDescription(), "2Y USD 2.5mm Rec USD-LIBOR-6M / Pay USD-LIBOR-3M + 0.7% : 14Feb18-14Feb20");
        }
Exemple #5
0
        public virtual void test_summarize_inf()
        {
            Swap test = FixedInflationSwapConventions.GBP_FIXED_ZC_GB_RPI.createTrade(date(2018, 2, 12), Tenor.TENOR_2Y, BuySell.BUY, 1_500_000d, 0.015d, REF_DATA).Product;

            assertEquals(test.summaryDescription(), "2Y GBP 1.5mm Rec GB-RPI / Pay 1.5% : 14Feb18-14Feb20");
        }
Exemple #6
0
        public virtual void test_summarize_ois()
        {
            Swap test = FixedOvernightSwapConventions.GBP_FIXED_1Y_SONIA_OIS.createTrade(date(2018, 2, 12), Tenor.TENOR_2Y, BuySell.SELL, 1_500_000d, 0.015d, REF_DATA).Product;

            assertEquals(test.summaryDescription(), "2Y GBP 1.5mm Rec 1.5% / Pay GBP-SONIA : 12Feb18-12Feb20");
        }
Exemple #7
0
        public virtual void test_summarize_irs()
        {
            Swap test = FixedIborSwapConventions.GBP_FIXED_1Y_LIBOR_3M.createTrade(date(2018, 2, 12), Tenor.TENOR_5Y, BuySell.BUY, 1_500_000d, 0.015d, REF_DATA).Product;

            assertEquals(test.summaryDescription(), "5Y GBP 1.5mm Rec GBP-LIBOR-3M / Pay 1.5% : 12Feb18-12Feb23");
        }
Exemple #8
0
        //-------------------------------------------------------------------------
        public virtual void test_summarize()
        {
            Swap test = Swap.builder().legs(ImmutableList.of(MOCK_GBP1, MOCK_USD1)).build();

            assertEquals(test.summaryDescription(), "7M Pay [GBP-LIBOR-3M, EUR/GBP-ECB, EUR-EONIA] / Rec [GBP-LIBOR-3M, EUR/GBP-ECB, EUR-EONIA] : 15Jan12-15Aug12");
        }