Package com.barchart.feed.base.book.api

Examples of com.barchart.feed.base.book.api.MarketBookTop


    final DDF_Session ddfSession = message.getSession();
   
    //

    final MarketBookTop top = market.get(MarketField.BOOK_TOP);
    final MarketDoBar barCurrent = market.loadBar(CURRENT.field);
    final MarketDoBar barPrevious = market.loadBar(PREVIOUS.field);

    //
    switch (param) {
   
    case TRADE_ASK_PRICE:  // NEW
      log.debug("Mapper saw TRADE_ASK_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().get(InstrumentField.SYMBOL).toString());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
     
    case TRADE_BID_PRICE:  // NEW
      log.debug("Mapper saw TRADE_BID_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().get(InstrumentField.SYMBOL).toString());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
   
    case TRADE_LAST_PRICE:
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
      return null;
     
    case ASK_LAST: // NEW
      log.debug("Mapper saw ASK_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().get(InstrumentField.SYMBOL).toString());
     
    case ASK_LAST_PRICE:
      final DefBookEntry topAskPrice = new DefBookEntry(MODIFY, ASK,
          DEFAULT, ENTRY_TOP, price, top.side(ASK).size());
      applyTop(topAskPrice, time, market);
      return null;

    case ASK_LAST_SIZE:
      final DefBookEntry topAskSize = new DefBookEntry(MODIFY, ASK,
          DEFAULT, ENTRY_TOP, top.side(ASK).price(), size);
      applyTop(topAskSize, time, market);
      return null;

    case BID_LAST: // NEW
      log.debug("Mapper saw BID_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().get(InstrumentField.SYMBOL).toString());
     
    case BID_LAST_PRICE:
      final DefBookEntry topBidPrice = new DefBookEntry(MODIFY, BID,
          DEFAULT, ENTRY_TOP, price, top.side(BID).size());
      applyTop(topBidPrice, time, market);
      return null;

    case BID_LAST_SIZE:
      final DefBookEntry topBidSize = new DefBookEntry(MODIFY, BID,
          DEFAULT, ENTRY_TOP, top.side(BID).price(), size);
      applyTop(topBidSize, time, market);
      return null;

    case CLOSE_LAST: // NEW
    case CLOSE_2_LAST: // NEW
View Full Code Here


    final DDF_Session ddfSession = message.getSession();
   
    //

    final MarketBookTop top = market.get(MarketField.BOOK_TOP);
    final MarketDoBar barCurrent = market.loadBar(CURRENT.field);
    final MarketDoBar barPrevious = market.loadBar(PREVIOUS.field);

    //
    switch (param) {
   
    case TRADE_ASK_PRICE:  // NEW
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.TRADE);
     
      log.debug("Mapper saw TRADE_ASK_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);

      return null;
     
    case TRADE_BID_PRICE:  // NEW
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.TRADE);
     
      log.debug("Mapper saw TRADE_BID_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
   
    case TRADE_LAST_PRICE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.TRADE);
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
     
    case ASK_LAST: // NEW
     
      log.debug("Mapper saw ASK_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case ASK_LAST_PRICE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topAskPrice = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.ASK).sizeValue());
      applyTop(topAskPrice, time, market);
     
      return null;

    case ASK_LAST_SIZE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topAskSize = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.ASK).priceValue(), size);
      applyTop(topAskSize, time, market);
     
      return null;

    case BID_LAST: // NEW
      log.debug("Mapper saw BID_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case BID_LAST_PRICE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topBidPrice = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.BID).sizeValue());
      applyTop(topBidPrice, time, market);
     
      return null;

    case BID_LAST_SIZE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topBidSize = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.BID).priceValue(), size);
      applyTop(topBidSize, time, market);
     
      return null;

    case CLOSE_LAST: // NEW
View Full Code Here

    final DDF_Session ddfSession = message.getSession();
   
    //

    final MarketBookTop top = market.get(MarketField.BOOK_TOP);
    final MarketDoBar barCurrent = market.loadBar(CURRENT.field);
    final MarketDoBar barPrevious = market.loadBar(PREVIOUS.field);

    //
    switch (param) {
   
    case TRADE_ASK_PRICE:  // NEW
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.TRADE);
     
      log.debug("Mapper saw TRADE_ASK_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);

      return null;
     
    case TRADE_BID_PRICE:  // NEW
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.TRADE);
     
      log.debug("Mapper saw TRADE_BID_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
   
    case TRADE_LAST_PRICE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.TRADE);
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
     
    case ASK_LAST: // NEW
     
      log.debug("Mapper saw ASK_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case ASK_LAST_PRICE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topAskPrice = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.ASK).sizeValue());
      applyTop(topAskPrice, time, market);
     
      return null;

    case ASK_LAST_SIZE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topAskSize = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.ASK).priceValue(), size);
      applyTop(topAskSize, time, market);
     
      return null;

    case BID_LAST: // NEW
      log.debug("Mapper saw BID_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case BID_LAST_PRICE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topBidPrice = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.BID).sizeValue());
      applyTop(topBidPrice, time, market);
     
      return null;

    case BID_LAST_SIZE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topBidSize = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.BID).priceValue(), size);
      applyTop(topBidSize, time, market);
     
      return null;

    case CLOSE_LAST: // NEW
View Full Code Here

    }

    // Roll session if needed
    final MarketBarType type = market.ensureBar(date);

    final MarketBookTop top = market.get(MarketField.BOOK_TOP);
    final MarketDoBar bar = market.loadBar(type.field);

    switch (param) {

      case TRADE_ASK_PRICE:

        market.setTrade(ddfSession.type, ddfSession.session,
            ddfSession.sequencing, price, size, time, date);

        return null;

      case TRADE_BID_PRICE:

        market.setTrade(ddfSession.type, ddfSession.session,
            ddfSession.sequencing, price, size, time, date);

        return null;

      case TRADE_LAST_PRICE:

        market.setTrade(ddfSession.type, ddfSession.session,
            ddfSession.sequencing, price, size, time, date);

        return null;

      case ASK_LAST:
      case ASK_LAST_PRICE:

        final DefBookEntry topAskPrice = new DefBookEntry(
            MODIFY, Book.Side.ASK,
            Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.ASK).sizeValue());
        applyTop(topAskPrice, time, market);

        return null;

      case ASK_LAST_SIZE:

        final DefBookEntry topAskSize = new DefBookEntry(
            MODIFY, Book.Side.ASK,
            Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.ASK).priceValue(), size);
        applyTop(topAskSize, time, market);

        return null;

      case BID_LAST:
      case BID_LAST_PRICE:

        final DefBookEntry topBidPrice = new DefBookEntry(
            MODIFY, Book.Side.BID,
            Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.BID).sizeValue());
        applyTop(topBidPrice, time, market);

        return null;

      case BID_LAST_SIZE:

        final DefBookEntry topBidSize = new DefBookEntry(
            MODIFY, Book.Side.BID,
            Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.BID).priceValue(), size);
        applyTop(topBidSize, time, market);

        return null;

      case CLOSE_LAST:
