Stock Tweets

ml
finance
Author

Patrick Deutschmann

Published

November 18, 2021

I recently finished my Bachelor’s degree in business administration at the University of Graz. For my thesis, I combined machine learning with finance. The project is called Sentiment for Price Prediction (SePP), and I’m predicting stock price movements based on investors’ opinions, or at least what they are saying on Twitter about it. The purpose was to examine their tweets’ effect on the stock price – not to get rich or “beat the market”.

Here’s the abstract:

Stock prices are influenced by investors’ beliefs, which many express on social media. As recent advances in machine learning have achieved impressive results in detecting sentiment in human language, this thesis aims to apply them to the task of stock price prediction. We present a machine learning model that takes as input tweets about certain assets, derives their sentiments and predicts whether the stock price will go up or down after that. Our model achieves a new state of the art in prediction accuracy on the StockNet data set and demonstrates that tweet sentiments have a discernible effect on stock prices.

If you’re interested, take a look at the full thesis or the code.

Figure 1: Model architecture

Figure 1 shows one architecture I experimented with: Inputs are tweets about a certain stock on a certain day. The first component detects the sentiments of tweets, for example, if a user expresses positive or negative feelings towards the stock. I used models such as BERT, RoBERTa and ALBERT for that. The sentiments are then weighed by the number of followers the tweet’s author has. Finally, a prediction is made about whether the stock price is likely to go up or down as a reaction.