Trump Code: Someone Ran 31 Million Models on 7,400 Presidential Posts to Find Market Signals
One developer. 7,400 posts. 31.5 million model combinations.
The premise is simple: Trump is the only person alive who can move global markets with a single social media post. So someone decided to treat his posting behavior as a signal — not a sentiment, not a vibe — and run actual statistics on it.
The result is Trump Code: an open-source project that has found, verified, and published 551 trading rules that survived two-stage train/test validation. The hit rate across 566 verified predictions is 61.3% with a z-score of 5.39 (p < 0.00001).
That’s not noise.
What the Data Actually Found
The project’s findings table is worth reading carefully:
| Finding | Evidence | Market Impact |
|---|---|---|
| Pre-market RELIEF language | Apr 9, 2025: S&P +9.52% | Avg +1.12% same-day |
| Pure tariff day | Apr 3: -4.84%, Apr 4: -5.97% | Avg -1.057% |
| Silence (zero posts) | 566-day analysis | 80% bullish, avg +0.409% |
| TARIFF→SHORT signal | Circuit breaker analysis | 70% wrong → auto-inverted to LONG |
| Late-night tariff tweets | 62% wrong | Model inverts to LONG |
| 4-signal combo | 12 occurrences, 66.7% up | Avg +2.792% |
The TARIFF→SHORT inversion is the most interesting. The intuition is that when tariff posts hit after hours or late night, the market has already priced in the fear — by open, the move has exhausted itself and the trade is the other way.
The Real Edge: Truth Social Publishes 6.2 Hours Before X
This is the finding that matters most for anyone who wants to act on it.
Of 39 posts analyzed, 38 appeared on Truth Social an average of 6.2 hours before the same content appeared on X (formerly Twitter). If a signal fires at 7 AM on Truth Social, most traders relying on X won’t see it until 1 PM.
That’s not a statistical artifact — it’s a structural information advantage. The developer found 203 China-related signals that appeared on Truth Social and never appeared on X at all. Those get a 1.5x weight boost in the model.
The practical implication: if you’re monitoring presidential posts for market signals, monitoring X is insufficient. Truth Social is the primary source.
How It Works Under the Hood
The methodology is brute-force statistical search:
- Data collection — 7,400+ Truth Social posts scraped from 3 independent sources and cross-verified
- Feature extraction — 316 signal features extracted per post (keywords, timing, platform, tone, length, etc.)
- Model search — 31.5 million combinations of features tested against S&P 500 daily returns
- Survival filtering — two-stage train/test validation; only rules that hold up on out-of-sample data survive
- 551 surviving rules — published openly in
surviving_rules.json - Daily updates — the system scrapes new posts every 5 minutes and runs predictions against the surviving ruleset
The architecture:
Trump posts on Truth Social
↓ (detected every 5 min)
Detect → Classify signals → Dual-platform boost
→ Event pattern check → Snapshot PM + S&P 500
→ Predict → Track at 1h/3h/6h → Verify
Results log in predictions_log.json — publicly auditable.
How to Use It With StockScout
Trump Code is a macro regime filter — it predicts whether today is broadly up or down for the market. StockScout scores individual stocks within the universe.
Used together:
- Check Trump Code signal at 8 AM — is today bullish or bearish regime?
- If bullish: run StockScout picks normally, full position sizing
- If bearish or high-uncertainty: reduce position size or skip entirely
- If pure tariff day signal fires: stay flat
This is exactly the kind of macro overlay the current StockScout v2 intel layer is trying to approximate with geopolitical signals. Trump Code does it empirically, from the actual data.
Caveats Worth Knowing
The 61.3% hit rate is on past data. The model was built on the same administration’s posts — it may have overfit to Trump’s 2025 communication patterns, which he reportedly changed in August 2025 (the project claims to have detected this shift and updated the model).
Hit rate ≠ profitability. 61.3% correct directional calls sounds good. But if the wrong 38.7% of calls are on days with large moves and the right 61.3% are on quiet days, the strategy loses money. The +2.792% average on 4-signal combos is more useful than the headline hit rate.
The repo has a Stripe payment link. The core project is open source, but there may be a premium tier. Everything needed to replicate the analysis is publicly available.
This is a one-person project. Impressive, but not institutionally validated. Treat it as a research artifact, not a production system.
Getting Started
git clone https://github.com/sstklen/trump-code
Key files:
data/surviving_rules.json— all 551 validated rulesdata/predictions_log.json— full prediction history with outcomes- Live dashboard: trumpcode.washinmura.jp
The data updates daily. The rules update as new posts are processed. It’s the kind of project that gets more interesting the longer it runs.
GitHub: sstklen/trump-code · Related: StockScout V1 Backtest Results · MiroFish: Swarm Intelligence Prediction Engine