View Full Code Here

      break;
    }

    //

    final MarketBookTop top = market.get(MarketField.BOOK_TOP);
    final MarketDoBar barCurrent = market.loadBar(CURRENT.field);
    final MarketDoBar barPrevious = market.loadBar(PREVIOUS.field);

    //

    switch (param) {

    case TRADE_LAST_PRICE:
      final DDF_Session ddfSession = message.getSession();
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
      return null;

    case ASK_LAST_PRICE:
      final DefBookEntry topAskPrice = new DefBookEntry(MODIFY, ASK,
          DEFAULT, ENTRY_TOP, price, top.side(ASK).size());
      applyTop(topAskPrice, time, market);
      return null;

    case ASK_LAST_SIZE:
      final DefBookEntry topAskSize = new DefBookEntry(MODIFY, ASK,
          DEFAULT, ENTRY_TOP, top.side(ASK).price(), size);
      applyTop(topAskSize, time, market);
      return null;

    case BID_LAST_PRICE:
      final DefBookEntry topBidPrice = new DefBookEntry(MODIFY, BID,
          DEFAULT, ENTRY_TOP, price, top.side(BID).size());
      applyTop(topBidPrice, time, market);
      return null;

    case BID_LAST_SIZE:
      final DefBookEntry topBidSize = new DefBookEntry(MODIFY, BID,
          DEFAULT, ENTRY_TOP, top.side(BID).price(), size);
      applyTop(topBidSize, time, market);
      return null;

    case CLOSE_ASK_PRICE:
    case CLOSE_BID_PRICE:
View Full Code Here

              .append(event)
              .append(" EventTime=")
              .append(value.get(MarketField.MARKET_TIME)
                  .asDateTime().toString());

          final MarketBookTop top = value.get(MarketField.BOOK_TOP);

          MarketBookEntry entry = top.side(MarketBookSide.ASK);

          if (!entry.isNull()) {
            sb.append(" ASK TOP").append(" price=")
                .append(ValueUtil.asDouble(entry.price()))
                .append(" qty=").append(entry.size().asLong());
          }

          entry = top.side(MarketBookSide.BID);

          if (!entry.isNull()) {
            sb.append(" BID TOP").append(" price=")
                .append(ValueUtil.asDouble(entry.price()))
                .append(" qty=").append(entry.size().asLong());
View Full Code Here

    final DDF_Session ddfSession = message.getSession();
   
    //

    final MarketBookTop top = market.get(MarketField.BOOK_TOP);
    final MarketDoBar barCurrent = market.loadBar(CURRENT.field);
    final MarketDoBar barPrevious = market.loadBar(PREVIOUS.field);

    //
    switch (param) {
   
    case TRADE_ASK_PRICE:  // NEW
      log.debug("Mapper saw TRADE_ASK_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
     
    case TRADE_BID_PRICE:  // NEW
      log.debug("Mapper saw TRADE_BID_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
   
    case TRADE_LAST_PRICE:
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
      return null;
     
    case ASK_LAST: // NEW
      log.debug("Mapper saw ASK_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case ASK_LAST_PRICE:
      final DefBookEntry topAskPrice = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.ASK).sizeValue());
      applyTop(topAskPrice, time, market);
      return null;

    case ASK_LAST_SIZE:
      final DefBookEntry topAskSize = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.ASK).priceValue(), size);
      applyTop(topAskSize, time, market);
      return null;

    case BID_LAST: // NEW
      log.debug("Mapper saw BID_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case BID_LAST_PRICE:
      final DefBookEntry topBidPrice = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.BID).sizeValue());
      applyTop(topBidPrice, time, market);
      return null;

    case BID_LAST_SIZE:
      final DefBookEntry topBidSize = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.BID).priceValue(), size);
      applyTop(topBidSize, time, market);
      return null;

    case CLOSE_LAST: // NEW
    case CLOSE_2_LAST: // NEW
