TrumpLine — Tweet-to-Market AI
Can a tweet move a stock? I built a system to find out.
What
TrumpLine is a full-stack market intelligence system that analyzes Donald Trump's tweets and attempts to predict stock price direction using NLP sentiment analysis and a Gradient Boosting classifier.
Why
The 2024 election cycle made it obvious that political speech — especially from high-visibility figures — moves markets. I wanted to quantify that relationship rather than just observe it anecdotally. The question was: can you build a pipeline that turns raw tweet text into a directional signal before the market prices it in?
How I built it
Collected and preprocessed a dataset of Trump tweets paired with corresponding stock price deltas (open-to-close) for the same trading day.
Applied VADER (Valence Aware Dictionary and sEntiment Reasoner) for tweet-level sentiment scoring — chosen for its strong performance on informal, short-form social media text.
Engineered features from sentiment scores, tweet metadata (time of day, retweet count), and ticker mentions.
Trained a Gradient Boosting classifier to predict directional movement (up/down) on the S&P 500 and selected individual stocks.
Built a Django REST API backend and a React frontend dashboard for visualizing tweet sentiment vs. price movement over time.
Connected the system to a PostgreSQL database for storing processed tweet records and model predictions.
Challenges
Tweet data is extremely noisy — sarcasm, hyperbole, and political rhetoric don't map cleanly to sentiment scores.
Market direction has hundreds of confounding factors; isolating the tweet signal required careful feature engineering.
Aligning tweet timestamps to market hours and trading windows needed custom preprocessing logic.
Outcome
The classifier achieved directional accuracy meaningfully above baseline on high-engagement tweets — particularly those mentioning specific sectors or companies by name. The project is ongoing with plans to extend to real-time tweet streaming.
Tech Stack
Backend
Frontend
ML / NLP