Machine Learning for Forecasting Mid Price Movement using Limit Order Book Data

Paraskevi Nousi, Avraam Tsantekidis, Nikolaos Passalis, Adamantios Ntakaris, Juho Kanniainen, Anastasios Tefas, Moncef Gabbouj, Alexandros IosifidisarXiv 2018

TL;DR

This paper establishes robust machine learning baselines for predicting stock mid-price movements using high-frequency Limit Order Book (LOB) data. By evaluating Support Vector Machines (SVM), Single Hidden Layer Feedforward Networks (SLFN), and Multilayer Perceptrons (MLP) across various temporal feature representations, the authors demonstrate that traditional ML can effectively capture complex market dynamics in real-time, with MLPs delivering the best predictive performance.

What Problem Does This Paper Address?

Forecasting stock price movements is notoriously difficult due to the noisy, non-stationary nature of financial time series. Traditional statistical models often rely on unrealistic assumptions, such as assuming limit order events follow a stationary Poisson distribution. In reality, market dynamics shift rapidly within milliseconds.

The authors tackle this challenge by focusing on the highest resolution of market data available: the Limit Order Book (LOB). Specifically, they aim to predict the direction of the mid-price (the average of the best bid and ask prices) over short horizons. The core challenge lies in effectively extracting temporal information from massive, highly imbalanced data streams while satisfying the strict real-time processing constraints of High-Frequency Trading (HFT).

Methods

The paper proposes a structured pipeline combining handcrafted financial features with unsupervised feature learning and traditional classifiers:

  1. Feature Engineering & Temporal Representations: Starting with 144 handcrafted features (including spreads, price differences, and intensity indicators), the authors use a sliding window of length 5 to capture temporal dynamics. They propose four representations:
  2. last: The current time step snapshot.
  3. mean: The average of the 5 window samples.
  4. last ⊕ mean: The concatenation of the current snapshot and the window average.
  5. concat: The full concatenation of all 5 window samples.
  6. Feature Learning (Dimensionality Reduction): To optimize inference speed, they test two unsupervised methods: Autoencoders (AE) to compress the 144 features down to 24, and Bag-of-Features (BoF) to quantize the time series into 128-dimensional histograms.
  7. Classifiers: They benchmark three distinct architectures:
  8. Linear SVM trained via Stochastic Gradient Descent (SGD).
  9. SLFN utilizing Radial Basis Function (RBF) neurons with hidden weights determined via $k$-means clustering.
  10. MLP consisting of two hidden layers (512 neurons each) optimized using the ADAM algorithm.
  11. Class Imbalance Handling: Because the market frequently experiences periods of "no change," the dataset is heavily skewed. The authors counter this by introducing class weights inversely proportional to class frequencies during training.

Datasets

The models are trained and evaluated on a large-scale, high-frequency LOB dataset provided by Nasdaq Nordic.

  • Scope: 5 Finnish companies (Kesko Oyj, Outokumpu Oyj, Sampo, Rautaruukki, and Wärtsilä Oyj) tracked over 10 consecutive business days in June 2010.
  • Size: The raw data comprises roughly 4.5 million messages. By extracting one feature vector for every 10 LOB-modifying events, they generate a benchmark dataset of 453,975 feature vectors.

Key Insights and Ideas

  • Temporal Context is Crucial: Models incorporating past information (concat and last ⊕ mean) consistently outperform those looking only at the current snapshot (last).
  • Averaging Acts as a Denoising Filter: Remarkably, the mean representation significantly outperforms the last representation, despite having the exact same dimensionality (144 features). This indicates that simple temporal averaging effectively dampens market microstructure noise and suppresses outliers.
  • Supervised Feature Extraction Wins: While unsupervised feature learning (AE and BoF) successfully reduces dimensionality and speeds up computation, it degrades classification accuracy when used alone. The MLP excels because its hidden layers perform supervised feature extraction, shaping representations specifically to minimize classification error.
  • Cross-Stock Generalization: Using a "hold-out per stock" evaluation setup, the authors proved that a model trained on a subset of stocks can successfully generalize to an entirely unseen stock, capturing universal market properties rather than ticker-specific anomalies.

Key Results

  • Performance: The MLP achieved the highest overall metrics, yielding macro F-scores of up to ~56% in walk-forward setups. Statistical validation (Friedman and Nemenyi post-hoc tests) confirmed that both MLP and SVM significantly outperform the SLFN architecture.
  • Speed: To be viable for HFT, models must process data in fractions of a millisecond. In empirical testing on a mid-range GPU:
  • SVM was the fastest, taking just 0.068 ms per prediction (>14,000 transactions/sec).
  • MLP required 0.144 ms per prediction (~7,000 transactions/sec), easily clearing the bar for real-time deployment.

Limitations and Future Work

A primary limitation is that purely unsupervised feature learning techniques (AE and BoF) harm predictive performance when isolated from handcrafted features, as they do not account for class boundaries. Additionally, the SLFN model suffered from a high rate of false negatives (low recall) due to the unsupervised nature of its clustering-based hidden layer.

The authors note that these traditional ML models are intended to serve as solid, easily tunable baselines. They pave the way for future research into advanced Deep Learning architectures—such as Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs/LSTMs)—which can natively exploit spatial and temporal structures in LOB data without relying on handcrafted features.

Summary updated

BibTeX
@misc{nousi2018machine,
  author = {Paraskevi Nousi and Avraam Tsantekidis and Nikolaos Passalis and Adamantios Ntakaris and Juho Kanniainen and Anastasios Tefas and Moncef Gabbouj and Alexandros Iosifidis},
  title = {{Machine Learning for Forecasting Mid Price Movement using Limit Order Book Data}},
  year = {2018},
  eprint = {1809.07861},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1809.07861},
}
Figure