Order Routing: Getting the Big Picture
Figure 1 - a single simulated order represented as a picture. The x-axis represents time of day, they y-axis represents trading venues, and the colour represents the capacity the trader interacted with the market where red shows the percent of volume executed actively, blue represents the passive fraction of volume and green dark volume.
Do you know how your order is routed? Should you care? Lately, more and more emphasis is being placed on how orders are routed. Typically concerns are raised around whether brokers are routing in their own best interest or in their clients’ best interest. Other considerations relate to whether certain trading venues are ‘toxic’ and lead to deterioration of performance.
Let’s begin with a bit of background. In order to realize an investment opportunity, traders must first acquire a position. They can do this by buying or selling shares of stock in the ‘market’. While this sounds quite simple and maybe obvious, the term ‘market’ hides a lot of complexity. The reason is that the ‘market’ consists of many places to trade. While many years ago, there was typically only a single place to trade (often called an exchange), we now have many places to trade, some with names like MTFs, ATSs or ECNs. This means that we need to make choices about which of these venues to interact with when we go to purchase shares of stock. We also need to consider the ways in which we interact with the collection of trading venues we refer to as the ‘market’.
While there are many possible questions to address, three key questions we would like to answer regarding our order are: When did we execute? Where did we execute? and How did we execute?
The portfolio manager generally knows why they want to execute, but the other three questions all relate to how the order was managed by a broker. The brokers use technologies such as algos that determine timing, and routers that determine where to direct the order and the way to execute.
One of the key things being managed in this approach is market impact. When we go to the market, we don’t want to push the market too much as that can only hurt our performance. At the same time, the role of the market is to provide price discovery – the process of finding equilibrium prices that balance supply and demand. Therefore, we want to develop tools that can allow us to determine the answers to the questions of where, when and how we should trade so we can understand why we got the outcome we did.
Ultimately what we want to be able to do is to see the big picture of how our order interacted with the market. It therefore seems natural to visualize this interaction in a picture. We can develop such a picture by plotting the way we interacted along three dimensions.
The first dimension we care about is time – we want to answer the question ‘when did we trade?’ We want to be able to show how much volume we traded as a function of time. The second dimension we care about is the trading venue – we want to answer the question ‘where did we trade?’ The third dimension we care about is the way we interacted with the market – did we cross the spread and remove liquidity? did we post our order passively in the book providing liquidity? or did we execute in a dark pool? – we want to answer the question ‘how did we trade?’
Unfortunately, pictures are two dimensional, so how can we show these three dimensions in a single picture? Well, fortunately, there are colour pictures! So maybe we can answer all three questions by developing a colour image. We can show a time dimension along the horizontal dimension of our picture, and a venue dimension along the vertical dimension of our picture and then the colour can indicate how we traded.
We use the property that any colour is a mixture of red, green and blue. So, if we use red to represent the ‘active’ volume from crossing the spread, blue to represent the ‘passive’ volume and green to represent dark volume, then we can combine three ways of interacting with a venue into a colour which is itself a mixture of active, passive and dark volume. The intensity of the colour is proportional to the amount of volume while the actual colour is determined by the distribution of active/passive/dark. When the pixel is red, it means the volume in that bucket was all active. If the pixel is blue, the volume was all passive, while if green, then the volume was all dark. Other colours are mixtures of these three ‘primary’ colours.
In Figure 1 above we show an image that represents a single order. The x-axis represents the time of day, and in this example shows 30-minute time buckets between the open and close of the market (9:30 – 16:00). Each row shows a different trading venue. The colour shows the way the order was traded by combing active, passive and dark fraction of volume as an RGB triplet, while the brightness (which is exaggerated here for clarity) represents the fraction of the overall order done at the given time on the given venue. The numbers on each pixel indicate the percentage of the order done in each capacity (active, passive or dark) while the sum of these numbers is the percentage of the total order done.
We can generate a picture like the one shown in Figure 1 for each order and then label the pictures based on which broker executed, which algo (if any) was used and any other attributes we want to control for (eg: volatility, market cap, etc…)
The colour provided by visualizing the data in an image like this also has some other benefits. One of the key benefits is that now we can use tools developed for image recognition analyze these images. In particular we can use deep learning (DL) methods for image classification. Tools like convolutional neural networks (CNNs) that were developed for other use cases can be leveraged to help us with our TCA questions.
We can now answer questions such as: how consistently does a particular algo/SOR pair execute an order? How differently do different algos trade? How similar are different brokers’ algos? How does my trading strategy influence my realized market impact?
Figure 2 below shows 24 trading strategy pictures for different orders. By providing a deep learning or machine learning (ML) model with many of these images, we can see if there are patterns that we can then use to optimize our trading results. The good news is that we don’t need to re-invent the wheel here, instead we use the tools and techniques (including parallel processing using GPUs) from image recognition which are available using open source libraries.
Figure 2. Several simulated trading strategies are shown to allow comparison. Each black square represents a single order. We see differences in venue selection, timing and degree of active vs passive vs dark.
While we are not so much interested in identifying cats vs dogs, we are certainly interested in understanding how, where and when our orders are turned into volume. This routing information can provide colour regarding our performance and the products and brokers used in implementation of our order flow.
We can now see the big picture.