View Full Code Here

    final DDF_Session ddfSession = message.getSession();
   
    //

    final MarketBookTop top = market.get(MarketField.BOOK_TOP);
    final MarketDoBar barCurrent = market.loadBar(CURRENT.field);
    final MarketDoBar barPrevious = market.loadBar(PREVIOUS.field);

    //
    switch (param) {
   
    case TRADE_ASK_PRICE:  // NEW
      log.debug("Mapper saw TRADE_ASK_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
     
    case TRADE_BID_PRICE:  // NEW
      log.debug("Mapper saw TRADE_BID_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
   
    case TRADE_LAST_PRICE:
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
      return null;
     
    case ASK_LAST: // NEW
      log.debug("Mapper saw ASK_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case ASK_LAST_PRICE:
      final DefBookEntry topAskPrice = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.ASK).sizeValue());
      applyTop(topAskPrice, time, market);
      return null;

    case ASK_LAST_SIZE:
      final DefBookEntry topAskSize = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.ASK).priceValue(), size);
      applyTop(topAskSize, time, market);
      return null;

    case BID_LAST: // NEW
      log.debug("Mapper saw BID_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case BID_LAST_PRICE:
      final DefBookEntry topBidPrice = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.BID).sizeValue());
      applyTop(topBidPrice, time, market);
      return null;

    case BID_LAST_SIZE:
      final DefBookEntry topBidSize = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.BID).priceValue(), size);
      applyTop(topBidSize, time, market);
      return null;

    case CLOSE_LAST: // NEW
    case CLOSE_2_LAST: // NEW
