← All Projects
2025Shipped

TrumpLine — Tweet-to-Market AI

Can a tweet move a stock? I built a system to find out.

PythonDjangoReactNLPVADERGradient BoostingSentiment AnalysisPostgreSQL
View on GitHub →

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

01

Collected and preprocessed a dataset of Trump tweets paired with corresponding stock price deltas (open-to-close) for the same trading day.

02

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.

03

Engineered features from sentiment scores, tweet metadata (time of day, retweet count), and ticker mentions.

04

Trained a Gradient Boosting classifier to predict directional movement (up/down) on the S&P 500 and selected individual stocks.

05

Built a Django REST API backend and a React frontend dashboard for visualizing tweet sentiment vs. price movement over time.

06

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

PythonDjangoPostgreSQL

Frontend

ReactTailwind CSS

ML / NLP

VADERGradient BoostingScikit-LearnPandasNumPy
← Back to all projects