Technology weblogIT-Essence |
|
Thursday Jan 05, 2012
Reading repeating groups in FIX market data reponse
This short post details how to read out repeating groups in a FIX 4.4 final String symbol = message.getString(Symbol.FIELD);
final List<Group> groups = message.getGroups(NoMDEntries.FIELD);
BigDecimal bidPrice = null;
BigDecimal offerPrice = null;
BigDecimal bidSize = null;
BigDecimal offerSize = null;
for (final Group oneGroup : groups) {
final char type = oneGroup.getChar(MDEntryType.FIELD);
if (type == MDEntryType.OFFER) {
offerPrice = oneGroup.getDecimal(MDEntryPx.FIELD);
offerSize = oneGroup.getDecimal(MDEntrySize.FIELD);
} else if (type == MDEntryType.BID) {
bidPrice = oneGroup.getDecimal(MDEntryPx.FIELD);
bidSize = oneGroup.getDecimal(MDEntrySize.FIELD);
}
}
Posted at 11:29AM Jan 05, 2012 by Zeger Hendrikse in Finance | Comments[0] Comments:
|
|
||||