Package com.barchart.feed.base.provider

Examples of com.barchart.feed.base.provider.DefBookEntry


    {

      final PriceValue priceBid = message.getPriceBid();
      final PriceValue priceAsk = message.getPriceAsk();

      final MarketDoBookEntry entryBid = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, priceBid, ValueConst.NULL_SIZE);
      final MarketDoBookEntry entryAsk = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, priceAsk, ValueConst.NULL_SIZE);

      applyTop(entryBid, time, market);
      applyTop(entryAsk, time, market);
View Full Code Here


      return;
    }

    /* ",-," a.k.a comma-dash-comma; ddf command : remove */
    if (isClear(price)) {
      entry = new DefBookEntry(
          MarketBookAction.REMOVE, entry.side(),
          Book.Type.DEFAULT, MarketBook.ENTRY_TOP,
          ValueConst.NULL_PRICE, ValueConst.NULL_SIZE);
    }

View Full Code Here

  }

  @Override
  public final MarketBookEntry last() {

    final DefBookEntry entry = null; // XXX

    return entry == null ? NULL_BOOK_ENTRY : entry;

  }
View Full Code Here

      final PriceValue price = HelperDDF.newPriceDDF(
          priceBidArray[index], frac);

      final SizeValue size = HelperDDF.newSizeDDF(sizeBidArray[index]);

      final MarketDoBookEntry entry = new DefBookEntry(MODIFY, BID,
          DEFAULT, place, price, size);

      entries[entryIndex++] = entry;

    }

    for (int index = 0; index < countAsk; index++) {

      if (sizeAskArray[index] == 0) {
        continue;
      }

      final int place = index + 1;

      final PriceValue price = HelperDDF.newPriceDDF(
          priceAskArray[index], frac);

      final SizeValue size = HelperDDF.newSizeDDF(sizeAskArray[index]);

      final MarketDoBookEntry entry = new DefBookEntry(MODIFY, ASK,
          DEFAULT, place, price, size);

      entries[entryIndex++] = entry;

    }
View Full Code Here

      size = ValueConst.NULL_SIZE;
      break;
    }

    /** XXX note: {@link MarketBook#ENTRY_TOP} */
    final MarketDoBookEntry entry = new DefBookEntry(MODIFY, side, DEFAULT,
        MarketBook.ENTRY_TOP, price, size);

    return entry;

  }
View Full Code Here

      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:
View Full Code Here

      final PriceValue priceBid = message.getPriceBid();
      final PriceValue priceAsk = message.getPriceAsk();

      /** XXX note: {@link MarketBook#ENTRY_TOP} */

      final MarketDoBookEntry entryBid = new DefBookEntry(MODIFY, BID,
          DEFAULT, ENTRY_TOP, priceBid, ValueConst.NULL_SIZE);
      final MarketDoBookEntry entryAsk = new DefBookEntry(MODIFY, ASK,
          DEFAULT, ENTRY_TOP, priceAsk, ValueConst.NULL_SIZE);

      applyTop(entryBid, time, market);
      applyTop(entryAsk, time, market);

View Full Code Here

      return;
    }

    /* ",-," a.k.a comma-dash-comma; ddf command : remove */
    if (isClear(price)) {
      entry = new DefBookEntry(MarketBookAction.REMOVE, entry.side(),
          MarketBookType.DEFAULT, MarketBook.ENTRY_TOP,
          ValueConst.NULL_PRICE, ValueConst.NULL_SIZE);
    }

    market.setBookUpdate(entry, time);
View Full Code Here

      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;
View Full Code Here

      final PriceValue priceBid = message.getPriceBid();
      final PriceValue priceAsk = message.getPriceAsk();

      /** XXX note: {@link MarketBook#ENTRY_TOP} */

      final MarketDoBookEntry entryBid = new DefBookEntry(
          MODIFY, Book.Side.BID,
          Book.Type.DEFAULT, ENTRY_TOP, priceBid, ValueConst.NULL_SIZE);
      final MarketDoBookEntry entryAsk = new DefBookEntry(
          MODIFY, Book.Side.ASK,
          Book.Type.DEFAULT, ENTRY_TOP, priceAsk, ValueConst.NULL_SIZE);

      applyTop(entryBid, time, market);
      applyTop(entryAsk, time, market);
View Full Code Here

TOP

Related Classes of com.barchart.feed.base.provider.DefBookEntry

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.