The Impact of X (Formerly Twitter) Sentiment on Stock Returns Using Machine Learning Models

The financial world is influenced by numerous factors such as social media. Posts on platforms like X (formerly Twitter) may reflect investors’ sentiment and therefore impact the growth of the stock market. In January 2021, Reddit users heavily impacted the Gamestop stock as well as the overall stock market with only a few posts (New York Times, 2021). There exist many similar instances where online statements from individuals or groups changed the direction of a stock (CNBC, 2023). In this study, we analyzed social media data to determine whether different artificial intelligence models can predict the direction of future stock movements. We used Random Forest, K Nearest Neighbors, and Ridge models to analyze 367,666 tweets from X and predict the stocks’ direction of change over the course of 1 day or up to 1 week. The performance of these models was assessed by a common metric, F1 score, ranging from 0 to 1 where 0 indicates poor performance and 1 indicates perfect performance. The evaluated machine learning models predicted the direction with F1 Scores of around 0.8, peaking at 0.9, indicating that tweets and social media posts can be used as a tool to guide financial investment. Further studies can investigate the longevity of the impact of specific tweets, incorporating more tweet-related features such as the counts of retweets, followers, and likes.

Authors

Institutions

Publication Details

Journal
Journal of Student Research
Published
2024-08-31
DOI
https://doi.org/10.47611/jsrhs.v13i3.7416
Primary Topic
Stock Market Forecasting Methods
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

The Impact of X (Formerly Twitter) Sentiment on Stock Returns Using Machine Learning Models

Yunyue Zhang, Ailin Zhang
Journal of Student Research
Stock Market Forecasting Methods
article

The Impact of X (Formerly Twitter) Sentiment on Stock Returns Using Machine Learning Models

Yunyue Zhang, Ailin Zhang
article en

Abstract

The financial world is influenced by numerous factors such as social media. Posts on platforms like X (formerly Twitter) may reflect investors’ sentiment and therefore impact the growth of the stock market. In January 2021, Reddit users heavily impacted the Gamestop stock as well as the overall stock market with only a few posts (New York Times, 2021). There exist many similar instances where online statements from individuals or groups changed the direction of a stock (CNBC, 2023). In this study, we analyzed social media data to determine whether different artificial intelligence models can predict the direction of future stock movements. We used Random Forest, K Nearest Neighbors, and Ridge models to analyze 367,666 tweets from X and predict the stocks’ direction of change over the course of 1 day or up to 1 week. The performance of these models was assessed by a common metric, F1 score, ranging from 0 to 1 where 0 indicates poor performance and 1 indicates perfect performance. The evaluated machine learning models predicted the direction with F1 Scores of around 0.8, peaking at 0.9, indicating that tweets and social media posts can be used as a tool to guide financial investment. Further studies can investigate the longevity of the impact of specific tweets, incorporating more tweet-related features such as the counts of retweets, followers, and likes.

Journal of Student ResearchVol. 13(3)
Grandview Medical Center (US)
Openalex Percentile: Top 63%
Stock Market Forecasting Methods
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.