Do Tweets Help With Stock Prediction?
Exploring the use of Twitter to forecast stock market movements
Created on July 29|Last edited on August 25
Comment

Table of Contents (click to expand)
IntroductionML and Modern FinanceStock Forecasting Using RLFor the PractitionerFor the Team LeadFor the StakeholderSee It in Action
Introduction
As social media has become a critical channel for information, its influence continues to rise in many industries—including the financial sector. One of the most notable effects that come to mind is its impact on the stock market.
Remember that recent GameStop phenomenon? After nearly five years of downward movement, GameStop shares skyrocketed, all thanks to Redditors. Like Reddit, Twitter is another platform that often is a hub for all things related to stock trading. There are endless tweets on the latest news impacting stock prices, trade ideas, swapping tips, and more.
ML and Modern Finance
In recent years, Machine Learning (ML) in finance forecasting has been gaining popularity as end-to-end models are starting to outperform traditional methods. However, the problem of continual learning, where the model updates itself constantly as new data comes in, is still a major issue for ML approaches.
Reinforcement Learning (RL) is an ML approach that has been the most successful at solving the continual learning problem in other contexts. Yet, it hasn't applied to prediction problems in the finance industry until recently.
Now begs the question: can tweets help provide important insights into the direction of stocks and the overall market?
Keep reading to find out.
Stock Forecasting Using RL
No surprise here—we'll be using Weights & Biases to log and visualize metrics, share model insights, and keep track of datasets and evaluation results.
First, we will explore ranges of hyperparameter values that produce an RL model with the highest sharpe ratio on legacy stock market data. Then we will look at whether information from Twitter can help the RL model better predict those stock trends. Doing so will improve the ability to make real-time, dynamic trading decisions and allow for the optimization of portfolio allocation.
The findings of this project will be for specific audiences, all with different roles within a FinTech organization: the practitioner, the team lead, and the stakeholder.
For the Practitioner
Due to the complex nature of RL algorithms, it's important to monitor a variety of metrics and state variables to understand how the agent (in our case, the trader) is interacting with the world (in our case, the market).
W&B makes this easy by providing a clear view of metrics that update live during training. The reports below are crafted for a technical audience who may want to emulate the findings from this project. They contain a granular look at the methodology and resultant findings.
For the Team Lead
The report below gives a team lead or technical manager a view into their team's progression on the project.
While still geared towards a technical audience, this report is more succinct and contains high-level findings. Key metrics and KPIs that will allow a lead to determine if the methodology behind the new findings is feasible for production are also captured here.
For the Stakeholder
A non-technical audience or business stakeholder will likely also be interested in how the technical work in their organization is doing as it will impact trading strategies and the bottom line.
The following report shares the findings of this project in a way that does not require technical expertise. It simply communicates how these new proposed trading strategies are going to provide a positive impact on the business.
See It in Action
A walk-through of the project through a use case.
Add a comment