Order matching algorithms

In today’s markets dominated by High-Frequency algos, room for profits for non-HF (and more importantly, non-HF aware) guys is generally speaking reduced. The proportional performance impact of HF is likely to be bigger the smaller is your average trade and the shorter your holding period.

However, in my experience this doesn’t have to be necessary the case: simply put, as in any business you have to adapt to the competitors  and in this case one way of doing it is to pay more attention and improve the execution side of your trading. This is not always easily doable (see the “Timestamp fraud” reported by Zerohedge), but there are some low-hanging fruits that can be picked as a first step.

If this statement may sound kind of vague to you, I have an example based on my experience that supports it and that I think that could be useful to others (while hopefully not having too much of an impact on my strategies).

While all my models are fully automated, I still like to look at markets and particularly at order books when my orders are being executed.
Something that I noticed quite some time ago when trading 30y US bond futures was that whenever my limit orders were executed, I was immediately at a loss.
What this means is better explained by an example. Say that we had an order book that looked like this:

and that my sell limit order was included in those 750 @ 134.6.

Whenever I was executed, the mid-price would then immediately move against me, and the book would then look something like this:


bid_offer_2

Basically what was happening was that my order was always one of the last to be executed, so the simple fact that it got filled meant that there were no more offers (bids) at my level, and the best bid and offer would move up (down) one tick.

A quick investigation on the CME website revealed that the cause for this was the type of order matching algo being used by the exchange, a First In, First Out (FIFO) algo.

What is a matching algorithm?
CME explains it as:

A matching algorithm is a technique to allocate matched quantities, used when an aggressor order matches with one or multiple resting orders. Algorithms apply to both outright and implied matching.

In Rajeev Ranjan’s website you can find a more in-depth introduction to Order Matching Algorithms (as well as other resources on HFT/algo trading).

In the example above, my trading model was instructed to send the limit order only when the price was close enough to my desired level, which always made me one of the last to join the queue and hence one of the last to be filled, according to the FIFO paradigm.

In practical terms, what this meant was that I was always executed in the worst possible scenarios, that is when the price would continue in the opposite direction of my order, and at the same time I was never executed in the best scenarios, that is when the price would “touch” my level and then reverse back in my favour.

As you can imagine, a simple workaround for me was to send my limit orders (when operating under FIFO matching algos) as early as possible, but generally speaking, this observation can suggest different things to different people. For day traders that are not trading in an automated fashion, operating under FIFO matching algorithms could often mean increasing one’s Maximum Adverse Execution by one tick (which can be quite a lot, depending on what one is doing ), unless one is able to play around it.

Similarly to this case, there are other situations when the order matching algo in use and trades execution in general can become as important as the strategies/trade ideas themselves.

Another example of making good use of order matching algorithms could be that of a trader operating under a pro-rata matching algorithm, typical of Eurodollar (IR) futures. If you really want a fill of X lots, you could just send an order that is somewhat bigger than X – with the extra amount being dictated by how aggressive you want/need to be – and once filled try to cancel the remaining lots (DISCLAIMER: of course by doing this you are actively risking of being filled in all the lots, so just don’t take my word on this being a good practice and do it at your own risk).

Of course paying attention to the matching algorithm is just scratching the surface of the High-Frequency world, but I would think that in some situations it’s an easy “scratch” to do and one that could directly add some value.

To conclude this post, let me clearly say that for how good our market simulator is, trades execution can’t always be modelled beforehand. This doesn’t mean that we should give up trying to make simulations as realistic (and somewhat conservative) as possible, e.g. in terms of fills and slippage (here’s a nice post on what is slippage by Prof. Tucker Balch). Rather, we should just remember that there is no real substitute for personal first hand observation and interaction with the world.
All in all, it shouldn’t really come as a surprise that simple observation is a powerful tool, being it the first step of the scientific method.

Andrea

 

Advertisements

About mathtrading

My name is Andrea La Rosa and I am a quant trader based in the UK. In the past I worked as a quant in the prop desk of an investment bank, before deciding to fully dedicate myself to quantitative trading.
This entry was posted in Trading Strategies Design and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s