Esempio n. 1
0
        public virtual void test_trade()
        {
            IborFutureCurveNode node   = IborFutureCurveNode.of(TEMPLATE, QUOTE_ID, SPREAD);
            double          price      = 0.99;
            MarketData      marketData = ImmutableMarketData.builder(VAL_DATE).addValue(QUOTE_ID, price).build();
            IborFutureTrade trade      = node.trade(1d, marketData, REF_DATA);
            IborFutureTrade expected   = TEMPLATE.createTrade(VAL_DATE, SecurityId.of(STANDARD_ID), 1L, 1.0, price + SPREAD, REF_DATA);

            assertEquals(trade, expected);
        }
        //-------------------------------------------------------------------------
        public virtual void test_createTrade()
        {
            IborFutureTemplate @base    = IborFutureTemplate.of(YEAR_MONTH, CONVENTION);
            LocalDate          date     = LocalDate.of(2015, 10, 20);
            double             quantity = 3;
            double             price    = 0.99;
            double             notional = 100.0;
            SecurityId         secId    = SecurityId.of("OG-Future", "GBP-LIBOR-3M-Jun16");
            IborFutureTrade    trade    = @base.createTrade(date, secId, quantity, notional, price, REF_DATA);
            IborFutureTrade    expected = CONVENTION.createTrade(date, secId, YEAR_MONTH, quantity, notional, price, REF_DATA);

            assertEquals(trade, expected);
        }