Deep Learning for Market by Order Data
DDeep Learning for Market by Order Data
Zihao Zhang a , Bryan Lim a and Stefan Zohren a a Oxford-Man Institute of Quantitative Finance, University of Oxford, Oxford, UK.
ARTICLE HISTORY
Compiled February 18, 2021
ABSTRACT
Market by order (MBO) data – a detailed feed of individual trade instructionsfor a given stock on an exchange – is arguably one of the most granular sources ofmicrostructure information. While limit order books (LOBs) are implicitly derivedfrom it, MBO data is largely neglected by current academic literature which focusesprimarily on LOB modelling. In this paper, we demonstrate the utility of MBO datafor forecasting high-frequency price movements, providing an orthogonal source ofinformation to LOB snapshots. We provide the first predictive analysis on MBO databy carefully introducing the data structure and presenting a specific normalisationscheme to consider level information in order books and to allow model training withmultiple instruments. Through forecasting experiments using deep neural networks,we show that while MBO-driven and LOB-driven models individually provide similarperformance, ensembles of the two can lead to improvements in forecasting accuracy– indicating that MBO data is additive to LOB-based features.
KEYWORDS
Market by Order Data; Limit Order Books; Deep Learning; Long Short-TermMemory; Attention.
1. Introduction
High-frequency microstructure data has received growing attention both in academiaand industry with the computerisation of financial exchanges and the increase capacityof data storage. The detailed records of order flow and price dynamics provide uswith a granular description of short-term supply and demand, and we can take thedynamics of order books into account during the modelling process. Propelled by thepublication of the benchmark dataset (Ntakaris et al. 2018) of high-frequency limitorder book (LOB) data, there has been a growing interest in research studying LOBdata. Recent works by Tsantekidis et al. (2017); Sirignano and Cont (2019); Zhang,Zohren, and Roberts (2019a); Briola, Turiel, and Aste (2020) demonstrate that strongpredictive performance can be obtained from modelling high-frequency LOB data andwith resulting predictions finding applications in market-making and trade executionwhich have short holding periods.In this work, we introduce Market by Order (MBO) data for predictive modellingwith deep learning algorithms. MBO data provides full resolution of the underlyingmarket microstructure – with both LOB data and trade sequences being derived from
CONTACT Zihao Zhang. Email: [email protected] a r X i v : . [ q -f i n . T R ] F e b t. A LOB is a record of all outstanding limit orders (passive orders) for an instrumentat a given time point and it is sorted into different levels based on submitted prices.At each price level, a LOB only shows the total available quantity. However, any givenprice level actually consists of many individual orders with different sizes. MBO datais essentially a message-base data feed that allows us to infer the individual queueposition for each individual order by reconstructing the order book step by step. Adetailed description of MBO data and how it relates to LOB data is presented inSection 3.Despite MBO data being the original raw data source, current literature on high-frequency predictive modelling focuses predominantly on LOBs and, to the best ofour knowledge, MBO data has not been used for direct predicting modelling. In thiswork, we propose a first deep learning model based on MBO data. In particular, weadopt a classification framework to predict stock price movements by using MBOdata. In doing so, we provide a complete analysis of MBO by carefully introducingthe data structure and the components of the message-base data feed. A specific datanormalisation scheme is introduced to model level information contained in LOBs andto allow model training with multiple instruments. Our dataset consists of MBO dataover a period of one year for five highly liquid instruments from the London StockExchange. Our testing set contains millions of samples to verify the robustness andgeneralisation of the results.In our proposed models, we apply deep learning architectures including LSTMs(Hochreiter and Schmidhuber 1997) and Attention mechanisms (Bahdanau, Cho, andBengio 2014) to model the dynamics of MBO data for market predictions. Our ex-periments show consistent and robust results from MBO data that are comparable tomodels that utilise derived LOB data. We observe that predictive models based onMBO data are complementary to LOB models and we propose an ensemble approachwhich yields superior results. As such, we observe that MBO data adds diversificationto the LOB model and improves prediction performance.The remainder of the paper is organised as follows. After a short literature reviewin Section 2, we proceed in Section 3 by introducing MBO data, including data prepro-cessing, normalisation and labelling. Section 4 presents deep learning architectures. Wenext describe our experiments and present the results of predicting market movementsfrom MBO data in Section 5. We conclude our findings and discuss promising futureextensions in Section 6.
2. Literature
Research on the high-frequency microstructure data remains largely focused on mod-elling the limit order book (LOB), where the classical works are referred to O’Hara(1995); Harris (2003) and a review is presented in Gould et al. (2013). However, there islimited work on MBO data in the current literature. NASDAQ (OUCH 2020) and CMEGroup (CME 2020) provide a preliminary description on MBO data for introducingtheir exchange match engines, and the works of Byrd, Hybinette, and Balch (2019);Belcak, Calliess, and Zohren (2020) use MBO data for market simulation to modeltrading scenarios or to study latency effects. To the best of our knowledge, this paperis the first to use MBO data to predict market movements, filling in this literature gapby using deep learning models.Deep Learning (Goodfellow et al. 2016) algorithms have been heavily used for2redicting high-frequency microstructure data (Tsantekidis et al. 2017; Sirignano andCont 2019; Briola, Turiel, and Aste 2020; Wallbridge 2020). In particular, Zhang,Zohren, and Roberts (2018, 2019a,b) apply convolutional neural networks and LSTMsto model the dynamics of LOB and demonstrate accuracy improvements over linearmodels. Unlike traditional time-series models (Mills and Mills 1991; Hamilton 2020)or econometric models (Fama and French 1993) that assume a parametric processfor the underlying time-series, deep learning methods are able to capture arbitrarynonlinear relationships without placing any specific assumptions on the input data.Our experiments also suggest that deep networks deliver better results than linearmethods for modelling MBO data.We investigate deep learning models, including LSTMs (Hochreiter and Schmidhuber1997) and Attention (Bahdanau, Cho, and Bengio 2014), to model MBO data. Attentionis used to solve the problem of diminishing performance with long input sequencesby utilising information at each hidden state of a recurrent network (Bahdanau, Cho,and Bengio 2014; Dai et al. 2019), and it can be used for constructing multi-horizonforecasting models (Lim and Zohren 2020). Our experiment suggests that networkswith a recurrent nature lead to good predictive results compared to the state-of-artnetworks trained with LOB data, suggesting the potential benefits of using MBO dataas an additional data source.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that allows us to observe individual actions ofmarket participants. Essentially, it is an order instruction that describes the actionof a specific trader at a given time point. In what follows, we focus on the essentialcomponents of such messages ignoring certain auxiliary information. Table 1 shows anexample of sequences of MBO data, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Type indicates the order type, here limit order (Type = 1) or market order(Type = 2); • Side indicates whether an order is buy (1) or sell (2); • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe matching engine will be able to identify and cancel the existing order usingthe unique ID; • Price shows the price level of the instruction; • Size shows the size (i.e. number of stocks) of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Data Preprocessing and Normalisation
We focus on MBO data that represents limit orders because market orders only accountfor a tiny percentage of total order flow. Figure 2 illustrates the process of datapreprocessing and normalisation. In particular, we process the MBO data for an uniqueID as: • Side and Price:
Missing values correspond to updates and cancellations andwe fill those with the corresponding values from the original order of that ID; • Size:
Missing values correspond to full cancellation and we fill those with 0 toindicate that no shares are outstanding after the action; • Action: we change Action to have values -1, 0 and 1. -1 means cancelling anorder, 0 means updating price or size for the existing order and 1 means addinga new order; • Change price and
Change size : We add these two new features to calculatethe difference between entries for the price and size of a specific ID to reflect theintention of adding or decreasing positions for the given order.Data preprocessing is applied to every unique order ID and we then normalise the dataas: • Normalised price : (price - mid-price) / (minimum tick size × Thiscalculation transforms price to tick change, representing how many ticks the priceis away from the mid-price. The deviation of minimum tick size is needed whenwe train models with multiple instruments as it maps price to a similar scale; • Normalised size : size / mid-size. Mid-size is the mean between the current bestask and bid size, which is similar to mid-price. • Normalised change price : change price / minimum tick size; Mid-price is the mean between the best ask and bid price. Those references prices and their sizes which weuse below can be obtained on the fly from the MBO data.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Price (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Price (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Price (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Price (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Table 2.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Table 3.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Table 4.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Table 5.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size book updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential marketimpact by knowing individual queue positions.
Data Preprocessing and Normalisation
Since the raw MBO data contains missing entries, we preprocess the data and thenmake the normalisation. Figure 2 illustrates the complete process of data preprocessingand normalisation. We process the MBO data for an unique ID as: • Side and Price: we fill in the missing entries with previous values; • Size: we fill in the missing entry as 0 to indicate that this order is cancelled; • Action: we change Action to have values -1, 0 and 1. -1 means cancelling anorder, 0 means updating price or size for the existing order and 1 means addinga new order; • Change price and
Change size : we add these two new features to calculatethe di↵erence between entries for the price and size of a specific ID to reflect theintention of adding or decreasing positions for the given order.4
Table 2.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Table 3.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Table 4.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Table 5.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size book updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential marketimpact by knowing individual queue positions.
Data Preprocessing and Normalisation
Since the raw MBO data contains missing entries, we preprocess the data and thenmake the normalisation. Figure 2 illustrates the complete process of data preprocessingand normalisation. We process the MBO data for an unique ID as: • Side and Price: we fill in the missing entries with previous values; • Size: we fill in the missing entry as 0 to indicate that this order is cancelled; • Action: we change Action to have values -1, 0 and 1. -1 means cancelling anorder, 0 means updating price or size for the existing order and 1 means addinga new order; • Change price and
Change size : we add these two new features to calculatethe di↵erence between entries for the price and size of a specific ID to reflect theintention of adding or decreasing positions for the given order.4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Price (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Price (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Table 2.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Table 3.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Table 4.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
Table 5.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size book updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential marketimpact by knowing individual queue positions.
Data Preprocessing and Normalisation
Since the raw MBO data contains missing entries, we preprocess the data and thenmake the normalisation. Figure 2 illustrates the complete process of data preprocessingand normalisation. We process the MBO data for an unique ID as: • Side and Price: we fill in the missing entries with previous values; • Size: we fill in the missing entry as 0 to indicate that this order is cancelled; • Action: we change Action to have values -1, 0 and 1. -1 means cancelling anorder, 0 means updating price or size for the existing order and 1 means addinga new order; • Change price and
Change size : we add these two new features to calculatethe di↵erence between entries for the price and size of a specific ID to reflect theintention of adding or decreasing positions for the given order.4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Price (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
BidAsk Bid Ask PriceSize time: t
PriceSize time: t+1Bid Ask
3. Market by Order3.1.
Descriptions of Market by Order
MBO is a message-base data feed that provides individual queue position and we canview price and quantity for each individual order. Essentially, it is an order instructionthat describes the action of a specific trader at a given time point. In this work, wefocus on MBO that represents limit orders because market orders only account for atiny percentage of total order flow. Table 1 shows an example of a sequence of MBOfor a single security, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for trader identification; • Side indicates which side of the order book the order is placed, where 0 meanscancelled order, 1 means bid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan old order; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in FigureMarket by Order provides individual orders for all price levels (not restricted to top10). Each order is assigned an anonymous OrderID for identification and a PriorityIDfor sorting.Participant queue position can be determined by using the OrderID. Queue positionand proper sorting of book is done using PriorityID. PriorityID may change if ordermodified or refreshed, OrderID is consistent for the life of the order.3
Figure 1.
A slice of a LOB at time t (Top). When a message of MBO flows in, we have a new update forLOB (Bottom) at time t+1.
Sizetime: t time: t + 1A LOB updates whenever there is a new message of MBO flowing in and this processis illustrated in Figure 1. In the example, a new limit order (ID=462805645163273214)is added to the ask side of the order book with price at 70.04 and size of 3024. The orderbook updates its status and the new order is added to the right price level. In general, aLOB only shows the total available quantity at each price level but MBO data providesus with extra information by showing individual behaviours. Although, MBO datadoes not directly indicate which price level the order is added to, our normalisationscheme introduced in the next section allows us to consider this information and wenot only obtain a smaller input space but also obtain relevant information comparablewith LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential market4 (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Price (2018, 2019a,b) apply convolutional neural network and LSTM to model the dynamicsof LOB and demonstrate promising predictive results. Unlike traditional time-seriesmodels (Mills and Mills 1991; Hamilton 2020) or econometric models (Fama and French1993) that assume a parametric process for the underlying time-series, deep learningmethods are able to capture arbitrary nonlinear relationships without placing specificassumption on the input data. Our experiment also suggest that deep networks deliverbetter results than linear methods for modelling MBO data.In this work, we investigate recent developed techniques including Attention (Bah-danau, Cho, and Bengio 2014) and Transformer (Vaswani et al. 2017) to demonstratethe e↵ectiveness of modelling MBO data. Attention is used to solve the problem ofdiminishing performance with long input sequence by utilising information at eachhidden state of a recurrent network, and Transformer is designed to allow for parallelcomputing to speed up the training process. The work of Wallbridge (2020) studiesTransformers for LOB data and we adopt the Temporal Fusion Transformer (Limet al. 2019), a novel attention-based architecture designed specifically for time-series,to predict price movements from MBO data. Our experiment shows good predictiveresults, suggesting the potential ability of modelling MBO data in place of LOB.
3. Market by Order Data3.1.
Descriptions of Market by Order Data
MBO data is a message-base data feed that provides individual queue position andwe can view price and quantity for each individual order. Essentially, it is an orderinstruction that describes the action of a specific trader at a given time point. Inthis work, we focus on MBO data that represents limit orders because market ordersonly account for a tiny percentage of total order flow. Table 1 shows an example of asequence of MBO data for a given instrument, where: • Time stamp records the time point when an instruction is given; • ID shows the unique ID for order identification which is anonymous to others; • Side indicates which side of the order book the order is placed, where 1 meansbid side and 2 means ask side; • Action represents the specific instruction where 0 means updating the price orsize for the existing order, 1 means adding a new order and 2 means cancellingan existing order. If Action = 2, the entries of Side, Price and Size are N/A asthe match engine will cancel the existing order using the unique ID; • Price shows the price level of the instruction; • Size shows the position of the instruction.
Table 1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Table 2.
An example of a sequence of market by order data.
Time stamp ID Type Side Action Price Size
A LOB updates whenever there is a new message from the MBO data coming in andthis process is illustrated in Figure 1, where we show how a market order and threedi↵erent actions a↵ect a LOB. For example, if we look at the top of Figure 1, a newlimit order (ID=46280) is added to the ask side of the order book with price at 70.04and size of 7580. The order book updates its status and the new order is added to theright price level. In general, a LOB only shows the total available quantity at eachprice level but MBO data provides us with extra information by showing individualbehaviours. Although, MBO data does not directly indicate which price level the orderis added to, our normalisation scheme introduced in the next section allows us toconsider this information and we not only obtain a smaller input space but also obtainrelevant information comparable with LOB data.In addition, the usage of MBO data increases transparency and improves theunderstanding of order book dynamics without disclosing customer identification.Although, we can access to unique order ID but this number is generally assignedsequentially by the exchange match engine (CME 2020) and a private link is providedto the customer, which keeps identification confidential. Further, unlike LOB datawhere we sometimes only view limited price levels, MBO data allows us to observe theentire order book with full-depth information. Such a granularity can improve traders’confidence in posting large order size as they can better evaluate the potential marketimpact by knowing individual queue positions.
Data Preprocessing and Normalisation
Since the raw MBO data contains missing entries, we preprocess the data and then makethe normalisation. We focus on MBO data that represents limit orders because marketorders only account for a tiny percentage of total order flow. Removing market ordersalso allows us to compare models trained with MBO data and LOB data respectively.Figure 2 illustrates the process of data preprocessing and normalisation and we processthe MBO data for an unique ID as: • Side and Price: we fill in the missing entries with previous values; • Size: we fill in the missing entry as 0 to indicate that this order is cancelled; • Action: we change Action to have values -1, 0 and 1. -1 means cancelling anorder, 0 means updating price or size for the existing order and 1 means addinga new order; • Change price and
Change size : we add these two new features to calculatethe di↵erence between entries for the price and size of a specific ID to reflect theintention of adding or decreasing positions for the given order.Data preprocessing is applied to every unique order ID and we then normalisa thedata as: • Normalised price : (price - mid-price ) / (minimum tick size ⇥ Mid-price is the mean between the best ask and bid price. Figure 1.
An illustration of how MBO data updates a LOB.
Top:
An addition of a new limit order;
Middletop:
A cancellation of an existing order;
Middle bottom:
An update for a partial cancellation;
Bottom:
Amarketable buy limit order that crosses the spread. able B1. An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Table B2.
An example of a sequence of market by order data.
Time stamp Side Action Price Size
Changeprice Changesize
Mid-price Mid-size
Table B3.
An example of a sequence of market by order data.
Time stamp Side Action Nor. price Nor. size
Nor. changeprice Nor. changesize Table B1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Table B2.
An example of a sequence of market by order data.
Time stamp Side Action Price Size
Changeprice Changesize
Mid-price Mid-size
Table B3.
An example of a sequence of market by order data.
Time stamp Side Action Nor. price Nor. size
Nor. changeprice Nor. changesize Table B1.
An example of a sequence of market by order data.
Time stamp ID Side Action Price Size
Table B2.
An example of a sequence of market by order data.
Time stamp Side Action Price Size
Changeprice Changesize
Mid-price Mid-size
Table B3.
An example of a sequence of market by order data.
Time stamp Side Action Nor. price Nor. size
Nor. changeprice Nor. changesize Data Preprocessing and Normalisation
Since the raw MBO data contains missing entries, we preprocess the data and thenmake the normalisation. Figure 2 illustrates the complete process of data preprocessingand normalisation. We process the MBO data for an unique ID as: • Side and Price: we fill in the missing entries with previous values; • Size: we fill in the missing entry as 0 to indicate that this order is cancelled; • Action: we change Action to have values -1, 0 and 1. -1 means cancelling anorder, 0 means updating price or size for the existing order and 1 means addinga new order; • Change price and
Change size : we add these two new features to calculatethe di↵erence between entries for the price and size of a specific ID to reflect theintention of adding or decreasing positions for the given order.Data preprocessing is applied to every unique order ID and we then normalisa thedata as: • Normalised price : (price - mid-price ) / (minimum tick size ⇥ • Normalised size : size / mid-size. Mid-size is the mean between the current bestask and bid size, which is similar to mid-price. • Normalised change price : change price / minimum tick size; • Normalised change size : change size / mid-size. • Side and Action : same.At the end, we remove “Time stamp” and “ID”, leading to 6 features in our featurespace. Note that the normalised price essentially represent the price level at where thecurrent order is in the order book, taking the level information into account.
Data preprocessing
Data normalisation
Data Labelling
In this work, we study a classification framework where we want to predict the futuremarket movements into three classes: market going up, staying stationary or goingdown. We use mid-price to create labels and adopt the labelling method in Zhang,Zohren, and Roberts (2019a) to decide movements: l t = m + ( t ) m ( t ) m ( t ) ,m ( t ) = 1 k k X i =0 p t i ,m + ( t ) = 1 k k X i =1 p t + i , (1) Mid-price is the mean between the best ask and bid price. Data Preprocessing and Normalisation
Since the raw MBO data contains missing entries, we preprocess the data and thenmake the normalisation. Figure 2 illustrates the complete process of data preprocessingand normalisation. We process the MBO data for an unique ID as: • Side and Price: we fill in the missing entries with previous values; • Size: we fill in the missing entry as 0 to indicate that this order is cancelled; • Action: we change Action to have values -1, 0 and 1. -1 means cancelling anorder, 0 means updating price or size for the existing order and 1 means addinga new order; • Change price and
Change size : we add these two new features to calculatethe di↵erence between entries for the price and size of a specific ID to reflect theintention of adding or decreasing positions for the given order.Data preprocessing is applied to every unique order ID and we then normalisa thedata as: • Normalised price : (price - mid-price ) / (minimum tick size ⇥ • Normalised size : size / mid-size. Mid-size is the mean between the current bestask and bid size, which is similar to mid-price. • Normalised change price : change price / minimum tick size; • Normalised change size : change size / mid-size. • Side and Action : same.At the end, we remove “Time stamp” and “ID”, leading to 6 features in our featurespace. Note that the normalised price essentially represent the price level at where thecurrent order is in the order book, taking the level information into account.
Data preprocessing
Data normalisation
Data Labelling
In this work, we study a classification framework where we want to predict the futuremarket movements into three classes: market going up, staying stationary or goingdown. We use mid-price to create labels and adopt the labelling method in Zhang,Zohren, and Roberts (2019a) to decide movements: l t = m + ( t ) m ( t ) m ( t ) ,m ( t ) = 1 k k X i =0 p t i ,m + ( t ) = 1 k k X i =1 p t + i , (1) Mid-price is the mean between the best ask and bid price. Figure 2.
An example of preprocessing and normalising the MBO data. • Normalised change size : change size / mid-size. • Side and Action : remain unchanged.At the end, we remove “Time stamp” and “ID”, leading to 6 features in our featurespace. Note that the normalised price essentially represent the price level where thecurrent order is in the order book, taking the level information into account.
Data Labelling
In this work, we study a classification framework where we want to predict the futuremarket movements into three classes: the market going up, staying stationary or goingdown. We use mid-prices to create labels and adopt the labelling method in Zhang,Zohren, and Roberts (2019a) to classify movements. In particular, we define l t = m + ( t ) − m − ( t ) m − ( t ) ,m − ( t ) = 1 k k − (cid:88) i =0 p t − i ,m + ( t ) = 1 k k (cid:88) i =1 p t + i , (1) By mid-size we denote the mean of best bid and ask size, in analogy to mid price. Those values again areobtained on the fly from the MBO data. k is the prediction horizon and p t is the mid-price at time t . To decide on thelabel we compare l t with a threshold ( α ), labelling it as up if l t > α , down if l t < − α and stationary otherwise. The choice of α is related to the prediction horizon ( k ) andwe set α for each instrument to obtain a balanced training set. Our choices of k and α are listed in Section 5 and we show that the dataset are balanced under our choice.Note that Equation (1) introduces a smooth labelling that leads to consistent labelsthat are better for designing trading signals and the work of Zhang, Zohren, andRoberts (2019a) includes a more detailed discussion demonstrating the effects ofdifferent labelling methods. Interested readers are referred to their work for a detailedexplanation.
4. Methodology
In this section, we introduce the different deep learning algorithms studied in our work.For a single input of any time-series, we write x T , where x t represents the features attime t and T is the length of the sequence which will later correspond to the length ofthe lookback of the input. Multilayer perceptrons (MLPs)
MLPs are canonical neural network models where a typical network is organised into aseries of layers in a chain structure, with each layer being a function of the layer thatprecedes it. We can define the hidden layer of a MLP as: h ( l ) = g ( l ) ( W ( l ) h ( l − + b ( l ) ) , (2)where h ( l ) ∈ R N l represents the l -th hidden layer with weights W ( l ) ∈ R N l × N l − andbiases b ( l ) ∈ R N l . Here g ( l ) ( · ) is the activation function that allows networks to modelnonlinearities. The final output is a function of the last hidden layer and we computeobjective functions to minimise errors between target outputs and estimates.However, for MLPs, we first need to flatten x T and feed it to subsequent hiddenlayers. Doing this breaks the time dependences and treats features at different timestamps independently. We generally observe inferior results using MLPs and find thatrecurrent neural networks (RNNs) often deliver better performance. This is becausea RNN acts as a memory buffer by summarising past information and recursivelyupdating the hidden state with new observations at each time step of the input (Zhang,Zohren, and Roberts 2020a). Long Short-Term Memory (LSTMs)
Standard RNNs suffer from vanishing or exploding gradient problems (Bengio, Simard,and Frasconi 1994) and Long Short-Term Memory networks (LSTMs) are proposedto solve this problem. This is done by operating a gating mechanism that efficientlycontrols the propagation of past information (Hochreiter and Schmidhuber 1997). ALSTM updates its hidden state recursively and has a cell state c t coupled with a series7f gates at each hidden state. In mathematical terms, we can writeInput gate: i t = σ ( W i,h h t − + W i,x x t + b i ) , with W i,h ∈ R N h × N h , W i,x ∈ R N h × N x and b i ∈ R N h , Output gate: o t = σ ( W o,h h t − + W o,x x t + b o ) , with W o,h ∈ R N h × N h , W o,x ∈ R N h × N x and b o ∈ R N h , Forget gate: f t = σ ( W f,h h t − + W f,x x t + b f ) , with W f,h ∈ R N h × N h , W f,x ∈ R N h × N x and b f ∈ R N h , (3)where h t − is the hidden state of a LSTM at time t − σ ( · ) represents the sigmoidactivation function. We use W and b to represent weights and biases at different gateoperations. Subsequently, the current cell state and hidden state can be written as:Cell state: c t = f t (cid:12) c t − + i t (cid:12) tanh( W c,h h t − + W c,x x t + b c ) , Hidden state: : h t = o t (cid:12) tanh( c t ) , (4)where W c,h ∈ R N h × N h , W c,x ∈ R N h × N x , b c ∈ R N h , (cid:12) is the element-wise product andtanh( · ) is the hyperbolic tangent activation function. The hidden state h t summarisesthe information from past states and current observations, and the gating mechanismefficiently addresses the vanishing gradient problem. Attention Mechanism
The Attention Mechanism (Bahdanau, Cho, and Bengio 2014) is heavily used in machinetranslation and is proposed to solve the problem of diminishing performance for longinput sequences. On the one hand, a LSTM calculates the final output as a function ofonly the last hidden state. An attention model, on the other hand, with an additionalcomponent called context vector, assigns trainable weights to all the hidden states ofan input. We can write an attention mechanism for modelling many-to-one problem as: h t = f t ( h t − , x t ) , (5)where h t can be the hidden state from a LSTM at time t for an input x T , and wedefine the context vector c T as:Convext vector: c T = T (cid:88) t =1 α ( t, T ) h t , Attention weights: α ( t, T ) = exp ( e ( t, T )) (cid:80) Tt =1 exp ( e ( t, T )) , Score: e ( t, T ) = v T tanh( W h h t ) , (6)where v ∈ R N h and W h ∈ R N h × N h are the trainable weights. We can then obtain theattention vector: a T = f ( c T , h T ) = tanh( W c [ c T ; h T ]) , (7)8 able 2. Label parameters ( α ) for different predictionhorizons and instruments (units in 10 − ).LLOY BARC TSCO BT VODk = 20 0.25 0.35 0.10 0.40 0.22k = 50 0.50 0.65 0.70 0.70 0.45k = 100 0.75 0.95 1.20 1.00 0.70 where the final output is a function of c T , taking information at every hidden stateinto account.
5. Experiments5.1.
Descriptions of Datasets
Our datasets consist of MBO data for five highly liquid stocks, Lloyds (LLOY), Barclays(BARC), Tesco (TSCO), BT and Vodafone (VOD), for the entire year of 2018 fromthe London Stock Exchange. From the MBO data one can derive LOB data whichwe use for our benchmarks and for references prices. Our LOB dataset contains askand bid information for an order book up to ten levels. For our modelling we removemessages outside ten levels from the MBO data to align the timestamps of two datasetsallowing for fair comparisons in the performance analysis. Afterwards, we train twosets of models by separately using the MBO and LOB data with the same targets.A direct comparison can be then made to compare predictive performance using theMBO and LOB data respectively.For each trading day, we take the data between 08:30:00 and 16:00:00, restrictingourselves to liquid continuous trading hours, excluding any auctions. Overall, we havemore than 169 million samples in our dataset and we take the first 6 months as trainingdata, the next 3 months as validation data and the last 3 months as testing data.In the context of high-frequency microstructure data, we have more than 46 millionobservations in our testing set, providing sufficient scope for verifying the robustnessand generalisability of model performance.We test our models at three prediction horizons ( k = 20 , , α ) in Table 2. We choose α for each instrument to have abalanced training set and the proportion of different classes is presented in Figure B1in Appendix B. Overall, the labels are roughly balanced for the testing set as well(noting that those were fixed on the training set). In terms of the lookback window ( T )of the input, we take the 50 most recent updates of MBO data to form a single inputand feed it to our model. Training Procedure
For the MBO data, we study the deep learning models (MBO-MLP, MBO-LSTM andMBO-Attention) introduced in Section 4 along with a simple linear model (MBO-LM).We list the values of hyperparameters for different algorithms in Table 3, and theGradient descent with the Adam optimiser (Kingma and Ba 2015) is used for trainingall models. The complete search space of hyperparameters is included in Appendix Aand we use a grid-search method to select best hyperparameters.For the LOB data, we include the 10 levels of a limit order book and past 50observations as a single input. We follow the normalisation scheme in Zhang, Zohren,9 B O - L M M B O - M L P M B O - L S T MM B O - A tt e n t i o n L O B - L M L O B - M L P L O B - L S T M L O B - C N N L O B - D ee p L O B MBO-LMMBO-MLPMBO-LSTMMBO-AttentionLOB-LMLOB-MLPLOB-LSTMLOB-CNNLOB-DeepLOB M B O - L M M B O - M L P M B O - L S T MM B O - A tt e n t i o n L O B - L M L O B - M L P L O B - L S T M L O B - C N N L O B - D ee p L O B M B O - L M M B O - M L P M B O - L S T MM B O - A tt e n t i o n L O B - L M L O B - M L P L O B - L S T M L O B - C N N L O B - D ee p L O B Figure 3.
Pearson correlation between different predictive signals for different prediction horizons ( k ). Top: k = 20; Middle: k = 50; Bottom: k = 100. and Roberts (2019a) and both the MBO and LOB datasets share the same predictivetargets, allowing a direct comparison between different models. We choose state-of-artnetwork architectures as comparison models, including the LOB-LSTM (Sirignanoand Cont 2019), LOB-CNN (Tsantekidis et al. 2017) and LOB-DeepLOB (Zhang,Zohren, and Roberts 2019a). The details of the network architecture and choices ofhyperparameters can be found in their papers. We also include a linear model (LOB-LM)and a multilayer perception (LOB-MLP) as benchmark models.We use categorical cross-entropy loss as our objective function and the learning isstopped when the validation loss does not decrease for more than 10 epochs. In general,it takes about 30 epochs to finish model training. TensorFlow and Keras (Girija 2016)are used to build all models and four NVIDIA GeForce RTX 2080 are used in ourexperiment. Table 3.
Choices of hyperparameters.
LM - - 0.0001 128 903MLP 1 64 0.0001 128 19459LSTM 2 64 0.0001 128 51907Attention 2 64 0.0001 128 72067
Experimental Results
Table 4 summarises the results for all models studied (different rows) and one suitablefor each different prediction horizons. We use four evaluation metrics (different columns)to make comparisons: Accuracy, Precision, Recall and F1-score. Kolmogorov-Smirnov(Massey Jr 1951) tests are used to check the statistical significance of results and alldifferences in evaluation metrics are significant.We observe that the models trained with LOB data are comparable, but slightlyoutperform the ones using MBO data. While a priori, MBO data contains moreinformation (contents of level and trades), it is harder to model the raw messages ratherthan LOB snapshots when can be seen as derived or handcrafted features from the MBOdata. What is encouraging is that we are able to obtain comparable performance bymodelling the raw messages directly. Furthermore, if we look at the Pearson correlationbetween predictive signals in Figure 3, we can see that predictive signals from the MBOdata are less correlated with LOB’s signals. This means that we were indeed able to10 able 4.
Experimental results for different prediction horizons ( k ). Model Accuracy % Precision % Recall % F1 %Prediction horizon k = 20
MBO-LM 41.81 41.16 41.81 34.97MBO-MLP 47.12 46.17 47.12 46.46MBO-LSTM 61.94 61.60 61.94 61.75MBO-Attention 61.19 62.83 61.19 61.73LOB-LM 45.71 43.44 45.71 42.38LOB-MLP 50.06 50.04 50.06 46.89LOB-LSTM 66.09 67.53 66.09 66.68LOB-CNN 63.39 67.31 63.39 64.64LOB-DeepLOB 68.73 68.16 68.73 68.40Ensemble-MBO 62.35 62.92 62.35 62.56Ensemble-LOB 67.97 68.74 67.97 68.31Ensemble-MBO-LOB
MBO-LM 41.88 38.42 41.88 36.57MBO-MLP 46.39 43.07 46.39 42.33MBO-LSTM 58.84 59.65 58.84 59.18MBO-Attention 59.31 56.10 59.31 56.88LOB-LM 46.97 44.34 46.97 41.13LOB-MLP 50.56 48.46 50.56 47.25LOB-LSTM 64.49
MBO-LM 41.27 34.23 41.27 35.05MBO-MLP 44.19 42.70 44.19 40.29MBO-LSTM 57.96 54.10 57.96 54.79MBO-Attention 56.36 53.66 56.36 53.75LOB-LM 46.19 43.29 46.19 41.80LOB-MLP 48.36 47.39 48.36 43.66LOB-LSTM 61.27 58.47 62.82 57.97LOB-CNN 61.78 56.91 61.78 55.40LOB-DeepLOB 62.82 extract different information from the MBO data. It also suggests that a combinationof two signals, from MBO and LOB data, can benefit from diversification that reducessignal variance given the low correlation.To verify this statement, we include three ensemble models in our experiment,where Ensemble-MBO is obtained from MBO-LSTM and MBO-Attention; Ensemble-LOB is from LOB-LSTM, LOB-CNN, and LOB-DeepLOB; and Ensemble-MBO-LOBcombines Ensemble-MBO and Ensemble-LOB. A equal weighting scheme is used toconstruct ensemble models and we can observe that ensemble approaches, in general,improve predictive performance. In particular, Ensemble-MBO-LOB delivers the bestperformance, indicating the potential benefits of combining the MBO and LOB data.Since this work aims to study MBO data, we focus on analysing results fromthe models trained using the MBO data. We can see that the deep learning modelsoutperform the simple linear model, suggesting the existence of nonlinear features in11 own Stationary Up D o w n S t a t i o n a r y U p Down Stationary Up
Down Stationary Up
Down Stationary Up
Down Stationary Up D o w n S t a t i o n a r y U p Down Stationary Up
Down Stationary Up
Down Stationary Up
Down Stationary Up D o w n S t a t i o n a r y U p Down Stationary Up
Down Stationary Up
Down Stationary Up
Figure 4.
Normalised confusion matrices for different prediction horizons ( k ). Top: k = 20; Middle: k = 50; Bottom: k = 100. From the left to right, we display MBO-LM, MBO-MLP, MBO-LSTM and MBO-Attention. financial time-series, and networks are capable of extracting such features from the rawmessages in MBO data. We observe that MBO-MLP delivers inferior results comparedto other networks. This is most liekly due to the structure of the MLP which has fullconnectivity between input and hidden units – leading MLPs to often underperformwhen compared to other networks in financial applications with low signal-to-noiseratio. MBO-LSTM and MBO-Attention all have a recurrent structure with parametersharing that enables hidden states to summarise past information and update statuswith current observations. Such a process filters unnecessary input components andnaturally models the propagation of order flow. This observation has also been reportedby Lim, Zohren, and Roberts (2019); Zhang, Zohren, and Roberts (2020b,a) wherethey find that networks with a recurrent nature deliver better results than MLPs whenmodelling financial time-series.Figure 4 shows the normalised confusion matrices which helps to understand howmodels perform at predicting each label class. We calculate the accuracy score forevery instrument and for each testing day to understand the consistency of our results.This is summarised in the whisker plots in Figure 5. Each point in the whisker plotrepresents the accuracy score for one testing day, and we make the box represents themedian and interquartile range from these scores. We can see that the MBO-LM andMBO-MLP have large interquartile ranges, suggesting high variances in results, whileMBO-LSTM and MBO-Attention show consistent and robust results across the entiretesting period. These whisker plots allow us to understand the model performance ona daily basis to ensure the generalisability of our methods. In particular, we see thatperformance is consistent across the entire testing period and not focused on a fewdays which could be due to noise. 12 LOY BARC TSCO BT VODStock0.20.30.40.50.60.70.8 A cc u r a c y MBO-LMMBO-MLPMBO-LSTMMBO-Attention
LLOY BARC TSCO BT VODStock0.30.40.50.60.7 A cc u r a c y MBO-LMMBO-MLPMBO-LSTMMBO-Attention
LLOY BARC TSCO BT VODStock0.30.40.50.60.7 A cc u r a c y MBO-LMMBO-MLPMBO-LSTMMBO-Attention
Figure 5.
Whisker plots of daily accuracy for different prediction horizons ( k ). Top: k = 20; Middle: k = 50; Bottom: k = 100.
6. Conclusion
In this work we introduce deep learning models for Market by Order (MBO) data. Tothe best of our knowledge this is the first study of predictive modelling of MBO datausing data-driven techniques in the academic literature. Current academic researchin this direction is primarily focused on LOB data and we hope that this work helpsto popularise the usage of MBO which we see as the next frontier in microstructuremodelling in financial data science.We carefully introduce the structure of MBO data and demonstrate a specificnormalisation scheme that allows model training with multiple instruments using deeplearning. We consider a wide range of deep learning architectures including MLP,LSTM and attention layers. Our dataset consists of millions of sample for highlyliquid instruments from the London Stock Exchange, ensuring the consistency andgeneralisability of our methods.We compare models trained using MBO and LOB data respectively. We show that wecan obtain similar, but slightly inferior, performance by modelling raw MBO messages,when compared to modelling LOB data. While MBO data a priori contains moreinformation, it is harder to model the raw messages rather than LOBs, which can beseen as derived features of the data. Importantly, we show that our models can extract13dditional information from the MBO data which is not captured by models trainedon LOB data. This means that they can add additional value as we demonstrate in anensemble approach that combines signals from the MBO and LOB data and deliversthe best performance.In subsequent continuation of this work, we can apply MBO data to various financialapplications including market-making or trade execution. Further, the work of Briolaet al. (2021) applies Reinforcement Learning (RL) algorithms to high-frequency trading,and it would be interesting to test the effectiveness of using MBO data within a RLframework.
Acknowledgement(s)
The authors would like to thank members of Machine Learning Research Group at theUniversity of Oxford for their useful comments. We are most grateful to the Oxford-ManInstitute of Quantitative Finance for computing support and data access.
References
Bahdanau, Dzmitry, Kyunghyun Cho, and Yoshua Bengio. 2014. “Neural machine translationby jointly learning to align and translate.” arXiv:1409.0473 .Belcak, Peter, Jan-Peter Calliess, and Stefan Zohren. 2020. “Fast Agent-Based SimulationFramework of Limit Order Books with Applications to Pro-Rata Markets and the Study ofLatency Effects.” arXiv:2008.07871 .Bengio, Yoshua, Patrice Simard, and Paolo Frasconi. 1994. “Learning long-term dependencieswith gradient descent is difficult.”
IEEE transactions on neural networks
Available at SSRN 3714230 .Briola, Antonio, Jeremy Turiel, Riccardo Marcaccioli, and Tomaso Aste. 2021. “Deep Rein-forcement Learning for Active High Frequency Trading.” arXiv:2101.07107 .Byrd, David, Maria Hybinette, and Tucker Hybinette Balch. 2019. “Abides: Towards high-fidelity market simulation for AI research.” arXiv:1904.12066 .CME. 2020. “Market by Order (MBO).” .Dai, Zihang, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhut-dinov. 2019. “Transformer-xl: Attentive language models beyond a fixed-length context.” arXiv:1901.02860 .Fama, Eugene F, and Kenneth R French. 1993. “Common risk factors in the returns on stocksand bonds.”
Journal of financial economics
33 (1): 3–56.Girija, Sanjay Surendranath. 2016. “TensorFlow: Large-scale machine learning on heterogeneousdistributed systems.”
Software available from tensorflow. org
39 (9).Goodfellow, Ian, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. 2016.
Deep learning .Vol. 1. MIT press Cambridge.Gould, Martin D, Mason A Porter, Stacy Williams, Mark McDonald, Daniel J Fenn, andSam D Howison. 2013. “Limit order books.”
Quantitative Finance
13 (11): 1709–1742.Hamilton, James Douglas. 2020.
Time series analysis . Princeton university press.Harris, Larry. 2003.
Trading and exchanges: Market microstructure for practitioners . OUPUSA.Hochreiter, Sepp, and J¨urgen Schmidhuber. 1997. “Long short-term memory.”
Neural computa-tion
Proceedings of the International Conference on Learning Representations . im, Bryan, and Stefan Zohren. 2020. “Time series forecasting with deep learning: A survey.” arXiv:2004.13408 .Lim, Bryan, Stefan Zohren, and Stephen Roberts. 2019. “Enhancing Time-Series MomentumStrategies Using Deep Neural Networks.” The Journal of Financial Data Science https://jfds.pm-research.com/content/early/2019/09/09/jfds.2019.1.015 .Massey Jr, Frank J. 1951. “The Kolmogorov-Smirnov test for goodness of fit.”
Journal of theAmerican statistical Association
46 (253): 68–78.Mills, Terence C, and Terence C Mills. 1991.
Time series techniques for economists . CambridgeUniversity Press.Ntakaris, Adamantios, Martin Magris, Juho Kanniainen, Moncef Gabbouj, and AlexandrosIosifidis. 2018. “Benchmark dataset for mid-price forecasting of limit order book data withmachine learning methods.”
Journal of Forecasting
37 (8): 852–866.O’Hara, Maureen. 1995.
Market microstructure theory . Vol. 108. Blackwell Publishers Cambridge,MA.OUCH. 2020. “NASDAQ, OUCH.” .Sirignano, Justin, and Rama Cont. 2019. “Universal features of price formation in financialmarkets: Perspectives from deep learning.”
Quantitative Finance
19 (9): 1449–1459.Tsantekidis, Avraam, Nikolaos Passalis, Anastasios Tefas, Juho Kanniainen, Moncef Gabbouj,and Alexandros Iosifidis. 2017. “Forecasting stock prices from the limit order book usingconvolutional neural networks.” In , Vol. 1, 7–12. IEEE.Wallbridge, James. 2020. “Transformers for limit order books.” arXiv:2003.00130 .Zhang, Zihao, Stefan Zohren, and Stephen Roberts. 2018. “BDLOB: Bayesian deep convolutionalneural networks for limit order books.”
Third workshop on Bayesian Deep Learning (NeurIPS2018), Montr ˜A © al, Canada .Zhang, Zihao, Stefan Zohren, and Stephen Roberts. 2019a. “DeepLOB: Deep convolutionalneural networks for limit order books.” IEEE Transactions on Signal Processing
67 (11):3001–3012.Zhang, Zihao, Stefan Zohren, and Stephen Roberts. 2019b. “Extending Deep Learning Modelsfor Limit Order Books to Quantile Regression.”
Proceedings of Time Series Workshop of the36 th International Conference on Machine Learning, Long Beach, California, PMLR 97,2019 .Zhang, Zihao, Stefan Zohren, and Stephen Roberts. 2020a. “Deep learning for portfolio opti-mization.”
The Journal of Financial Data Science
The Journal of Financial Data Science
Appendix A. Complete Search Space for HyperparametersLinear Model (MBO-LM) : • Learning rate: [0.0001, 0.0005, 0.001] • Minibatch Size: [64, 128, 256]
Multi-layer Perceptron (MBO-MLP) : • Number of hidden layer: [1, 2, 3] • Number of neurons at each layer: [32, 64, 128] • Learning rate: [0.0001, 0.0005, 0.001] • Minibatch Size: [64, 128, 256]
Long Short-Term Memory (MBO-LSTM) :15
Number of hidden layer: [1, 2, 3] • Number of neurons at each layer: [32, 64, 128] • Learning rate: [0.0001, 0.0005, 0.001] • Minibatch Size: [64, 128, 256]
MBO-Attention : • Number of hidden layer: [1, 2, 3] • Number of neurons at each layer: [32, 64, 128] • Learning rate: [0.0001, 0.0005, 0.001] • Minibatch Size: [64, 128, 256]
Appendix B. Additional Results
Train Validation Test05101520253035 P r o p o r t i o n o f C l a ss e s i n % DownStationaryUp
Train Validation Test0510152025303540 P r o p o r t i o n o f C l a ss e s i n % DownStationaryUp
Train Validation Test05101520253035 P r o p o r t i o n o f C l a ss e s i n % DownStationaryUp
Figure B1.
Label class balancing for train, validation and test sets for different prediction horizons ( k ). Top: k = 20; Middle: k = 50; Bottom: k = 100.= 100.