SSRN Id4442770
SSRN Id4442770
Electronic Markets
Álvaro Cartea3,4 , Samuel N. Cohen1,3,4 , Rob Graumans2 , Saad Labyad1,3,4 ,
Leandro Sánchez-Betancourt1,3,5,* , and Leon van Veldhuijzen2
1
Alan Turing Institute, London
2
Autoriteit Financiële Markten, Amsterdam
3
Oxford-Man Institute for Quantitative Finance, University of Oxford
4
Mathematical Institute, University of Oxford
5
Department of Mathematics, King’s College London
*
Principal Author
Abstract
We build statistical models to describe how market participants choose the direction, price, and vol-
ume of orders. Our dataset, which spans sixteen weeks for four shares traded in Euronext Amsterdam,
contains all messages sent to the exchange and includes algorithm identification and member identifi-
cation. We obtain reliable out-of-sample predictions and report the top features that predict direction,
price, and volume of orders sent to the exchange. The coefficients from the fitted models are used to
cluster trading behaviour and we find that algorithms registered as Liquidity Providers exhibit the widest
range of trading behaviour among dealing capacities. In particular, for the most liquid share in our study,
we identify three types of behaviour that we call (i) directional trading, (ii) opportunistic trading, and
(iii) market making, and we find that around one third of Liquidity Providers behave as market markers.
Disclaimer: The views expressed in this article are those of the authors, and not necessarily those of
the Autoriteit Financiële Markten.
1 Introduction
Modelling economic agents is a fundamental part of understanding financial markets. The increasing use
of electronic trading and the vast quantities of data recorded provide opportunities for modelling agents on
a fine scale. However, privacy concerns and data access restrictions have led to limited academic research
using such data. In this paper we employ a unique dataset to understand trading behaviour. The dataset
contains member identification and algorithm identification and comprises all activity (orders, transactions,
cancellations, and amendments) in Euronext Amsterdam. We model the trading behaviour of each indi-
vidual algorithm that sends limit orders (passive and aggressive) to the market. We obtain an accurate
description of how algorithms choose direction, price, and volume and identify important market-observable
and idiosyncratic features that predict this decision. Furthermore, our work provides a detailed empirical
description of how algorithms respond to market conditions, their own inventory, and their presence in the
limit order book (LOB). Lastly, we find clusters of trading behaviour and compare them to their dealing
capacity in Euronext Amsterdam. A dealing capacity is a contractual arrangement between the trading
venue and the trading member, specifying the trading behaviour allowed by the member when acting in that
capacity. This classification is determined by the trading venue, not the regulator.
1.1 Insights
We build models to predict the behaviour of individual trading algorithms with a dataset of beyond-level-
three LOB data that contains the activity of all market participants active in Euronext Amsterdam. For each
share and for each algorithm in our study, we propose models to predict the three principal characteristics of
an incoming order: direction (buy or sell), price, and volume. By implication, the price, the time-in-force and
state of the LOB, determine whether orders are aggressive or passive. We build a comprehensive feature space
comprising information available in the market and information available to the algorithm at the moment of
making decisions. We do not account for the latency of market participants when constructing the features;
instead, we employ information from the time “just before” the order reaches the market.1 Specifically, we
endow each algorithm with 53 features that are updated in continuous time and that describe the state of
the LOB, the algorithm’s past actions, and the member’s past actions. The main contributions of this paper
are:
(i) To obtain high out-of-sample accuracies when one predicts (a) the direction (buy or sell) of limit orders,
(b) the price limit of the limit order (irrespective of its time-in-force), and (c) the volume of the order.
(ii) To provide a detailed description of the features that are important to predict the direction, price, and
volume of limit orders sent by algorithms. For example: (a) the imbalance of the algorithm’s presence
in the LOB, the best quotes, and the intraday accumulated inventory variables, are the most important
features determining the direction of the order; (b) the volumes at the best bid and ask prices, the
imbalance of the algorithm’s presence in the LOB, and the bid-ask spread in the LOB are the most
important features determining the price of the order, and (c) the intraday accumulated inventory
and cash variables of both algorithms and members are the most important features determining the
volume of the order.
(iii) To show three clusters of ‘stylised trading behaviour’. We use regression coefficients to build the clusters
and show how these clusters differ from the registered dealing capacity of market participants.2 For
the most liquid share considered, we find that:
1 We expect that accounting for latency when constructing the features would improve the out-of-sample accuracies we obtain.
See Cartea and Sánchez-Betancourt (2021) for examples of how one can compute implied latency at a market participant level.
2 The three dealing capacities of market participants in our study are (i) Liquidity Provider, (ii) House, and (iii) Client; we
LOB is similar to the volume that the agent has posted on the bid side of the LOB.
4 See Cartea and Jaimungal (2015) for a model of how traders optimally deploy such an execution schedule using aggressive
more recent work Avellaneda and Stoikov (2008), Guéant et al. (2013), and Cartea et al. (2015), and Guéant (2016).
2 Data description
We use data from Euronext Amsterdam spanning the period 11 October 2021 to 30 January 2022 (80
trading days in 16 weeks) in four shares with tickers ASML, INGA, AD, TOM2 – we refer to these shares
as ASML, ING, AHOLD, and TOMTOM respectively. The data is labelled with algorithm identification
and member identification, and contains transactions, orders, cancellations, and amendments processed by
Euronext Amsterdam over the relevant period. Orders are matched via price-time-priority and are displayed
in a central LOB.7
(i) ASML Holding (ticker ASML) specialises in the development and manufacturing of machines that
produce computer chips, its market capitalisation is approximately e200B, it is traded on various
trading venues, and it is a constituent in a number of indices.8 We focus on ASML in the main text of
the paper; results for the other shares are in the Appendix.
(ii) ING Groep N.V. (ticker INGA) is a Dutch multinational banking and financial services corporation
with headquarters in Amsterdam, its market capitalisation is approximately e50B, it is traded on
various trading venues, and it is a constituent in a number of indices.9
(iii) Koninklijke Ahold Delhaize N.V. (ticker AD) is a Dutch multinational retail and wholesaling company,
its market capitalisation is approximately e30B, it is traded on various trading venues, and it is a
constituent in a number of indices.10
(iv) TomTom (ticker TOM2) is a Dutch multinational developer and creator of location technology and
consumer electronics, its market capitalisation is approximately e1B, it is traded on fewer trading
venues, and it is a constituent in a few indices.11
Table 1 presents summary statistics of the four shares between 11 October 2021 and 30 January 2022.
7 See
Euronext (2023d, p. 43) for information about the main trading session and p. 44–46 for market mechanisms.
8 Traded
on more than 100 trading venues in 2022 according to AFM MIFID-II transaction data; see Euronext (2023b) for
more information on ASML.
9 Traded on more than 100 trading venues in 2022 according to AFM MIFID-II transaction data; see Euronext (2023c) for
more information on ING.
10 Traded on more than 100 trading venues in 2022 according to AFM MIFID-II transaction data; see Euronext (2023a) for
more information on AHOLD.
11 Traded on more than 50 trading venues in 2022 according to AFM MIFID-II transaction data; see Euronext (2023e) for
more information on TOMTOM.
Table 1: Statistics for the shares in the study between 11 October 2021 and 30 January 2022.
The tick sizes of the shares do not change during the period 11 October 2021 to 30 January 2022. The
tick size of ASML is e0.1, the tick size of ING is e0.002, the tick size of AHOLD is e0.005, and that of
TOMTOM is e0.005. We observe that ASML, ING, and AHOLD have similar tick sizes as a percentage of
their share price (between 1.3 and 1.8 basis points), while TOMTOM has a larger tick size as a percentage
of its share price.12
and trading strategy CB is in Cartea and Sánchez-Betancourt (2022). See Cartea et al. (2015) and Guéant (2016).
Table 2: Order types of transactions in ASML during first four weeks of data.
The algorithms in our dataset mostly use limit orders, instead of market orders, to take liquidity. Approx-
imately 97% of all transactions result from matching two limit orders. Specifically, in 97% of transactions
one leg is a limit order that rests in the LOB and the other leg is an incoming limit order with a limit price
generous enough to match the first leg.
2.3.2 Time-in-force
Orders submitted to Euronext have a validity parameter – also known as the time-in-force of the order. Table
3 shows the trade count grouped by the validity parameters of the buy and sell orders. More precisely, we show
the number of transactions in the first four weeks of data for ASML for the following combinations: (i) the
buy order has validity parameter immediate-or-cancel (“IoC”) and the sell order has validity parameter good-
for-day (“DAY”), (ii) the buy order has validity parameter DAY and the sell order has validity parameter
IoC, (iii) the buy order has validity parameter DAY and the sell order has validity parameter DAY, and (iv)
all other combinations (for example, fill-or-kill).
Table 3: Validity types of transactions in ASML during first four weeks of data.
In the first two rows of Table 3, liquidity is consumed with an IoC order. In the third row, liquidity is
taken with a DAY order. IoC and DAY orders account for 98% of all transactions. Naturally, in Table 3, it
is always the case that one of the two legs has DAY as a time-in-force, which represents the liquidity resting
in the LOB waiting to be matched; the other leg is IoC roughly two-thirds of the times and DAY roughly
one-third of the times.
DAY 7,389,072 96
limit order IoC 274,211 4
other 660 0
Table 4: Order and validity types of orders in ASML during first four weeks of data.
Limit orders with validity type DAY are 96% of all limit orders sent, and orders with validity type IoC
account for only 4%. We also observe that IoC orders are often filled by more than one DAY order, which
explains the difference between the figures in Tables 3 and 4.
Table 5 uses the first four weeks of data for ASML and reports the (contribution to) order count, trade
count, and volume traded of groups of algorithms. More precisely, the table summarises the aggregate
contribution to (i) order count, (ii) trade count, and (iii) volume traded of the top five, top ten, top twenty,
top fifty, and all algorithms. The ranking of algorithms is based on the order count of algorithms during the
first four weeks of data. We note that each trade requires the involvement of two participants, leading to a
double-counting of the number of trades in Table 5.
order count order count trade count trade count volume e volume
percentage of all % percentage of all % percentage of all %
Table 5: Descriptive statistics for algorithms trading in ASML during first four weeks of data.
The top ten algorithms account for more than 50% of the orders, are involved in more than 30% of
the trades, and involved in more than 20% of the total traded volume. While algorithms below the top 50
provide only 4% of the orders, they are involved in 26% of all trades (and 33% of all traded volume by value).
In the Appendix we report the above statistics for ING, AHOLD, and TOMTOM in Tables 20, 21, and 22
respectively.
3 Modelling approach
3.1 Features
In this section, we describe the variables we use in the study. Brogaard et al. (2014) find evidence that public
information influences the direction of the orders submitted by HFTs, for example, news announcements,
price movements, and LOB imbalances. Cont et al. (2023) suggest one should also consider the time of
day and other market conditions such as momentum and volatility. Aı̈t-Sahalia et al. (2022) use three
clocks to construct predictor variables over non-overlapping lookback windows. AFM (2023) indicates that
proprietary trading firms report that their trading algorithms use features such as order book imbalance,
volume in the order book, and price trends, all measured over various time horizons. Furthermore, firms
report that the most recent data has the most predictive power – e.g., messages in the last few milliseconds
have more predictive power than older messages.
In this paper, we use 53 features that reflect (i) the state of the LOB, (ii) recent activity in the LOB, (iii)
the current presence of the algorithm in the LOB, (iv) the current presence of the member in the LOB, (v) the
effects of latency in the features that agents observe, by measuring features over various time-intervals.
10
For ASML, we note that Pt = 1 for 9.6% of orders, Pt = 2 for 42.8% of orders, and Pt = 3 for 47.6% of
orders; see Table 12.
With four weeks of data from 11 October 2021 to 5 November 2021, we compute the (up to nine) unique
population deciles of the variable Vt , and use these population deciles to define the (up to ten) buckets
associated with this variable. We denote by v c the number of buckets for the log-volume. The bucket version
of Vt is denoted by Vt ∈ {1, . . . , v c }. We apply this bucketing to each of the twelve subsequent weeks of
data. The variables we model are
(Dt , Pt , Vt ) , (4)
and we call them (i) direction of the order, (ii) price bucket, and (iii) volume bucket, respectively.
As discussed above, our models capture both aggressive and passive behaviour depending on the price
bucket and the time-in-force of the order. For example, note that all aggressive behaviour falls within Pt = 1.
More precisely, Pt = 1 includes orders that (i) cross the spread and trade against the opposite side of the
LOB (aggressive orders), (ii) post liquidity inside the spread (generous liquidity provision), and (iii) are
cancelled by the exchange upon entry (missed attempts) because their price limit is not generous enough
to trade and their time-in-force precludes them from resting in the LOB; we return to this point below in
Subsection 4.4.7 where we study a conditional model for liquidity taking activity.
where Y ∈ {P, V} and the operator · denotes the dot product between two vectors. When Y is P then
R⋆ = R2, y ∈ {1, 2, 3}, and y c = 3. Similarly, when Y is V then R⋆ = R3, y ∈ {1, . . . , v c }, and y c = v c .
11
where we have the following four combinations: (i) when Y is P and d = +1 then R∗ = R4, y c = 3,
Dkc,d = Dkc,+1 , and y ∈ {1, 2, 3}; (ii) when Y is P and d = −1 then R∗ = R5, y c = 3, Dkc,d = Dkc,−1 , and
y ∈ {1, 2, 3}; (iii) when Y is V and d = +1 then R∗ = R6, y c = v c , Dkc,d = Dkc,+1 , and y ∈ {1, . . . , v c }; (iv)
when Y is V and d = −1 then R∗ = R7, y c = v c , Dkc,d = Dkc,−1 , and y ∈ {1, . . . , v c }. We also have that
β3P,k,+1 , β3P,k,+1 , β3P,k,−1 , β3P,k,−1 , βvV,k,+1
c , βvV,k,+1
c , βvV,k,−1
c , βvV,k,−1
c are all zero. Here we use
For each algorithm we fit the above models. Section 4.2 reports the out-of-sample accuracies and out-
performances over alternative methods for ASML. The results for the other three shares are reported in
Appendix C.1.
4 Model fit
4.1 Train and deploy structure
As described in Section 2, we use sixteen weeks of data in the study. The models are trained over four
consecutive weeks of data and applied to the week after. For example, we use weeks 1 to 4 (11 October 2021
to 5 November 2021) to train the models, then obtain out-of-sample predictions for week 5 (8 November
2021 to 12 November 2021), train models from weeks 2 to 5 (18 October 2021 to 12 November 2021), then
obtain out-of-sample predictions for week 6 (15 November 2021 to 19 November 2021), and so on. We refer
to each such run as a ‘train-and-deploy’ exercise.
With the sixteen weeks of data we perform twelve train-and-deploy exercises. Thus, there are twelve
weeks of data for which we perform out-of-sample predictions. For each train-and-deploy exercise we obtain
seven accuracies per algorithm (one for each model in R1 to R7; see Section 3.3). Next, we compute the
12
R1 R2 R3 R4 R5 R6 R7
Dt Pt Vt Pt |Dt = 1 Pt |Dt = −1 Vt |Dt = 1 (%) Vt |Dt = −1
Top 5 65 ± 7 80 ± 9 60 ± 23 85 ± 6 84 ± 6 61 ± 21 60 ± 22
Top 10 66 ± 7 86 ± 9 68 ± 22 89 ± 6 89 ± 6 69 ± 21 69 ± 22
Top 20 68 ± 9 87 ± 12 62 ± 23 89 ± 10 89 ± 10 63 ± 22 63 ± 22
Top 50 73 ± 12 86 ± 15 60 ± 25 86 ± 18 87 ± 18 59 ± 26 60 ± 25
All 77 ± 15 80 ± 19 48 ± 25 78 ± 24 77 ± 25 46 ± 25 46 ± 26
order-weighted average 70 85 62 88 88 62 62
Table 6: Accuracies of the logistic regression models for ASML. Twelve train-and-deploy exercises. Accura-
cies are reported in % with ± the standard deviation.
Accuracy of predictions is high and stable over time for all algorithms. Furthermore, we observe that
accuracies of the logistic regression models are stable for all shares – for example, when predicting the
direction of the order Dt , accuracies range between 67% and 70% according to the order-weighted accuracy
for all algorithms; see Appendix C.1. The order-weighted average of the regressions for Pt that condition
on direction of order perform better than regression R2. This is not the case for Vt where we have a similar
performance for R2, R6, and R7.
We compare the accuracies of the logistic regression models against a benchmark where the predicted
bucket is the bucket most frequently used by the algorithm in the training data. Table 7 reports the
outperformance of the logistic regression models over this benchmark.
On average, the logistic regression models outperform the benchmark. The outperformance is largest for
predicting the direction of an order, at 18% on average. When predicting volume, we observe the smallest
outperformance over the benchmark. See Appendix C.1 for comparable results for other shares.
Table 8 reports the outperformances of random forests when compared with the same benchmark as that
used in Table 7, and compared with the logistic regressions in Table 6.
13
Top 5 21 ± 7 7 ± 8 9 ± 10 6 ± 7 −1 ± 3 4 ± 4
Top 10 19 ± 7 4 ± 7 5±8 4 ± 6 −1 ± 2 3 ± 3
Top 20 23 ± 11 3 ± 6 6±8 6 ± 7 −1 ± 2 2 ± 5
Top 50 24 ± 13 2 ± 5 4±7 4 ± 6 −1 ± 2 1 ± 4
All 22 ± 17 3 ± 7 2±7 1 ± 7 0 ± 6 3 ± 5
order-weighted average 23 4 5 5 0 2
Table 8: Outperformance of random forests over benchmark and over logistic regressions for ASML. Twelve
train-and-deploy exercises.
Overall, random forests outperform the benchmark by 23% when predicting whether algorithms send a
buy or a sell order – this is 5% higher than the outperformance achieved by the logistic regression models.
The outperformance over the benchmark is stable across shares; in all cases, random forests outperform
logistic regression models. When predicting the price bucket, random forests outperform the benchmark by
4%, on average, which is the same outperformance attained by the multinomial logistic regression models.
Lastly, when predicting the volume bucket, the outperformance of random forests over the benchmark is
5%, which is 2% higher than the outperformance of the logistic regression over the benchmark. On average,
random forests tend to slightly outperform logistic regressions.
Going beyond logistic regressions comes at a cost. Machine learning models are known to have the
potential to leak parts of the training data when one discloses the model (weights or coefficients obtained)
as investigated in Shokri et al. (2017). That is, some models are vulnerable to privacy attacks – see Rigaki
and Garcia (2020) for a comprehensive survey. For many applications of our study this suggests it is more
appropriate to use logistic regressions because of their interpretability, their simplicity, and their privacy
features. We therefore focus on logistic models in the remainder of this study.
“m” is “minutes”, “s” is “seconds”, “ms” is “milliseconds”, “quad var” is “quadratic variation”, “num” is “number”, “agg” is
14
6 6 6
5 5 5
4 4 4
3 3 3
2 2 2
1 1 1
0 0 0
imbalance inventory best volumes spread num inventory cash of inventory inventory cash of
of algo top of algo messages of algo algorithm of member of algo member
five levels 0.1ms
Figure 1: Most important feature for the top ten algorithms in ASML.
Although there are differences in the importance of features across predictions (Dt , Pt , and Vt ), there is
significant overlap on the most important feature within each of the predictions. For example, the imbalance
of the volumes posted by the algorithm in the first five levels of the LOB is the most relevant feature for
seven out of the top ten algorithms when predicting the direction of the order Dt . This is similar to other
empirical results in the literature; see Cartea et al. (2018) where the authors find that the imbalance of
volumes resting in the LOB is a good predictor of the sign of the next liquidity taking order sent to the
exchange, that is, whether the next liquidity taking order will be to buy or to sell.18 We find that, for
most algorithms, when deciding on the direction of the order Dt , the imbalance of the volumes posted by
themselves is more important than the imbalance of the volumes posted by other algorithms.
To predict the price bucket and volume bucket of orders, the bid-ask spread and intraday accumulated
inventory are respectively among the most important variables. Intuitively, as the spread widens (tightens),
the algorithm is more likely to post orders further from (closer to) the midprice. However, as seen earlier,
volumes of orders typically vary little per algorithm. We do not observe ‘directional’ variables, for example
an algorithm’s current exposure in the LOB, contributing to the price model, but we see that these play a
role in the price conditioned on direction model; see Subsection 4.4.6.
Next, Figure 2 shows a box-plot of the distribution of feature importances for the top ten algorithms
computed over twelve train-and-deploy exercises, and ten repetitions of random permutations. We sort
features according to their median importance and plot the top ten – each feature has 1,200 data points
corresponding to 12 sets of four consecutive weeks, 10 algorithms, and 10 repetitions. The results in the
box-plots differ from the results in Table 1 in that Figure 2 shows the distribution of feature importances
between algorithms instead of showing only the most important feature for a given algorithm.
Figure 2 shows the results for ASML when predicting the direction of the order Dt .
“aggressive”, and “algo” is “algorithm”.
18 Cartea et al. (2020) show that volume imbalance helps to predict the direction of the next (non-aggressive) limit order.
15
Figure 2: Importance of features to explain the direction of an order for ASML (using permutation impor-
tance and logistic regressions, top features only shown).
Again, the imbalance of volumes posted by the algorithm in the first five levels of the LOB is the most
important variable when predicting whether the algorithm will send a buy order or sell order, followed by
the intraday accumulated inventory of the algorithm and the intraday accumulated inventory of the trading
member, and the best volumes posted in the LOB. This is similar for all shares; the same set of features
appears in each of the top ten features reported. This shows that inventory related features, volumes posted
on best quotes, and imbalances by the algorithm near the top of the LOB are important features to predict
the direction of the order.
Figure 3 shows the most important features to predict the price bucket Pt .19
spread
inventory of algo
cash of algorithm
num messages 0.1ms
bid volume of algo 0-5
ask volume of algo 0-5
num messages 1ms
cash of member
num messages 1s
inventory of member
0 0.02 0.04 0.06 0.08 0.1 0.12
Figure 3: Importance of features to explain the price bucket Pt for ASML (using permutation importance
and logistic regressions, top features only shown).
Spread is the most important feature to predict the price bucket Pt , which is in line with the results in
Table 1. There is consistency across shares – five of the top ten features in ASML also feature in the top
ten of the three other shares. The order of importance is consistent: spread is the most important predictor
for three of our four shares, and intraday accumulated inventory and cash of algorithm appear in the top
19 The Figures for Pt are ordered by 75% percentile instead of median to increase interpretability.
16
inventory of member
cash of member
cash of algorithm
inventory of algo
ask volume of algo 0-5
bid volume of algo 0-5
quad var 5m
ask volume excl algo 0-5
bid volume excl algo 0-5
spread
0 0.1 0.2 0.3 0.4
Figure 4: Importance of features to explain the volume bucket Vt for ASML (using permutation importance
and logistic regressions, top features only shown).
For all shares, the four inventory variables are the most important features to predict the volume of an
order. Also, the volume quoted by the algorithm on the first five levels, on both the buy side and the sell
side, is an important feature for all shares. We see that the number of messages in the last second is an
important feature in three shares (ING, AHOLD, TOMTOM). Contrary to the other output variables, we
observe that quadratic variation – measured over various intervals, is an important feature in three of the
shares (ASML, ING, and AHOLD).
Inventory related features are important for predicting the three variables (Dt , Pt , Vt ). Also, among
order book features, those that describe behaviour closer to the top of the LOB have more predictive power
than features that describe behaviour deeper in the LOB. Similarly, the number of messages sent in the
recent past (e.g., in the last 100 microseconds) tend to be more important than the number of messages
contained in longer horizons. This is consistent with the information that trading firms report to the AFM;
see AFM (2023).
We also observe that features describing the algorithm’s presence in the LOB tend to be more predictive
than features describing the presence of other participants. For example, imbalances of the algorithm and
volumes of the algorithm tend to be among the most important features, yet imbalances and volumes of
other agents are not – this is apart from best bid volume and best ask volume.
17
100
80
60
Cluster 1
Cluster 2
Cluster 3 40
20
0
44
45
46
47
48
49
50
51
52
1
2
3
week
Figure 5: Size of clusters for ASML across the twelve clustering exercises. The x-axis notes the last week
of the clustering exercise. For example, “44” refers to the clustering exercise on weeks 41, 42, 43 and 44 of
2021. Weeks 44 to 52 are in 2021 and weeks 1 to 3 are in 2022. The y-axis is the number of algorithms.
We see that the number of algorithms in each of the three clusters varies for each of the twelve clustering
exercises. Given that the clusters aim to capture fundamental trading behaviour, it is crucial that they
exhibit a degree of consistency over time. Below, we study this point in more detail.
18
0.9
0.8
0.7
0.6
0.5
45
46
47
48
49
50
51
52
3
week
Figure 6: Stability of clusters for ASML across the twelve clustering exercises. The y-axis shows the prob-
ability of two randomly selected agents in two consecutive clustering exercise A and B (i) being members
of the same cluster in A and B or (ii) different clusters in A and B. The x-axis shows the last week of the
clustering exercise B.
The blue line lies above the red dotted line, which indicates stability of algorithm clusters. However,
there is a still a fair amount on instability in the clusters over time, as indicated by the gap between the blue
line and 1. Part of the instability might be due to algorithms updating their model parameters frequently,
as shown in the results of the survey (AFM (2023)). Recall that our clustering exercises include only the 96
algorithms present in all clustering exercises. Indeed, if any of these algorithms updates the model parameters
they use to send orders, then we expect that the parameters we obtain will change too, resulting in unstable
clusters.
We also study the link between the level of activity of the algorithms and the stability of their regression
coefficients. We use the logistic regression coefficients of the 53 original features described in Section 3.1,
and assign each algorithm according to the clustering obtained on the coefficients of the logistic regressions
on the PCA-transformed features. The first column of Table 9 lists the most important features to predict
the direction Dt of an order. The second and third columns report the temporal deviation, which for a given
feature is defined as the standard deviation of the regression coefficients over time. We report the average
temporal deviation for the top ten algorithms (second column) and for the bottom ten algorithms (third
column) – the ranking is according to the number of orders sent during the first four weeks of data.
19
Given the large number of data points used to fit the models of the top 10 algorithms, we expect that
the observed temporal deviation is principally due to changes in the algorithms themselves, for example
due to re-calibration of parameters. Conversely, for the bottom 10 algorithms, the number of observed
actions is relatively small, and so the fact that the temporal deviation is systematically higher for these
algorithms may be due to statistical estimation error, rather than systematic differences between the top
and bottom algorithms. Regardless of the reason for the large temporal deviation of the coefficients for the
bottom algorithms, Table 9 lends support to the claim that the instability of our clusters is due primarily
to variation in the estimated coefficients of the smaller algorithms.
20 3 1
House
16 7 0
LP
18 15 16
Figure 7: Confusion matrix between the clusters obtained with the parameters from the first four weeks of
data and the dealing capacity for ASML.
Cluster 1 consists of an almost equal number of Liquidity Providers, Houses, and Clients. Furthermore,
the majority of algorithms with type House or Client are in cluster 1. Therefore one would expect this cluster
to show trading behaviour associated with directional trading firms, such as hedge funds or pension funds –
see Subsection 4.4.3.
Clusters 2 and 3 consist mostly of Liquidity Providers. Hence, one would expect these clusters to exhibit
behaviour most often associated with traditional market makers. Furthermore, the L-shaped confusion
20
number of algorithms 54 25 17
order count 1,639,267 1,901,239 3,712,355
trade count 573,417 343,874 461,874
order to trade ratio 2.86 5.53 8.04
order count % 23 26 51
trade count % 42 25 33
liquidity taking trade count 291,545 251,785 120,353
liquidity taking trade count % 51 73 26
average algo volume in ask side of LOB 0-5 1.43 2.07 2.47
average algo volume in bid side of LOB 0-5 1.49 2.04 2.48
average absolute imbalance of algo 0-5 1.93 1.12 0.77
average ask volume of algo 11-20 0.43 1.69 1.07
average bid volume of algo 11-20 0.44 1.68 1.08
Table 10: Statistics for algorithms in clusters 1,2, and 3 for ASML. First four weeks of data.
Although algorithms in cluster 3 send the most orders (51%), they do fewer transactions (33% compared
to 42% for cluster 1 and 25% for cluster 2). This results in a higher order to trade ratio for cluster 3
(8.04) than for clusters 1 and 2 (2.86 and 5.53 respectively). Furthermore, algorithms in cluster 3 have a
relatively low fraction of liquidity taking transactions; 26% of their transactions are liquidity taking, versus
51% and 73% for clusters 1 and 2. This suggests that algorithms in cluster 3 behave as traditional market
makers. Algorithms in clusters 2 and 3 post more volume (on average) on the first five levels of the LOB
than algorithms in cluster 1. Similarly, algorithms in clusters 2 and 3 have more balanced volumes posted
in the LOB when compared to algorithms in cluster 1.23
In the next sections, we investigate how the various features we consider affect the average behaviour of
algorithms in each of these clusters. We focus on the impact of features on direction and price of orders,
as the model for volume does not display much benefit over a naive model (as seen in Table 7). More
precisely, in Subsection 4.4.5 we study the average coefficients associated with the regressions for predicting
the direction Dt , then, Subsection 4.4.6 discusses the average coefficients for predicting the price bucket Pt
conditional on direction, and Subsection 4.4.7 explores liquidity taking activity and liquidity provision in
more detail.
on the bid side is close to the volume posted by the algorithm on the ask side.
21
Table 11: Average regression coefficients per cluster on first four weeks of training data for ASML when
predicting direction Dt .
We recall the formulation for the logistic regression in equation (5), where Dt = 1 means that the order
is to buy and Dt = −1 means that the order is to sell. Thus, given that all features are normalised and
centred around zero, all else being equal, if an average coefficient is positive (resp. negative) it means that
positive values of the relevant feature increase (resp. decrease) the probability of a given order being a buy
order; and vice-versa for negative values of the relevant feature.
Table 11 provides a number of stylised facts about the difference among clusters to understand differences
in trading behaviour.
(D-i) Cluster 1 is the only cluster with an average positive value for the coefficient for the imbalance of the
algorithm in the first five levels – recall that when imbalance is positive the algorithm has more volume
posted in the bid than in the ask. Thus, algorithms in cluster 1 are inclined to send a buy order if they
have already posted more volume in the bid than in the ask (and similarly with the roles of bid and
ask, and buy and sell reversed). Conversely, algorithms in clusters 2 and 3 are more likely to revert
their imbalance back to a level where the volume provided in the ask side of the LOB is close to that
provided in the bid side of the LOB. This suggests that clusters 2 and 3 behave in some ways like
traditional market makers, i.e., trading algorithms that provide liquidity in both sides of the LOB in
a balanced way. In contrast, algorithms in cluster 1 tend to post liquidity with a preferred direction,
which is consistent with most algorithms of House and Client type being in cluster 1.
(D-ii) Cluster 3 exhibits mean-reversion to zero in inventories at the algorithm level, that is, when the intraday
accumulated inventory is positive they are more likely to send sell orders, while the inventories of
22
In summary, algorithms in cluster 3 exhibit trading behaviours that the literature describes as market
markers. For example, algorithms in cluster 3 seem keen to maintain a balanced provision of liquidity and
take actions to revert their inventories to zero. On the other side of the spectrum we have the algorithms in
cluster 1. These algorithms do not balance the liquidity posted in the LOB, and their orders are more likely
to be in the same direction as their inventory (i.e., position building and directional trading). Algorithms
in cluster 2 lie somewhere in the middle of the behaviour observed by algorithms in clusters 1 and 3. More
precisely, out of the coefficients shown in Table 11, there are three instances in which the sign of the coefficient
associated with cluster 2 is different from both of the signs of the coefficients for clusters 1 and 3. The three
instances involve volumes deep in the LOB.
Table 12: Order count per price bucket Pt and cluster using first four weeks of training data for ASML.
Recall that by the definition of Pt in (3), the first price bucket contains orders whose price limit is more
generous than the best quotes; that is, the limit price is lower than the best ask price for a sell order or the
limit price is greater than the best bid price for a buy order. The second price bucket contains orders whose
limit price equals that of the best quotes; that is, the limit price is the best ask price if the order is to sell
or the limit price is the best bid price if the order is to buy. The third price bucket contains orders deeper
in the LOB.
Thus, given that orders in the first price bucket either (i) trade with the opposite side of the LOB, (ii)
improve the spread, or (iii) get cancelled upon entry because their time-in-force precludes them from resting
in the LOB and their price limit is better than best quotes, we refer to them as orders that show “eagerness
to trade”. Similarly, we call price bucket one the “eager-to-trade” bucket. Next, we study the average
regression coefficients associated with orders in the “eager-to-trade” bucket (Pt = 1).
24 SeeChapter 10 in Cartea et al. (2015) for a mathematical model of the market making problem illustrating how risk aversion
plays a role in how market makers provide liquidity as a function of their inventory.
23
Table 13: Average regression coefficients for price bucket describing eager-to-trade orders, per cluster, on
first four weeks of training data for ASML, conditioning on the direction of order Dt .
(P-i) According to the intercept of the regressions, algorithms in cluster 3 are noticeably less likely – than
those in clusters 1 and 2 – to place orders that are eager to trade.
(P-ii) For algorithms in all clusters, the higher the imbalance of the volumes (by all algorithms) posted at the
best bid and ask, the more likely a buy order is to be eager to trade. This effect is most pronounced
for algorithms in cluster 3, where the bid volume has a much greater impact on orders to buy than the
ask volume; conversely for orders to sell.
(P-iii) Algorithms in cluster 1 seem indifferent to their own imbalance in the book when determining eagerness
to trade, whereas imbalance of their own volume indicates a moderate eagerness to trade for cluster
2 algorithms, and a strong eagerness for cluster 3. The direction of the order for cluster 3 is in the
direction of the imbalance (so if an algorithm has a higher bid than ask volume posted, which means
they have a positive imbalance, its buy orders are typically more eager to trade and its sell orders are
typically less eager to trade).
(P-iv) Regardless of the direction, the wider the bid-ask spread the more likely algorithms are to send orders
that are eager to trade.25 This is particularly pronounced for cluster 3 (we shall see below that this
cluster often refills the book when the spread is above one tick).
(P-v) For algorithms in clusters 1 and 2 we see that the higher their own posted volumes at levels 0 to 5 on
either the bid or ask side, the less likely they are to send an order (either to buy or to sell) that is eager
to trade. Algorithms in cluster 3 exhibit the opposite behaviour; already having volume at the first five
levels of the LOB makes it more likely for them to send eager-to-trade orders. For algorithms in clusters
2 and 3, having volume posted deeper in the book decreases the likelihood of sending eager-to-trade
orders.
(P-vi) For algorithms in clusters 1 and 2, the higher the number of recent messages, the more likely an order
is eager to trade, in either direction.
(P-vii) For all algorithms, there is a reasonably clear symmetry, when the roles of bid and ask, and buying
and selling, are reversed.
We also look at the second price bucket (Pt = 2), which describes orders adding volume to the LOB at
the current best bid or best ask (also known as posting ‘at-the-touch’), and at the third (Pt = 3, whose
coefficients are simply the negative sum of those for Pt = 1, 2), which describes orders adding volume deeper
within the LOB.
25 We refine this result in Subsection 4.4.7. In particular, we find that the larger the bid-ask spread, the more likely all clusters
are to provide liquidity inside the spread, and the less likely they are to cross the spread.
24
Table 14: Average regression coefficients for price bucket describing posting at-the-touch per cluster on first
four weeks of training data for ASML conditioning on the direction of order Dt .
Table 15: Average regression coefficients for price bucket describing posting deeper within the order book,
per cluster on first four weeks of training data for ASML conditioning on the direction of order Dt .
By looking at Table 14 and Table 15, we observe the following stylised facts for the typical behaviour of
each cluster. It should be emphasised that these observations are for a given direction of order, and so the
conclusions should be read in the light of Table 11.
(P-viii) Cluster 3 algorithms are much more likely to place their orders at-the-touch than either of the other
clusters (see the intercept of Table 14). Cluster 2 is less likely to place its orders at-the-touch than
cluster 1 (all other things being equal).
(P-ix) Algorithms in cluster 2 have the highest propensity to place orders deeper in the book.
(P-x) For all algorithms, the higher the volume at the best ask price and the lower the volume at the best
bid (i.e., the lower the imbalance of the best volumes in the LOB) the more likely that a buy order will
be placed deeper in the LOB; conversely for sell orders. This indicates that algorithms pre-empt that
when a large volume builds at either of the best quotes then prices will likely move in the direction of
the opposite side of the LOB, hence why they choose to place their orders deeper in the LOB of the
opposite side.
(P-xi) The likelihood that an algorithm in cluster 2 posts at-the-touch is affected by its own imbalance near
the touch. The likelihood is impacted in the direction of the imbalance (so if an algorithm has a higher
bid than ask volume posted, which corresponds to a positive imbalance, it is more likely that the
algorithm posts buy orders at the best bid price). A weaker effect is observed for cluster 3, but little
effect for cluster 1.
(P-xii) For all algorithms, an increase in the recent number of messages reduces the probability of posting
at-the-touch in either direction.
25
30%
25%
20%
15%
10%
5%
0%
0 2 4 6 8 0 2 4 6 8 0 2 4 6 8
Figure 8: Percentage of eager-to-trade orders as a function of the absolute value of the transformed intraday
accumulated inventory of the algorithm. See Appendix B for the formula of the log-inventory of the algorithm.
arrives willing to buy with price limit of 100 and volume of 100, then, 50 units will get executed against the available liquidity
and 50 will be cancelled. Alternatively, if the order had FoK time-in-force then it gets cancelled upon arrival.
26
Table 16: Percentage of orders sent with At ∈ {0, 1, 2} out of all orders with Pt = 1.
These percentages support our findings that algorithms in cluster 3 make markets for ASML. Algorithms
in cluster 3 have the lowest percentage of aggressive behaviour, and they have the highest proportion of
provision inside the spread. On the other hand, algorithms in clusters 1 and 2 render similar proportions
for aggressive behaviour and missed aggressive behaviour, but they differ in their proportions for providing
liquidity inside the spread. Here, algorithms in cluster 1 provide liquidity inside the spread more often than
algorithms in cluster 2. For both clusters 1 and 2, the vast majority of IoC orders successfully trade, and
only a small fraction are cancelled.
Next, we perform a regression similar to those above to predict if the order will take liquidity, conditioned
on direction and conditioned on the order being in the first price bucket. We recall that if an order sent at
time t consumes liquidity we write At = 0, if the order provides liquidity inside the spread we write At = 1,
and we write At = 2 otherwise. Table 17 shows the average coefficients for the regressions for At = 0, Table
18 shows the average coefficients for the regression associated with At = 1, and Table 19 shows the average
coefficients for the regressions associated with At = 2.
27
Table 17: Average regression coefficients. Orders take liquidity upon arrival in the exchange conditioned on
orders being eager to trade and conditioned on the direction Dt of orders.
At = 1 | Pt = 1, Dt = 1 (Buy) At = 1 | Pt = 1, Dt = −1 (Sell)
Cluster 1 Cluster 2 Cluster 3 Cluster 1 Cluster 2 Cluster 3
Table 18: Average regression coefficients. Orders provide liquidity inside the spread upon arrival in the
exchange conditioned on orders being eager to trade and conditioned on the direction Dt of orders.
28
Table 19: Average regression coefficients. Orders that are immediately cancelled by the exchange upon
arrival conditioned on orders being eager to trade and conditioned on the direction Dt of orders.
29
5.1 Surveillance
Given the vast number of messages that are processed every day by exchanges in electronic markets, it is
difficult to spot behaviour that intentionally or inadvertently may harm the integrity of markets. Either
way, the regulator must develop sophisticated tools to monitor the market and understand the impact of
individual algorithms on metrics of market quality.
Currently, financial regulators and supervisors use algorithms on transaction and order data to detect
practices that may harm the integrity of the market. For example, in electronic trading, the Dutch Authority
for the Financial Markets (AFM) relies on a combination of Suspicious Transaction and Order Reports from
market participants and custom made algorithms on transaction and order data to prevent and detect market
manipulation, see AFM (2021b). Similarly, the Financial Industry Regulatory Authority (FINRA) in the
US uses the SONAR system to monitor suspicious trading activity such as well-timed trades occurring just
before public announcements. These surveillance algorithms mine data to search for unusual patterns, some
of which could be designed to manipulate markets (e.g., pump and dump), to mislead the information in the
LOB (e.g., spoofing), or to trade with privileged information (e.g., front running, insider trading).
Most detection algorithms tend to look for “misleading” signals in the market.27 To learn what is
misleading, one should first know which features agents take into account when making a trading decision.
As a substitute for misleading signals, supervisors often look for outliers or unusual trading behaviour. But
this ignores the fundamental issue at stake: is the unusual trading behaviour misleading market participants?
One should not mistake features that predict algorithmic trading behaviour for features that algorithms
use when making trading decisions. Anecdotally, trading firms often use a variety of non-market information
sources when making decisions, while our data is restricted to quantities which are based in the market (in
27 See Article 12 “Market Manipulation” in EU (2014).
30
29 Article 10(2)(a) Trading venues shall provide their members with access to a testing environment which shall consist of any
of the following:
(a) simulation facilities which reproduce as realistically as possible the production environment, including disorderly trading
conditions, and which provide the functionalities, protocols and structure that allow members to test a range of scenarios
that they consider relevant to their activity;
(b) testing symbols as defined and maintained by the trading venue.
31
5.3 Clustering
In terms of the clustering exercise, there are a number of relevant insights for supervisors. Irrespective of
the trading venue, a supervisor could impose its own criteria on what behaviour would be expected of any
Liquidity Provider, House or Client. Then, our clustering methodology can be used to highlight trading
firms whose algorithms might show behaviour contrary to what one would reasonable expect based on their
dealing capacity.
Acknowledgements
We thank Steef Akerboom, Felix Flinterman, Ronald Verhoeven, Blanka Horvath, and Lukasz Szpruch for
helping to bring about the collaboration between the Alan Turing Institute and the Autoriteit Financiële
Markten. We are grateful to participants at the Knowledge Share Day held at the Alan Turing Institute and
participants at King’s College London financial mathematics internal seminar. We thank Patrick Chang and
Jose Penalva for comments.
Contributions
The authors contributed to the paper as follows: SC and RG initiated the collaboration; ÁC, SC, RG, and
LSB developed the modelling framework, with input from SL and LV; RG and LSB implemented the primary
modelling code, with input from SC, SL and LV; ÁC, SC, RG and LSB wrote the paper.
References
Abergel, F., Anane, M., Chakraborti, A., Jedidi, A., and Toke, I. M. (2016). Limit order books. Cambridge
University Press.
AFM (2021a). Algorithmic trading – governance and controls. https://www.afm.nl/en/sector/actueel/
2021/april/beheersing-controles-handelsalgoritmes. Accessed: 1/May/2023.
AFM (2021b). Prevention and detection of market abuse. https://www.afm.nl/en/sector/themas/
beurzen-en-effecten/afm-market-watch. Accessed: 18/April/2023.
AFM (2023). Machine learning in trading algorithms application by dutch proprietary trading firms and pos-
sible risks. https://www.afm.nl/en/sector/actueel/2023/maart/her-machine-learning. Accessed:
7/March/2023.
Aı̈t-Sahalia, Y., Fan, J., Xue, L., and Zhou, Y. (2022). How and when are high-frequency stock returns
predictable? Available at SSRN 4095405.
Amihud, Y. and Mendelson, H. (1980). Dealership market: Market-making with inventory. Journal of
financial economics, 8(1):31–53.
32
33
Glosten, L. R. and Milgrom, P. R. (1985). Bid, ask and transaction prices in a specialist market with
heterogeneously informed traders. Journal of financial economics, 14(1):71–100.
Gould, M. D., Porter, M. A., Williams, S., McDonald, M., Fenn, D. J., and Howison, S. D. (2013). Limit
order books. Quantitative Finance, 13(11):1709–1742.
Grossman, S. J. and Miller, M. H. (1988). Liquidity and market structure. the Journal of Finance, 43(3):617–
633.
Guéant, O. (2016). The Financial Mathematics of Market Liquidity: From optimal execution to market
making, volume 33. CRC Press.
Guéant, O., Lehalle, C.-A., and Fernandez-Tapia, J. (2013). Dealing with the inventory risk: a solution to
the market making problem. Mathematics and financial economics, 7:477–507.
Hagströmer, B. and Nordén, L. (2013). The diversity of high-frequency traders. Journal of Financial Markets,
16(4):741–770.
Hambly, B., Kalsi, J., and Newbury, J. (2020). Limit order books, diffusion approximations and reflected
spdes: from microscopic to macroscopic models. Applied Mathematical Finance, 27(1-2):132–170.
Hendershott, T., Jones, C. M., and Menkveld, A. J. (2011). Does algorithmic trading improve liquidity?
The Journal of finance, 66(1):1–33.
Ho, T. and Stoll, H. R. (1981). Optimal dealer pricing under transactions and return uncertainty. Journal
of Financial economics, 9(1):47–73.
Kyle, A. S. (1985). Continuous auctions and insider trading. Econometrica: Journal of the Econometric
Society, pages 1315–1335.
Lehalle, C.-A., Guéant, O., and Razafinimanana, J. (2011). High-frequency simulations of an order book: a
two-scale approach. Econophysics of Order-driven Markets: Proceedings of Econophys-Kolkata V, pages
73–92.
34
Megarbane, N., Saliba, P., Lehalle, C.-A., and Rosenbaum, M. (2017). The behavior of high-frequency
traders under different market stress scenarios. Market Microstructure and Liquidity, 3(03n04):1850005.
Murphy, K. P. (2022). Probabilistic machine learning: an introduction. MIT press.
O’Hara, M. (1998). Market Microstructure Theory. John Wiley & Sons.
Penalva, J. S. and Tapia, M. (2021). Heterogeneity and competition in fragmented markets: Fees vs speed.
Applied Mathematical Finance, 28(2):143–177.
Rigaki, M. and Garcia, S. (2020). A survey of privacy attacks in machine learning. arXiv preprint
arXiv:2007.07646.
Roşu, I. (2009). A dynamic model of the limit order book. The Review of Financial Studies, 22(11):4601–
4641.
Shokri, R., Stronati, M., Song, C., and Shmatikov, V. (2017). Membership inference attacks against machine
learning models. In 2017 IEEE symposium on security and privacy (SP), pages 3–18. IEEE.
Sirignano, J. and Cont, R. (2019). Universal features of price formation in financial markets: perspectives
from deep learning. Quantitative Finance, 19(9):1449–1459.
Tao, X., Day, A., Ling, L., and Drapeau, S. (2022). On detecting spoofing strategies in high-frequency
trading. Quantitative Finance, 22(8):1405–1425.
Verousis, T., Perotti, P., and Sermpinis, G. (2018). One size fits all? high frequency trading, tick size
changes and the implications for exchanges: market quality and market structure considerations. Review
of Quantitative Finance and Accounting, 50:353–392.
Vyetrenko, S., Byrd, D., Petosa, N., Mahfouz, M., Dervovic, D., Veloso, M., and Balch, T. (2020). Get
real: Realism metrics for robust limit order book market simulations. In Proceedings of the First ACM
International Conference on AI in Finance, pages 1–8.
Wang, X., Hoang, C., Vorobeychik, Y., and Wellman, M. P. (2021). Spoofing the limit order book: A
strategic agent-based analysis. Games, 12(2).
Williams, B. and Skrzypacz, A. (2020). Spoofing in equilibrium. Stanford University Graduate School of
Business Research Paper.
Wright, I. D., Reimherr, M., and Liechty, J. (2022). A machine learning approach to classification for traders
in financial markets. Stat, 11(1):e465.
35
order count order count trade count trade count volume e volume
percentage of all % percentage of all % percentage of all %
Table 20: Descriptive statistics for algorithms trading in ING during first four weeks of training data.
order count order count trade count trade count volume e volume
percentage of all % percentage of all % percentage of all %
Table 21: Descriptive statistics for algorithms trading in AHOLD during first four weeks of training data.
order count order count trade count trade count volume e volume
percentage of all % percentage of all % percentage of all %
Table 22: Descriptive statistics for algorithms trading in TOMTOM during first four weeks of training data.
B Feature specifications
In this section, we provide a detailed description of the variables we use in the study; these were introduced
in Section 3.1.
We denote time by t and let the trading horizon be [0, T ] on any given day. At any time t ∈ [0, T ], let S̃t
be price of the last transaction that took place before time t; if the trade involved multiple orders, S̃t is the
volume weighted average price of the transaction. Let Sta be the best ask price available in the LOB at time
t and Vta the aggregated volume at price level Sta . Similarly, let Stb be the best bid price available in the
LOB at time t and Vtb the aggregated volume at price level Stb . Thus, the spread at time t and the midprice
at time t are given by
S a + Stb
St = Sta − Stb , St = t , (10)
2
respectively. For a given number of levels n ∈ N denote by Vta,n the total volume available in the first n levels
of the LOB on the ask side; similarly, denote by Vtb,n the total volume available in the first n levels of the
LOB on the bid side. Recall that A = {a1 , a2 , . . . , aM } are the identifiers for the algorithms on Euronext,
and B = {b1 , b2 , . . . , bN } are the identifiers for the trading members of Euronext with N ≤ M because a
trading member can have multiple trading algorithms. For ai ∈ A (similar for bi ∈ B) let Vta,n,−ai be the
volume available in the first n levels of the LOB on the ask side when we exclude any volume posted by
36
For a time window δ > 0, we define the volatility of the transaction prices at time t of period δ by
s X
Vδt = |∆ log S̃u |2 , (12)
∆ log S̃u ̸=0 ; u∈[t−δ,t)
where
∆ log S̃u = log S̃u − log S̃u− , and S̃u− = lim S̃v . (13)
v↗u
The above definition extends to other stochastic processes in the paper, that is Yu− = limv↗u Yv for any
càdlàg stochastic process Y . The return at time t of period δ is given by
δ St−
Rt = log . (14)
St−δ
The number of messages at time t and period δ is denoted by Uδt and records the number of messages in
the LOB during the window [t − δ, t). Here, a “message” is an order entry, an order deletion, or an order
amendment.
b
Lastly, for algorithm ai ∈ A and the associated trading member bj ∈ B, we let Qat i and Qt j denote the
bj
ai
intraday accumulated inventory up to time t with the assumption that Q0 = 0 and Q0 = 0, and we let Cat i
b
and Ct j be the accumulated expense (in EUR) of purchases of inventory with the assumption that Ca0 i = 0
b
and C0j = 0. Note that for x ∈ {ai , bj }, the variables Cxt and Qxt change in the same direction, that is, if
inventory goes up then cash goes up and vice-versa. Cash and inventory variables are computed for trading
in Euronext Amsterdam.
We are now able to describe the variables we use as features to describe the way algorithms make decisions
in the market. The set of variables that an algorithm ai ∈ A (of trading member bj ∈ B) has at its disposal
at time t ∈ [0, T ] is given by:
(i) Available volumes in the LOB excluding trading algorithm ai (six variables).
In particular, we use log(1+V ) where V is one of the following variables: Vtx,5,−a
−
i
, Vtx,10,−a
−
i
−Vtx,5,−a
−
i
,
x,20,−ai x,10,−ai
Vt− − Vt− , for x ∈ {a, b}.
(ii) Available volumes in the LOB by trading algorithm ai (six variables).
In particular, we use log(1 + V ) where V is one of the following variables: Vtx,5,a
−
i
, Vtx,10,a
−
i
− Vtx,5,a
−
i
,
x,20,ai x,10,ai
Vt− − Vt− , for x ∈ {a, b}.
(iii) Imbalance in the LOB excluding trading algorithm ai (three variables).
In particular, we use: I(Vtb,5,−a
−
i
, Vta,5,−a
−
i
), I(Vtb,10,−a
−
i
−Vtb,5,−a
−
i
, Vta,10,−a
−
i
−Vta,5,−a
−
i
), and I(Vtb,20,−a
−
i
−
b,10,−ai a,20,−ai a,10,−ai
Vt− , V t− − Vt− ).
37
(xii) Aggressive buys over previous 1, 5, 60 and 360 seconds (four variables).
(xiii) Aggressive sells over previous 1, 5, 60 and 360 seconds (four variables).
(xiv) Volume of last transaction (one variable).
In particular, if the volume of the last transaction is V > 0, we employ log(1 + V ).
b
(xvi) Inventory of trading member Qt−j (one variable).
In particular, we employ
b b
sign Qt−j × log 1 + Qt−j . (16)
In particular, we employ
sign Cat−i × log 1 + Cat−i . (18)
b
(xviii) Cash of trading member Ct−j (one variable)
Z t
b b
Ct j = S̃u dQbuj , C0j = 0 . (19)
0
In particular, we employ
b b
sign Ct−j × log 1 + Ct−j . (20)
38
R1 R2 R3 R4 R5 R6 R7
Dt Pt Vt Pt |Dt = 1 Pt |Dt = −1 Vt |Dt = 1 Vt |Dt = −1
Top 5 64 ± 9 88 ± 9 55 ± 2 91 ± 6 90 ± 7 56 ± 2 56 ± 2
Top 10 65 ± 7 87 ± 12 64 ± 21 90 ± 10 90 ± 10 64 ± 21 64 ± 21
Top 20 71 ± 13 90 ± 12 63 ± 19 92 ± 11 92 ± 10 63 ± 19 63 ± 18
Top 50 75 ± 14 87 ± 15 55 ± 21 88 ± 15 89 ± 14 56 ± 21 55 ± 21
All 78 ± 15 78 ± 22 46 ± 23 75 ± 27 76 ± 28 43 ± 25 42 ± 25
order-weighted average 69 87 60 90 90 61 61
Table 23: Accuracies of the logistic regression models for ING. Twelve train-and-deploy exercises.
Table 24: Outperformance over benchmark for ING. Twelve train-and-deploy exercises.
outperformance
over benchmark over logistic
Dt Pt Vt Dt Pt Vt
Top 5 22 ± 8 0 ± 1 2 ± 9 9 ± 9 0 ±1 2 ± 1
Top 10 20 ± 8 2 ± 4 2 ± 8 6 ± 8 −1 ±2 2 ± 3
Top 20 25 ± 12 2 ± 3 3 ± 9 4 ± 6 −1 ±2 0 ± 4
Top 50 26 ± 13 2 ± 6 2 ± 7 3 ± 6 −1 ±2 2 ± 4
All 25 ± 17 2 ± 7 1 ± 9 1 ± 8 1 ±7 4 ± 8
order-weighted average 23 2 2 5 −1 2
Table 25: Outperformance of random forests over benchmark and logistic regression for ING. Twelve train-
and-deploy exercises.
Table 26 shows the accuracies for AHOLD, Table 27 shows the outperformance of the logistic regressions
over the most frequent bucket, and Table 28 shows the outperformance of random forests over the most
frequent bucket and over logistic regression. Here, Dt has two buckets, the variable Pt has three buckets
and Vt has nine buckets.
39
Top 5 63 ± 7 84 ± 8 58 ± 14 86 ± 6 87 ± 6 58 ± 13 58 ± 14
Top 10 66 ± 9 87 ± 10 66 ± 21 89 ± 9 89 ± 9 66 ± 21 66 ± 21
Top 20 71 ± 13 89 ± 11 67 ± 23 90 ± 10 91 ± 10 67 ± 23 66 ± 23
Top 50 74 ± 14 84 ± 16 53 ± 23 85 ± 15 84 ± 17 55 ± 22 53 ± 23
All 78 ± 16 77 ± 21 42 ± 24 73 ± 28 73 ± 28 39 ± 27 40 ± 25
order-weighted average 69 86 59 87 88 60 59
Table 26: Accuracies of the logistic regression models for AHOLD. Twelve train-and-deploy exercises.
Table 27: Outperformance over benchmark for AHOLD. Twelve train-and-deploy exercises.
outperformance
over benchmark over logistic
Dt Pt Vt Dt Pt Vt
Table 28: Outperformance of random forests over benchmark and logistic regression for AHOLD. Twelve
train-and-deploy exercises.
Table 29 shows the accuracies for TOMTOM, Table 30 shows the outperformance of the logistic regres-
sions over the most frequent bucket, and Table 31 shows the outperformance of random forests over the most
frequent bucket and over logistic regression. Here, Dt has two buckets, the variable Pt has three buckets
and Vt has ten buckets.
R1 R2 R3 R4 R5 R6 R7
Dt Pt Vt Pt |Dt = 1 Pt |Dt = −1 Vt |Dt = 1 Vt |Dt = −1
Top 5 68 ± 15 88 ± 15 57 ± 27 89 ± 15 89 ± 15 58 ± 27 58 ± 26
Top 10 66 ± 13 90 ± 13 61 ± 23 90 ± 13 91 ± 12 61 ± 23 62 ± 23
Top 20 70 ± 15 88 ± 13 62 ± 26 89 ± 12 89 ± 12 62 ± 25 62 ± 26
Top 50 73 ± 13 78 ± 19 51 ± 24 79 ± 18 77 ± 20 50 ± 24 50 ± 24
All 71 ± 24 70 ± 23 44 ± 28 54 ± 38 54 ± 39 31 ± 30 31 ± 30
order-weighted average 67 87 52 88 88 52 52
Table 29: Accuracies of the logistic regression models for TOMTOM. Twelve train-and-deploy exercises.
40
Table 30: Outperformance over benchmark for TOMTOM. Twelve train-and-deploy exercises.
outperformance
over benchmark over logistic
Dt Pt Vt Dt Pt Vt
Top 5 23 ± 16 2 ± 3 7 ± 10 8 ± 9 −1 ± 1 2 ± 2
Top 10 19 ± 15 1 ± 2 4 ± 8 5 ± 7 0±1 1 ± 2
Top 20 22 ± 15 0 ± 2 2 ± 6 5 ± 9 0±1 1 ± 3
Top 50 22 ± 14 1 ± 4 0 ± 6 3 ± 7 0±3 3 ± 3
All 13 ± 19 0 ± 7 0 ± 8 0 ± 13 2 ± 13 6 ± 13
order-weighted average 24 0 5 9 0 2
Table 31: Outperformance of random forests over benchmark and logistic regression for TOMTOM. Twelve
train-and-deploy exercises.
inventory of algo
inventory of member
cash of algorithm
cash of member
imbalance of algo 0-5
best ask volume
best bid volume
return 1s
chg imbalance excl algo 0-5
ask volume of algo 0-5
0 0.05 0.1 0.15 0.2
Figure 9: Most important features to explain the direction of the order for ING using permutation importance
and logistic regressions.
41
Figure 10: Most important features to explain the direction of the order for AHOLD using permutation
importance and logistic regressions.
cash of member
inventory of member
inventory of algo
imbalance of algo 0-5
cash of algorithm
imbalance of algo 6-10
bid volume of algo 0-5
ask volume of algo 0-5
best bid volume
chg imbalance excl algo 6-10
0 0.05 0.1 0.15 0.2
Figure 11: Most important features to explain the direction of the order for TOMTOM using permutation
importance and logistic regressions.
Unlike the case for ASML, inventory or cash related features are the most important features when
predicting Dt for ING, AHOLD, and TOMTOM.
Similar to Figure 3 – where we show the most important features for predicting price bucket Pt , Figure
12 reports the analogous for ING, Figure 13 for AHOLD, and Figure 14 for TOMTOM.
42
Figure 12: Most important features to explain the price bucket Pt for ING using permutation importance
and logistic regressions.
inventory of algo
cash of algorithm
spread
ask volume of algo 0-5
bid volume of algo 0-5
num messages 1ms
inventory of member
cash of member
num messages 0.1ms
num messages 1s
Figure 13: Most important features to explain the price bucket Pt for AHOLD using permutation importance
and logistic regressions.
43
Figure 14: Most important features to explain the price bucket Pt for TOMTOM using permutation impor-
tance and logistic regressions.
Here, spread retains its place as an important feature. Inventory of algorithm and cash of algorithm are
also among the most important features for ING, and AHOLD.
Similar to Figure 4 – where we show the most important features for predicting volume bucket Vt , Figure
15 reports the analogous for ING, Figure 16 for AHOLD, and Figure 17 for TOMTOM.
inventory of member
cash of member
inventory of algo
cash of algorithm
ask volume of algo 0-5
quad var 5m
bid volume of algo 0-5
bid volume excl algo 0-5
agg buy last 360s
num messages 1s
Figure 15: Most important features to explain the volume bucket Vt for ING using permutation importance
and logistic regressions.
44
Figure 16: Most important features to explain the volume bucket Vt for AHOLD using permutation impor-
tance and logistic regressions.
cash of algorithm
inventory of algo
inventory of member
cash of member
bid volume of algo 0-5
ask volume of algo 0-5
spread
num messages 1s
num messages 0.1s
ask volume excl algo 0-5
0 0.1 0.2 0.3 0.4
Figure 17: Most important features to explain the volume bucket Vt for TOMTOM using permutation
importance and logistic regressions.
Consistently across ING, AHOLD, and TOMTOM, the four most important features are either inventory
variables (inventory of algorithm and inventory of member) or cash variables (cash of algoirthm and cash of
member).
45
80
60
Cluster 1
Cluster 2
Cluster 3 40
20
0
44
45
46
47
48
49
50
51
52
1
2
3
week
Figure 18: Size of clusters for ING across the twelve clustering exercises.
80
60
Cluster 1
Cluster 2
Cluster 3 40
20
0
44
45
46
47
48
49
50
51
52
1
2
3
week
Figure 19: Size of clusters for AHOLD across the twelve clustering exercises.
46
Cluster 1
Cluster 2 40
Cluster 3
20
0
44
45
46
47
48
49
50
51
52
1
2
3
week
Figure 20: Size of clusters for TOMTOM across the twelve clustering exercises.
Second, we show the stability of clusters through time using the technique described in Section 4.4.1 to
create Figure 6.
0.9
0.8
0.7
0.6
0.5
45
46
47
48
49
50
51
52
week
Figure 21: Stability of clusters for ING across the twelve train exercises.
47
0.9
0.8
0.7
0.6
0.5
45
46
47
48
49
50
51
52
3
week
Figure 22: Stability of clusters for AHOLD across the twelve train exercises.
0.9
0.8
0.7
0.6
0.5
45
46
47
48
49
50
51
52
week
Figure 23: Stability of clusters for TOMTOM across the twelve train exercises.
Figure 22 and 23 show that the stability of the clusters we obtain for AHOLD and TOMTOM is not good.
In particular, we see that random reshuffling of algorithms produces a similar stability score. Therefore we
do not interpret the clustering results of these two shares. We believe the poor clustering might be due to
the clusters on the first four weeks of data having substantially different sizes than the clusters obtained
on other months of data of the same share (see Figures 19 and 20). If we were to take a clustering on the
second month of data, for example, with clusters whose size is more representative of other months, then
the stability metric would improve.
48
House
13 6 2
LP 27 14 11
Figure 24: Confusion matrix between dealing capacity and clusters obtained on the first four weeks of data
for ING.
Figure 24 shows an “L shape” similar to that in Figure 7. That is: the majority of algorithms are in
cluster 1, with types Liquidity Provider, House and Client all well represented. In cluster 2 we again observe
mostly algorithms with type Liquidity Provider, and the same goes for cluster 3.
Client
9 9 5
House
7 8 4
LP
19 12 18
Figure 25: Confusion matrix between dealing capacity and clusters obtained on the first four weeks of data
for AHOLD.
49
House
14 0 1
LP 20 9 3
Figure 26: Confusion matrix between dealing capacity and clusters obtained on the first four weeks of data
for TOMTOM.
Table 32: Average regression coefficients per cluster on first four weeks of training data for ING when
predicting direction Dt . All excluded features have average coefficients with a magnitude smaller than 0.1
for all clusters.
There are similarities between ASML and ING. For imbalance of the algorithm on the first five levels
we observe a strong positive coefficient for cluster 1, a strong negative coefficient for cluster 2, and we see
cluster 3 lie between the two. These results are consistent with what we observe in ASML. For inventory
of algorithm we observe a strong positive coefficient for cluster 1, a strong negative coefficient for cluster 3,
and cluster 2 is somewhere in between – again consistent with the clustering obtained for ASML, including
the signs of the coefficients. Lastly, we see that imbalances of the algorithm near the top of the LOB have
the largest positive (resp. negative) coefficients for both ASML and ING.
50
Table 33: Average regression coefficients per cluster on first four weeks of training data for AHOLD when
predicting direction Dt . All excluded features have average coefficients with a magnitude smaller than 0.1
for all clusters.
Table 34: Average regression coefficients per cluster on first four weeks of training data for TOMTOM when
predicting direction Dt . All excluded features have average coefficients with a magnitude smaller than 0.1
for all clusters.
51
Table 35: Average regression coefficient for price bucket describing eagerness to trade per cluster on first
four weeks of training data for ING conditioning on the direction of order Dt .
Table 36: Average regression coefficient for price bucket describing eagerness to trade per cluster on first
four weeks of training data for AHOLD conditioning on the direction of order Dt .
52
Table 37: Average regression coefficient for price bucket describing eagerness to trade per cluster on first
four weeks of training data for TOMTOM conditioning on the direction of order Dt .
Table 38: Average regression coefficient for price bucket describing eagerness to trade per cluster on first
four weeks of training data for ING conditioning on the direction of order Dt .
Table 39: Average regression coefficient for price bucket describing eagerness to trade per cluster on first
four weeks of training data for AHOLD conditioning on the direction of order Dt .
53
Table 40: Average regression coefficient for price bucket describing eagerness to trade per cluster on first
four weeks of training data for TOMTOM conditioning on the direction of order Dt .
Table 41: Average regression coefficient for price bucket describing eagerness to trade per cluster on first
four weeks of training data for ING conditioning on the direction of order Dt .
Table 42: Average regression coefficient for price bucket describing eagerness to trade per cluster on first
four weeks of training data for AHOLD conditioning on the direction of order Dt .
54
Table 43: Average regression coefficient for price bucket describing eagerness to trade per cluster on first
four weeks of training data for TOMTOM conditioning on the direction of order Dt .
55