Development blog

This roughly-cobbled-together site will serve as a repository for some random development stuff, including this journal. Expect it to get less crap soon...

State of the Nation

Posted by Russ Williams on Sunday, 8th February 2009 at 21:49 GMT
Comments (3) | Reply
Well, that's about it for the weekend...

The FIX part seems reasonably robust, but still isn't doing much validation. The network part is fairly basic, but works. The exchange... well... it's OK for a single client, but seems to have some issues with concurrency and can occasionally deadlock.

I've had two clients trading with each other, and I've learned a lot about the protocol - and been surprised by how little documentation is available for some of this. Which is as much as I could have hoped for in a weekend, really.

The biggest tasks still to handle are:

  • * Validation of the FIX messages

  • * The remainder of the FIX4.0 standard

  • * A proper multithreaded exchange

  • * Rearranging the code into subpackages

  • * Implementing the FIX4.1 and 4.2 protocols



As promised, the code - such as it is - is available here. I've decided to call it FIXME as a pun on the protocol and the state of the code. I'm releasing it as public domain, so if - God forbid - anyone wants the code, they can have it without attribution.

Order entry

Posted by Russ Williams on Sunday, 8th February 2009 at 18:53 GMT
No comments yet | Reply
Well, the client can now put orders (New Order - Single, message type "D") into the exchange... sadly this is a bit useless as it's only able to trade against itself at the moment.

Next step is to put in execution reports (type "8", spammed to all clients) and we should be getting somewhere.

... as the client said to the server!

Posted by Russ Williams on Sunday, 8th February 2009 at 17:14 GMT
Comments (1) | Reply
Today I've spent quite a lot of time trying to make the repeated groups work neatly, and it's just about there now.

Far more importantly, I've integrated the FIX stuff with the network stuff and have a working logon sequence:

Constructing FIX engine: CLIENT
About to send: 8=FIX.4.0|9=42|35=A|49=CLIENT|56=SERVER|34=1|98=0|108=30|10=186|
Got a message of type A
Handling logon message
BeatingHeart constructor(delay = 4 seconds)
About to send: 8=FIX.4.0|9=30|35=0|49=CLIENT|56=SERVER|34=2|10=142|
About to send: 8=FIX.4.0|9=30|35=0|49=CLIENT|56=SERVER|34=3|10=143|
About to send: 8=FIX.4.0|9=30|35=0|49=CLIENT|56=SERVER|34=4|10=144|
About to send: 8=FIX.4.0|9=30|35=0|49=CLIENT|56=SERVER|34=5|10=145|
About to send: 8=FIX.4.0|9=30|35=0|49=CLIENT|56=SERVER|34=6|10=146|
About to send: 8=FIX.4.0|9=30|35=0|49=CLIENT|56=SERVER|34=7|10=147|
About to send: 8=FIX.4.0|9=30|35=0|49=CLIENT|56=SERVER|34=8|10=148|
Got a message of type 0
About to send: 8=FIX.4.0|9=30|35=0|49=CLIENT|56=SERVER|34=9|10=149|
About to send: 8=FIX.4.0|9=31|35=0|49=CLIENT|56=SERVER|34=10|10=190|


That output is currently missing 52 (SendingTime) tags, but that's easy enough to put in. There are two heartbeat threads running - one giving the server a kick (message type "0") every 4 seconds, and one doing the same to the client every 30, as specified by the logon ("A") messages.

So, now to connect this to my order book...