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
case CLOSE_2_LAST: // NEW
case CLOSE_ASK_PRICE:
case CLOSE_BID_PRICE:
case CLOSE_2_ASK_PRICE:
case CLOSE_2_BID_PRICE:
/* Update changed comonents */
market.clearChanges();
market.setChange(Component.DEFAULT_CURRENT);
barCurrent.set(MarketBarField.CLOSE, price);
barCurrent.set(MarketBarField.BAR_TIME, time);
market.setBar(CURRENT, barCurrent);
return null;
case HIGH_LAST_PRICE:
case HIGH_BID_PRICE:
case YEAR_HIGH_PRICE:
/* Update changed comonents */
market.clearChanges();
market.setChange(Component.DEFAULT_CURRENT);
barCurrent.set(MarketBarField.HIGH, price);
barCurrent.set(MarketBarField.BAR_TIME, time);
market.setBar(CURRENT, barCurrent);
return null;
case LOW_LAST_PRICE:
case LOW_ASK_PRICE:
case YEAR_LOW_PRICE:
/* Update changed comonents */
market.clearChanges();
market.setChange(Component.DEFAULT_CURRENT);
barCurrent.set(MarketBarField.LOW, price);
barCurrent.set(MarketBarField.BAR_TIME, time);
market.setBar(CURRENT, barCurrent);
return null;
case VOLUME_LAST_SIZE:
// TODO
break;
case VOLUME_PAST_SIZE:
/* Update changed comonents */
market.clearChanges();
market.setChange(Component.DEFAULT_PREVIOUS);
barPrevious.set(MarketBarField.VOLUME, size);
barPrevious.set(MarketBarField.BAR_TIME, time);
market.setBar(PREVIOUS, barPrevious);
return null;
case VOLUME_THIS_SIZE:
/* Update changed comonents */
market.clearChanges();
market.setChange(Component.DEFAULT_CURRENT);
barCurrent.set(MarketBarField.VOLUME, size);
barCurrent.set(MarketBarField.BAR_TIME, time);
market.setBar(CURRENT, barCurrent);
return null;
case OPEN_LAST_PRICE:
case OPEN_ASK_PRICE:
case OPEN_BID_PRICE:
case OPEN_2_LAST_PRICE:
case OPEN_2_ASK_PRICE:
case OPEN_2_BID_PRICE:
/* Update changed comonents */
market.clearChanges();
market.setChange(Component.DEFAULT_CURRENT);
//
barCurrent.set(MarketBarField.OPEN, price);
barCurrent.set(MarketBarField.HIGH, price);
barCurrent.set(MarketBarField.LOW, price);
barCurrent.set(MarketBarField.CLOSE, price);
barCurrent.set(MarketBarField.INTEREST, size);
barCurrent.set(MarketBarField.VOLUME, size);
barCurrent.set(MarketBarField.BAR_TIME, time);
market.setBar(CURRENT, barCurrent);
//
market.setState(MarketStateEntry.IS_SETTLED, false);
//
return null;
case INTEREST_LAST_SIZE:
/* Update changed comonents */
market.clearChanges();
market.setChange(Component.DEFAULT_CURRENT);
barCurrent.set(MarketBarField.INTEREST, size);
barCurrent.set(MarketBarField.BAR_TIME, time);
market.setBar(CURRENT, barCurrent);
return null;
case INTEREST_PAST_SIZE:
/* Update changed comonents */
market.clearChanges();
market.setChange(Component.DEFAULT_PREVIOUS);
barPrevious.set(MarketBarField.INTEREST, size);
barPrevious.set(MarketBarField.BAR_TIME, time);
market.setBar(PREVIOUS, barPrevious);
return null;
case PREVIOUS_LAST_PRICE:
/* Update changed comonents */
market.clearChanges();
market.setChange(Component.DEFAULT_PREVIOUS);
barPrevious.set(MarketBarField.CLOSE, price);
barPrevious.set(MarketBarField.BAR_TIME, time);
market.setBar(PREVIOUS, barPrevious);
return null;
/** only "final" sets the flag */