Researchers from VTB and HSE University-St Petersburg have come up with an algorithm for predicting stock price fluctuations in the Russian market by analysing financial news. By making financial projections for next week (or month), the novel STTM (Stock Tonal Topic Modelling) algorithm can help investors build more effective financial strategies. The paper has been published in PeerJ Computer Science.
Is it possible to predict stock performance? According to one of the top theories of investment, the efficient market hypothesis, stocks always trade at a fair value that reflects all publicly available information capable of affecting their price. Therefore, it should be impossible to build an effective investment strategy just by analysing such information and any stock projections based on it.
This, however, does not stop investors from trying to predict stock market performance. A variety of approaches have been proposed which can be grouped into two main types: projections based on past trends in share prices and those using external information such as financial statements, news, and expert opinion. However, no universally accepted algorithm has been available so far for predicting company performance in the stock market based on financial news flow.
Researchers from VTB and HSE University-St Petersburg have developed a new method for projecting stock price fluctuations based on financial news analysis— STTM (Stock Tonal Topic Modelling). This algorithm uses two types of data: changes in stock prices over time and financial news, complete with a topic modelling and tonality framework to improve the accuracy of projections. This model is the first of its kind developed specifically for the Russian financial market.
The STTM algorithm collects news from major Russian media outlets which cover business, finance and politics (such as Kommersant, Vedomosti and RIA Novosti), and sorts the news flow by topic (eg sports, politics, economics or business) using the LDA and DTM topic modelling algorithms. Keywords in topic clusters are identified, and their tonality defined as positive, negative or neutral. Additionally, the STTM approach involves tracking stock price changes of Russian companies over time, eg over the previous week. Based on a combination of price fluctuations, news topics and tonality, the STTM index is computed. When its value is more than one, the stock price is likely to go up, and when it is less than one, the price is likely to fall.
The STTM algorithm pipeline / A. Ryabykh et al. / Peer J Computer Science 2022
The researchers analysed more than 197,000 economic articles from major Russian media sources and used time-series data on the most liquid Russian stocks collected over eight years, from 2013 to 2021. The Granger causality test was applied to test the STTM approach: the authors explored the causal relationship between the news flow broken down by topic and stock price fluctuations.
Additionally, the authors considered a trading strategy based on the model’s projections and assessed it using the Sharpe ratio that measures the performance of an investment portfolio. According to the researchers, their method can support a fairly accurate prediction of stock price fluctuations and outperforms 26 existing models in terms of Sharpe ratio.
We were not the first to come up with the idea of analysing news to predict stock quotes, but we were the first to introduce this model designed for the Russian market. We were also the first to use topic modelling and tonality to predict stock behaviour in the market considering a variety of topics. Our model can be customised to suit specific needs, eg users can select the media outlet, time interval, topic modelling algorithm, and even the language.
The STTM algorithm currently supports weekly stock projections, and the code is publicly available at Zenodo.
Study co-author, Leading Research Fellow at the Laboratory for Social and Cognitive Informatics, HSE Campus in St Petersburg