A machine learning approach to modelling social media sentiment for stock market trading in South Africa
Loading...
Date
Authors
Researcher ID
Supervisors
Journal Title
Journal ISSN
Volume Title
Publisher
North-West University (South-Africa)
Record Identifier
Abstract
The influence of sentiment and emotions on financial markets has increased markedly with the proliferation of social media data. However, empirical research on sentiment-driven trading strategies and their performance, particularly within the South African stock market context, remains limited. This study addresses this gap by developing a sentiment- and emotion-based trading framework, grounded in South African data and tailored to the Johannesburg Stock Exchange (JSE). The framework integrates Natural Language Processing (NLP) and machine learning techniques to model the relationship between media-derived sentiment and emotions and subsequent stock price movements. A dataset of South African newspaper articles published between January 2018 and June 2024 was compiled and processed using lexicon-based sentiment scoring, in conjunction with supervised machine learning classifiers. Multiple pre-processing techniques and class balancing approaches were evaluated to address sentiment class imbalance. Stock price data for selected JSE-listed companies were collected, and correlation, lag, and position analyses were conducted to examine sentiment-price relationships. Hyperparameter tuning and optimisation techniques were applied to refine sentiment and emotion thresholds towards generating optimal trading signals. The Long Short-Term Memory (LSTM) model demonstrated superior performance, achieving robust classification results. The optimised sentiment and emotion thresholds were tested for the seven selected financial stocks and generated a hypothetical 26.07% average growth over the chosen testing period.This research contributes to both academic and practical domains by presenting a trading framework specifically designed for an emerging South African market context. The findings demonstrate the potential of localised sentiment analysis in enhancing stock trading strategies and provide a methodological basis for integrating emotion-driven signals into market prediction models. The framework offers scope for further development using daily sentiment and emotion data to enhance predictive power and adaptability in dynamic market conditions.
Sustainable Development Goals
Industry, Innovation and Infrastructure
Description
Thesis, (PHD(Computer Science and Information Systems)) -- North-West University, Potchefstroom , 2026.
