Monday, February 13, 2006

FIX for Streaming Quotes: version 4.3 vs. 4.4

When using FIX for trading FX Spot on streaming quotes one must choose between the two latest versions of FIX: 4.3 or 4.4. Version 4.2 does not really support spot trading, as several of the required messages are not defined. I've come across some solutions where the MarketData message was modified to contain e.g. a QuoteID. This does work, but one can not really claim to be compliant with the protocol as custom tags have to be introduced. FIX4.2 is really for order routing and that's it.

Should one then go for FIX4.3 or FIX4.4? Our own B2B FIX server is build around FIX4.3. This is mainly because it seemed to be the most commonly used version at the time development began, and it works quite well, but if I should start today, I would definitely got for FIX4.4 as it is much more elegant for spot trading. I will try to quantify that statement below.

Both versions support the QuoteRequest and Quote messages, hence the subscription to and receiving of the quotes are the same. The difference lay in the way you trade on these quotes.

For FIX4.3 you use version 4.2 syntax using the Order - Single message (35=D), with the OrdType set to Previously quoted (40=D).

An example of an Order - Single message if you wanted to Buy 5.000.000 EUR/USD @ 1.3364 could be (tag 117 is the QuoteID):


[Standard Header]
11=1702843[0]64=20060209[0]21=1[0]55=EUR/USD[0]460=4[0]54=1[0] 60=20060207-10:00:29[0]38=5000000[0]40=D[0]44=1.3363[0]117=STE-EURUSD-2006-2-7:10.0.28:45-5000000
[Standard Trailer]

[0] used to represent the basic field delimiter.

Note, that I have included tag 460 to identify the Product as Currency (4). This is pretty basic stuff really, if you come from the cash equities or fixed income world.

If you were to trade FX on streaming quotes using FIX4.4 you would use the QuoteResponse message (35=AJ) - you could in principle also still use the FIX4.2 syntax described above. The advantage of using this syntax is, that apart from not being confused whether you were placing an order or making a trade is, that you are able to unsubscribe to a quote stream. The tag QuoteRespType (694) should be set to "1" if you want to Hit or Lift the quote and to "6" if you want to Pass on it, that is stop the stream.

A QuoteResponse message could look like the following:


[Standard Header]
693=2476010[0]117=STE-EURUSD-2006-2-7:10.0.28:45-5000000[0]694=1[0]11=2476010[0]55=EUR/USD[0]54=1[0]38=5000000[0]44=1.3363
[Standard Trailer]



As can be seen, then the QuoteResponse message is also slightly more compact that the Order - Single message.

Tuesday, January 24, 2006

ResendRequest

One of the problems with the FIX protocol is the handling of missing messages. If you receive a message with a sequence number higher than expected, the protocol dictates that you should send a ResendRequest, requesting the messages from the missing message (to infinity). As the messages are to be handled sequentially all process of incoming messages should stop, until the gap has been filled.

This modus operandi works fine for trade and order related messages and executions, but what about quotes? Or market data? Are you really interested in receiving a bunch of old quotes that you can't trade on anyway, because they are ... old?

To overcome this, we have adopted the following best practice for our own B2B Server: we use two FIX sessions, one for the quotes and one for the trades. The benefit of this is that the client does not have to request missing messages on the quote session, but can simply accept the incoming sequence number as being the next in line, even if it is too high according to his or her own book keeping. At the same time, we will not send out old quotes, but simply a SessionReset(GapFill) should we receive a ResendRequest. Obviously ResendRequests should be made on the trade session.


Sunday, January 22, 2006

FIX Primer

I've been asked to write a FIX primer. What versions to use for order routing or FX spot trading, best practices concerning the inner workings of the protocol, number of sessions to use in different scenarios and so on.

As this is not a simple task, I will try to post "chapters" here when I'm done along with general views on high frequency trading and order routing. Stuff from my day to day life others may find useful. I've integrated with more than 20 financial institutions and exchanges. Some have done a really good job, others not quite so. This blog is also about these connections and my experiences.

Saturday, July 23, 2005

First Entry

OK. We are ON. First blog from me.