Technology weblog

IT-Essence
Thursday Jan 05, 2012

A collection of useful FIX protocol links

This post summarizes some useful links I have collected during my experiences with QuickFix/J:

Creating a FIX market data request message

This post details the composition of a FIX 4.4 market data request message using the QuickFix/J framework (MsgType.MARKET_DATA_REQUEST), which entails the composition of repeated groups. In this example we illustrate this with the implementation of a method that requests market data for a list of instruments:

private static final MessageFactory messageFactory = new quickfix.fix44.MessageFactory();

private Message createMarketDataRequest(SessionID sessionIds, List symbols, String exchange) { 
  Message request = messageFactory.create("FIX.4.4", messageType);

  request.setField(new MarketDepth(1)); // Top of book
  request.setField(new MDReqID(UUID.randomUUID().toString()));
  request.setChar(SubscriptionRequestType.FIELD, SubscriptionRequestType.SNAPSHOT);

  Group entryTypeGroup = 
    messageFactory.create("FIX.4.4", MsgType.MARKET_DATA_REQUEST, NoMDEntryTypes.FIELD);
  entryTypeGroup.setField(new MDEntryType(MDEntryType.BID));
  request.addGroup(entryTypeGroup);
  entryTypeGroup.setField(new MDEntryType(MDEntryType.OFFER));
  request.addGroup(entryTypeGroup);

  int numSymbols = symbols.size();
  if (numSymbols == 0) {
    request.setInt(NoRelatedSym.FIELD, numSymbols);
  }
  for (final String symbol : symbols) {
    if (StringUtils.isNotBlank(symbol)) {
      Group symbolGroup = 
        messageFactory.create("FIX.4.4", MsgType.MARKET_DATA_REQUEST, NoRelatedSym.FIELD);
      symbolGroup.setField(new Symbol(symbol));
      if (StringUtils.isNotBlank(exchange)) {
        symbolGroup.setField(new SecurityExchange(exchange));
      }
        request.addGroup(symbolGroup);
      }
    }
  return request;
}

Reading repeating groups in FIX market data reponse

This short post details how to read out repeating groups in a FIX 4.4 MsgType.MARKET_DATA_SNAPSHOT_FULL_REFRESH message using QuickFix/J. In the example below I have requested the bid and offer prices, which implies that I get returned two repeating groups. First all groups are retrieved, and then we loop through the groups to extract the subsequent fields:

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);
  }
}

Thursday Dec 22, 2011

Youtube tutorials on the FIX protocol

Today I found a post on another weblog, referring to 4 concise introductory tutorials on the FIX protocol. For those who are interested, check it out!

Wednesday Aug 24, 2011

Interesting post on DDD, EDA and the Axon framework

Just stumbled upon an interesting post on DDD, EDA and the Axon framework: Axon Framework - DDD and EDA meet together.

Tuesday Aug 23, 2011

Discussing CQRS

Koen en Zeger
My colleague Koen en me discussing the CQRS architecture underlying the new version of ABN-AMRO pension services

Friday Aug 05, 2011

Axon 1.1 resolves issues with HSQLDB 2.0

In this post we mentioned that the Axon framework didn't like HSQLDB version 2.0. However, after migration to version 1.1 of the framework, the problems mentioned in the previous post were no longer observed! Now we can finally expect more sensible error messages from HSQLDB.

Saturday Jun 04, 2011

Certified Scrum Master

This week I became Certified Scrum Master by attending the training given by Paul Goddard.

CSM certification

Paul turned out to be an excellent trainer as well as a skilled drawing artist:

[Read More]

Thursday Apr 21, 2011

Spring-WS and Exception Handling through wsdl:fault - Part 2

I have learned, eventhough the spring-ws documentation is pretty clear, still alot of features are not properly documented. In this post I will focus on creating a demo webservice using Spring-WS 2. I will provide code samples for all elements required to get all exception code where you want it. All this information is based on contract-first webservice development. Here we focus on the XSD's required and how to create your WSDL from those XSD's. This post is divided into 3 parts. This post is part 2. Part 1 can be found here 
[Read More]

Thursday Apr 14, 2011

Spring-WS and Exception Handling through wsdl:fault - Part 1

I have learned, eventhough the spring-ws documentation is pretty clear, still alot of features are not properly documented. In this post I will focus on creating a demo webservice using Spring-WS 2. I will provide code samples for all elements required to get all exception code where you want it. All this information is based on contract-first webservice development. Here we focus on the XSD's required and how to create your WSDL from those XSD's. This post is divided into 3 parts. This post is part 1. 
[Read More]


Hire us
Archives
Tags
Links
Stats
Referrers