How to Use Deep Order Flow Imbalance

Order book information is crucial for traders, but it can be complex. With the numbers of stocks listed in stock exchanges, it is impossible to track all the available information for the human mind. Therefore, the order flows could be an interesting dataset for machine learning models. The novel research of Kolm, Turiel and Westray (2021) utilizes deep-learning for high-frequency return forecasts for 115 NASDAQ stocks based on order book information at the most granular level.

The paper has several key contributions. Firstly, it does not forecast one single return but rather a whole vector of returns – a term structure consisting of mid-price return forecasts at a specified horizon. The forecasted term structure provides essential information about the most optimal execution algorithms (or a trading strategy). According to the authors, forecasts have an „accuracy peak“ at two price changes, after which the accuracy declines. Secondly, the paper compares several methods: autoregressive model with exogenous inputs, MLP, LSTM, LSTM-MLP, stacked LSTM, and CNN-LSTM. Therefore, the article could also serve as a horse race across several possible forecasting methods. Lastly, using more traditional statistical approaches, the authors have identified a better forecasting performance in more information-rich stocks. As a result, this novel research could benefit many areas such as high-frequency trading (but trading costs must be considered), optimal execution strategy, or market-making.

As always, we present several interesting figures:

Notable quotations from the academic research paper:

“In this article we employ deep learning (DL) in forecasting high-frequency returns at multiple horizons for 115 stocks traded on Nasdaq using order book information at the most granular level. In the last decade, DL has experienced enormous success, outperforming more traditional approaches in areas such as image classification, computer vision and natural language processing. A key reason for this success is that DL learns suitable representations directly from the raw data, unlike conventional machine learning (ML) approaches where features are designed by hand and frequently involve domain expertise. Artificial neural networks (ANNs) have proven to be particularly good at extracting intricate relationships in complex and high-dimensional settings without human input, especially when trained on large amounts of raw data. Although counterintuitive from the perspective of traditional statistical and ML techniques, where the researcher uses handcrafted features and progresses from simpler to more complex models.

In the majority of these studies, model inputs are represented as raw or transformed time series of order book states (one major exchange is chosen in the case of fragmented markets) and the return forecasting problem is formulated as a classification task, where a single forecasting horizon is chosen to be either a deterministic time interval such as two seconds, or a stochastic time interval such as until the next price change. A notable exception is the work of M¨akinen et al. (2019) that forecasts the arrival of jumps in one-minute ahead stock returns. In a recent article, Rahimikia et al. (2021) examine the performance of forecasting realized volatility with LSTMs using order book data from LOBSTER and news sentiment derived from Dow Jones Newswires.

The objective of the classification frameworks in the literature is to predict the sign of the return over the specified horizon (two classes), or whether prices will go up, down or not change (three classes). The most common approach to create class labels is by smoothing forward prices using moving averages over some prespecified forecast horizon, and then to assign labels based on thresholding. While these labeling methods provide a form of regularization by removing noise, they introduce ad hoc modeling parameters that are undesirable in real-world trading applications. In particular, with the exception of special cases, there is no canonical way to perform such labeling.

The present article makes four main contributions to the literature on highfrequency return forecasting in limit order books. First, in contrast to the previous literature, we formulate the forecasting problem as one of regression to avoid issues associated with that of training classifiers. Unlike the most common regression setup where the forecast is a scalar, we deploy a multi-output regression framework where the model for each stock outputs a vector we refer to as an alpha term structure. Each element of the alpha term structure represents a mid-price return forecast at a specified horizon. Alpha term structures render representations of the timescales over which alpha may rise and/or decay that are very useful in real-world trading. For instance, they can be used in designing order placement strategies in optimal execution and market making, and other high frequency trading strategies. In addition, contrary to many previous studies that use classification, our regression setup obviates the need for any smoothing of the dependent variables.

Second, we perform a large-scale forecasting horse race with common ANNs, including an MLP, LSTM, LSTM-MLP, stacked LSTM and CNN-LSTM, trained on different inputs including limit order book states for the first ten (non-zero) levels and data derived from the order book. Besides our CNN-LSTM, that is similar in spirit to the architecture used by Zhang et al. (2018), all other models are standard “off-the-shelf” ANNs. Sourced from LOBSTER, our dataset consists of order book events timestamped to nanosecond precision for 115 Nasdaq stocks for the period January 1, 2019 through January 31, 2020. In contrast to many previous studies, we do not downsample our data but work directly with the raw limit order book states. We demonstrate that while limit order book states, which are a complex non-stationary multivariate process, can be used directly as inputs for the ANN models, forecasting performance can be improved significantly by training the models on stationary inputs. In particular, we show that ANNs trained on order flow, stationary quantities derived from the limit order book (Cont et al., 2014), significantly outperform most models that are trained directly on order book states.

Third, using cross-sectional regressions we link the forecasting performance of the LSTM model to stock characteristics at the market microstructure level. We show that “information-rich” stocks, defined as stocks that have a higher number of order book updates per price change, can be forecasted more accurately by DL models.

Fourth, by leveraging the multi-output regression setup we analyze the shape of the alpha term structure from the models. Specifically, we show that stocklevel alphas peak at a time scale of about two price changes and decline thereafter. Notably, in their recent work, Zhang et al. (2021b) deploy a multi-horizon design. However, they use a classification setup and their Seq2Seq architecture of Cho et al. (2014) is quite different from the ANNs we use.”

Are you looking for more strategies to read about? Sign up for our newsletter or visit our Blog or Screener.

Do you want to learn more about Quantpedia Premium service? Check how Quantpedia works, our mission and Premium pricing offer.

Do you want to learn more about Quantpedia Pro service? Check its description, watch videos, review reporting capabilities and visit our pricing offer.

Are you looking for historical data or backtesting platforms? Check our list of Algo Trading Discounts.

Or follow us on:

Facebook Group, Facebook Page, Twitter, Linkedin, Medium or Youtube

Share onRefer to a friend

Subscribe for Newsletter

Be first to know, when we publish new content

    The Encyclopedia of Quantitative Trading Strategies

    Log in

    - bi-weekly research insights -
    - tips on new trading strategies -
    - notifications about offers & promos -