AI to predict the market evolution

sparkling ai

AI to predict financial markets: Researchers at Oxford University, in partnership with Man Group, have developed a machine learning program that can predict stock prices. The researchers report an 80% success rate over a 30-second period of live trading. Gautier Soubrane, Sales Director – Western Europe, Middle East and Africa at Graphcore explains how.

Predicting stock price movements is the dream.

To date, the most successful predictions are for a 1 or 2 millisecond move – which is not very long. Work by researchers at the Oxford-Man Institute of Quantitative Finance could change that. Using approaches based on natural language processing and IPUs (Intelligence Processing Units), the research team has greatly reduced the training time of multi-horizon forecasting models to predict market movements. 

Read also Price personalization through AI

Order books: a source of data

To train their model, the researchers draw on the limit order book, which lists all the buy orders at a given time, i.e. several million orders, each of which contains information on the buy and sell price as well as a time stamp for the execution. By sifting through this liquidity book algorithmically, it is then possible to determine a trajectory for market movements in one direction or the other and, above all, the decisive moment to carry out a transaction.

Moving from a single horizon to a multiple horizon

To gain in accuracy, the Oxford team implemented a multi-horizon analysis, where this type of AI analysis has previously used a single-horizon forecast to correlate order prices and market prices in a defined and above all unique time window. Indeed, single-horizon supervised learning is limited by the multitude of factors to take into account and the signal-to-noise ratio to obtain a reliable forecast. In contrast, multihorizon forecasting studies price movements over a series of intervals, with the results of each horizon informing the next. By aggregating these windows, forecasts cover a longer time frame.

NLP to the rescue of multihorizon

To develop this multi-horizon approach, the research team drew inspiration from natural language processing by using Seq2seq and Attention models based on complex recurrent neural layers comprising an encoder and a decoder. The Seq2Seq encoder summarizes information from past time series and the decoder combines the hidden states with known future inputs to generate predictions. The Attention model, on the other hand, addresses the limitations of Seq2Seq models adapted to short sequence processing.

Stefan Zohren, a researcher at the Oxford-Man Institute (OMI) points out that this model can be compared to a program that translates a sentence from English to French by building inferences incrementally.

We’ve done comparative tests with a wide range of interesting edge networks and found that IPUs are at least several times faster than mainstream GPUs. To put a number on it, I think it’s at least 10 times faster.

Dr. Zhang

A gain of more than 30 seconds on predictions

In fact, the limit order book (LOB) data was used to train a number of models on the IPU, including one – DeepLOB – developed by the same IMO team (Zhang et al, 2019). In terms of multi-horizon prediction, the researchers tested two variants of DeepLOB, named DeepLOB-Seq2Seq, and DeepLOB-Attention, which use Seq2Seq and Attention models as decoders, respectively.

These new models provided superior prediction accuracy both at shorter time horizons, such as K=10, and, more importantly, at longer time horizons, such as K=50 and K=100. In this case, K represents the “tick time”, the time at which messages are received at the exchange. This is a natural time that ticks faster for more liquid stocks and slower for less liquid stocks.

To put it another way, the algorithm was able to determine the price direction over a period of 100 ticks, or roughly a prediction that could range from 30 seconds to 2 minutes depending on market conditions! Based on these initial results, Dr. Zohren is very optimistic about the future:

Reinforcement learning algorithms provide an excellent framework for applying these multi-horizon predictions in an optimal execution or market-making context. Given the computational complexity of these algorithms, the speed gains achieved with IPUs could be even greater in this setting.