Do you know what your executed order strategy looks like?
Why should you care? We explain below.
A key part of any institutional trading strategy is the routing of child orders to trading venues through Smart Order Routers (SORs). These routing strategies create data that is published by the markets that can be used to create a picture of how a particular order was filled. The data are the best bids and offers for each security as well as the executed trades. We can take this data and aggregate it into forms that provide us a different perspective than looking directly at the low-level of trades and quotes.
What we do is partition the data into ‘buckets’ that are defined by the venue where a trade occurred and the time at which it occurred. The time can be aggregated into buckets which have a ‘length’ that can be defined by the analyst. For example, we might bucket time into 30 equally spaced time intervals that span the life of our order. We can repeat this procedure for each trading venue, resulting in a set of numbers for each venue with each number containing the volume executed within each bucket.
Next, we take the rows of data for each trading venue and stack them on top of each other to create a grid. The grid consists of boxes and each box has a value determined by the volume executed within the time-period and on the venue defined by the box. For example, if we had a 30-minute order and used the procedure described above, we would have time buckets that are one minute wide. We add up all the volume in the one-minute period and repeat this procedure for each trading venue.
The brightness of the box depends on the volume, with the brightest boxes representing boxes with the most volume and black boxes representing boxes that have no volume.
Now where and when we route is only a part of the analysis. We also want to know how we route. We generally have three choices when engaging with public markets in continuous trading hours: 1) we can join and order book passively, 2) we can actively engage with contra-side orders by crossing the spread and 3) we can interact with dark liquidity to execute between the best bid/offer.
Because of this we employ one more step in our procedure to get a picture of how our order was routed. We compare each fill from our order with the prevailing bid and offer and categorize the trade into one of the three categories described above. If we are anlayzing a buy order and a fill occurs on the bid, we consider it passive. If it occurs on the offer, then we consider it active. If it occurs in between, we classify it as dark.
Using these classifications, we construct a 3-d grid with 3 grids stacked on top of each other. One grid contains only active volume, another only dark volume and the final one has only passive volume. We map these to an RGB colour space by considering each grid a separate colour eg. (active-> Red, passive -> Green and dark -> Blue).
This output of this process is the same format as an rgb image. We show the result for a simulated order below.
Figure 1 We show a picture of a simulated order. The image above shows the trading venue as rows and the columns are buckets of time. The brightness of each ‘pixel’ is determined by the relative volume executed during a given time interval at a given venue. Red represents active volume, blue is dark volume and green is passive volume. The mixture of active, passive and dark volumes determines the colour by mapping to rgb colour-space.
The next thing we can do is to put the picture of the order into context by creating a second picture. This second picture is not a picture of the order, though. This time we snap a picture of the market. We polarize the picture by taking the perspective of the side of the order we are comparing with. If our order is a sell order, then public market trades that executed on the bid are considered active (seller crossed the spread) while trades on the ask are considered passive (seller didn’t cross the spread). We show an example in Figure 2.
Figure 2 In the images above we show a picture of the market on the left and the same order as in Figure 1 on the right. The market image allows us to compare what was happening in the market during the time our order was being implemented. By viewing the data in this way we can gain unique insights about how our order was routed.
We can use these images to compare our order with what was going on at the same time in the market. In Figure 2 we see a large block going up on NEO – the brightest pixel is NEO, bin 22. We see activity on most venues spread out through time and both dark and lit executions are occurring in the market. For our order, the order volume is not quite as uniform as the market volume with mixtures of active, passive, and dark volume.
In Canada, we can take things a step further because broker numbers are published as part the trade records, so we can further partition our datasets to see how specific brokers are interacting in the market. We will cover this topic more fully in a future article.
So why go to this trouble? Why not just show more traditional charts that show volume and venues over time?
One reason is that the charts above are 3-d in the sense that colour provides a third dimension that allows us to show the capacity of the trade, i.e was it active, passive or dark? Recall that the image is really the superposition of three grids with each grid representing one of the three primary colours (red, green and blue). This one representation shows where we traded – the trading venue, when we traded – the time bucket and how we traded – the colour.
Another reason is that there are deep learning libraries that have been built for image analysis. By transforming our data into an rgb image, we can apply these open source deep learning libraries to spot patterns in our order data. Tools like convolutional neural networks (CNNs) do image classification and can be applied to allow us to do strategy classification and anomaly detection.
The main reason, though, is to provide unique perspectives to order routing and develop techniques to help improve our outcomes. While this approach is a small part of the TCA process used in TradeFabric, it is an example of how we use modern approaches to data analysis and present results in an intuitive manner.
Comments