View Full Code Here

    final DDF_Session ddfSession = message.getSession();
   
    //

    final MarketBookTop top = market.get(MarketField.BOOK_TOP);
    final MarketDoBar barCurrent = market.loadBar(CURRENT.field);
    final MarketDoBar barPrevious = market.loadBar(PREVIOUS.field);

    //
    switch (param) {
   
    case TRADE_ASK_PRICE:  // NEW
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.TRADE);
     
      log.debug("Mapper saw TRADE_ASK_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);

      return null;
     
    case TRADE_BID_PRICE:  // NEW
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.TRADE);
     
      log.debug("Mapper saw TRADE_BID_PRICE - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
   
    case TRADE_LAST_PRICE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.TRADE);
     
      market.setTrade(ddfSession.type, ddfSession.session,
          ddfSession.sequencing, price, size, time, date);
     
      return null;
     
    case ASK_LAST: // NEW
     
      log.debug("Mapper saw ASK_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case ASK_LAST_PRICE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topAskPrice = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.ASK).sizeValue());
      applyTop(topAskPrice, time, market);
     
      return null;

    case ASK_LAST_SIZE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topAskSize = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.ASK).priceValue(), size);
      applyTop(topAskSize, time, market);
     
      return null;

    case BID_LAST: // NEW
      log.debug("Mapper saw BID_LAST - Price=" + price.toString() +
          " " + message.getSession() + " " + message.getTradeDay().toString() + " "
          + message.getInstrument().symbol());
     
    case BID_LAST_PRICE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topBidPrice = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.BID).sizeValue());
      applyTop(topBidPrice, time, market);
     
      return null;

    case BID_LAST_SIZE:
     
      /* Update changed comonents */
      market.clearChanges();
      market.setChange(Component.BOOK_COMBINED);
     
      final DefBookEntry topBidSize = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.BID).priceValue(), size);
      applyTop(topBidSize, time, market);
     
      return null;

    case CLOSE_LAST: // NEW
View Full Code Here

    }

    // Roll session if needed
    final MarketBarType type = market.ensureBar(date);

    final MarketBookTop top = market.get(MarketField.BOOK_TOP);
    final MarketDoBar bar = market.loadBar(type.field);

    switch (param) {

      case TRADE_ASK_PRICE:

        market.setTrade(ddfSession.type, ddfSession.session,
            ddfSession.sequencing, price, size, time, date);

        return null;

      case TRADE_BID_PRICE:

        market.setTrade(ddfSession.type, ddfSession.session,
            ddfSession.sequencing, price, size, time, date);

        return null;

      case TRADE_LAST_PRICE:

        market.setTrade(ddfSession.type, ddfSession.session,
            ddfSession.sequencing, price, size, time, date);

        return null;

      case ASK_LAST:
      case ASK_LAST_PRICE:

        final DefBookEntry topAskPrice = new DefBookEntry(
            MODIFY, Book.Side.ASK,
            Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.ASK).sizeValue());
        applyTop(topAskPrice, time, market);

        return null;

      case ASK_LAST_SIZE:

        final DefBookEntry topAskSize = new DefBookEntry(
            MODIFY, Book.Side.ASK,
            Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.ASK).priceValue(), size);
        applyTop(topAskSize, time, market);

        return null;

      case BID_LAST:
      case BID_LAST_PRICE:

        final DefBookEntry topBidPrice = new DefBookEntry(
            MODIFY, Book.Side.BID,
            Book.Type.DEFAULT, ENTRY_TOP, price, top.side(Book.Side.BID).sizeValue());
        applyTop(topBidPrice, time, market);

        return null;

      case BID_LAST_SIZE:

        final DefBookEntry topBidSize = new DefBookEntry(
            MODIFY, Book.Side.BID,
            Book.Type.DEFAULT, ENTRY_TOP, top.side(Book.Side.BID).priceValue(), size);
        applyTop(topBidSize, time, market);

        return null;

      case CLOSE_LAST:
View Full Code Here

TOP

Related Classes of com.barchart.feed.base.book.api.MarketBookTop

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.