Exemplo n.º 1
0
        public virtual void test_metadata_fixed()
        {
            LocalDate              nodeDate = VAL_DATE.plusMonths(1);
            IborFutureCurveNode    node     = IborFutureCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD, LABEL).withDate(CurveNodeDate.of(nodeDate));
            DatedParameterMetadata metadata = node.metadata(VAL_DATE, REF_DATA);

            assertEquals(metadata.Date, nodeDate);
            assertEquals(metadata.Label, node.Label);
        }
Exemplo n.º 2
0
        public virtual void test_metadata_last_fixing()
        {
            IborFutureCurveNode    node       = IborFutureCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD, LABEL).withDate(CurveNodeDate.LAST_FIXING);
            ImmutableMarketData    marketData = ImmutableMarketData.builder(VAL_DATE).addValue(QUOTE_ID, 0.0d).build();
            IborFutureTrade        trade      = node.trade(1d, marketData, REF_DATA);
            LocalDate              fixingDate = trade.Product.FixingDate;
            DatedParameterMetadata metadata   = node.metadata(VAL_DATE, REF_DATA);

            assertEquals(metadata.Date, fixingDate);
            LocalDate referenceDate = TEMPLATE.calculateReferenceDateFromTradeDate(VAL_DATE, REF_DATA);

            assertEquals(((YearMonthDateParameterMetadata)metadata).YearMonth, YearMonth.from(referenceDate));
        }
Exemplo n.º 3
0
        public virtual void test_metadata_end()
        {
            IborFutureCurveNode node          = IborFutureCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD, LABEL);
            LocalDate           date          = LocalDate.of(2015, 10, 20);
            LocalDate           referenceDate = TEMPLATE.calculateReferenceDateFromTradeDate(date, REF_DATA);
            LocalDate           maturityDate  = TEMPLATE.Index.calculateMaturityFromEffective(referenceDate, REF_DATA);
            ParameterMetadata   metadata      = node.metadata(date, REF_DATA);

            assertEquals(metadata.Label, LABEL);
            assertTrue(metadata is YearMonthDateParameterMetadata);
            assertEquals(((YearMonthDateParameterMetadata)metadata).Date, maturityDate);
            assertEquals(((YearMonthDateParameterMetadata)metadata).YearMonth, YearMonth.from(referenceDate));
        }