« ISO 20022 releases a “for dummies” | Main | A consultant's gotta eat series: Duck Ragu Recipe »

StreamInsight and FIX, Part 1

StreamInsight is a relatively new product from Microsoft that aims to provide customers with a CEP offering on the Microsoft platform. CEP is an acronym for Complex Event Processing and they tend to be applications that process or monitor complex event streams, usually all in memory. The list of available adapters is growing though most are unsupported community examples. They’ll get you started and I’m sure Microsoft is in the processing of hardening some of them.

FIX is usually all about low-latency. FIX developers talk in terms of microseconds and nanoseconds when it comes to latency. Prices move quickly and the system that gets the order to market the fastest gives the firm a competitive advantage (and fat bonuses for developers.. in your dreams!). 

StreamInsight lends itself nicely to be integrated with FIX, from processing market data, developing algorithmic trading applications to post trade compliance analysis, there’s lot of potential.  Quotes, Orders, Executions and the like could all be modeled as a CepEvent and developers could write LINQ queries to capture data for analysis or define new events and stream them back out to the market or a counterparty. StreamInsight brings the ability to implement low-latency financial applications to the .NET developer.

Over the past couple of weeks I’ve been working with Microsoft and Rapid Addition on a prototype FIX adapter for StreamInsight. It’s been an interesting  undertaking as both the session and application layer need careful consideration when hooking it up to a product like StreamInsight.

The prototype has a StreamInsight app that connects via a FIX input adapter to a MarketData simulator that sends in a steady stream stock quotes. Our StreamInsight app implements a LINQ query that scans the Quote Events and will create a buy Order event and send it out via an Output FIX Adapter to an Exchange simulator. The Exchange simulator acknowledges the order (sends an Execution Report) and then fills it (another Executions Report). Then our StreamInsight app has yet another FIX input adapter to get the Execution Reports and a LINQ query that looks for the Fills. Finally it sends them to the console using an output console adapter.

It’s a good example as there are 4 FIX adapter instances (2 input and 2 output) but only 2 FIX sessions. There are 3 FIX messages; MarketDataIncrementalRefresh (MsgType=X), NewOrderSingle (MsgType =D) and an ExecutionReport (MsgType=8). The app not only has to read in FIX events but also create them and send them out.

This is the first of a blog series on some of the challenges faced. The second post will be about FIX Session Management. I would love to post some of the code from the prototype but it’s not my IP so I’ll need to get permission first but hopefully they’re cool with it as it’s a great example of StreamInsight and FIX. I think .NET developers who work with FIX will find it interesting.

The adapter framework is pretty easy to navigate and there are plenty of examples on how to get started. A good place to start is Richard Seroter’s blog and Johan Ahlen (blog) over on SqlServerCentral.com. If you’re new to FIX you can start here.


Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>