Sentiment in Donald Trump’s Public Statements and FX Market Dynamics
An empirical examination of communication and exchange rate behavior
predictive analytics
financial markets
political communication
sentiment analysis
classification
regularization
Python
Author
A. Srikanth
Published
December 19, 2025
Project Spotlight
Context
This project started with a simple (slightly chaotic) question: when Donald Trump fires off an emotionally loaded post about another country, does the U.S. dollar actually react?
Instead of treating this like a vague “markets respond to news” claim, we framed it as a measurable pipeline problem: take unstructured text (Tweets/Truth Social posts), convert it into a sentiment signal, link each post to a specific country (and therefore a currency), and then test whether FX prices and volatility move in the window right after those posts land. The focus wasn’t to build a magic trading bot. It was to build something reproducible and honest that connects behavioral signals to market data, then see what survives contact with reality.
Objectives
The work in this project had four main parts. The first was to engineer a reliable Tweet/Truth pipeline that could be re-run without manual intervention, including scraping, parsing, sentiment scoring, and country detection. The second was to engineer an exchange rate pipeline that pulls a consistent daily time series for a small set of currency pairs, stored in a modular way so joins and validation are simple.
The third part was exploratory and diagnostic: quantify how many posts exist in the sample, how many contain direct foreign country mentions, and how sentiment behaves overall and by country. The last part was the most practical stress test. If extreme sentiment really creates tradable uncertainty, then a direction-neutral long-volatility structure like a straddle should at least have a chance. I implemented a threshold-based long straddle backtest to see whether realized moves after extreme posts were large enough to overcome the option premium.
Data Sources
The text data came from a one-year social media archive of Donald Trump’s posts hosted on rollcall.com, collected across a trailing 12-month window in late 2024 to late 2025. Raw pages were saved locally as HTML to support offline parsing, avoid partial downloads, and make the pipeline reproducible. Each post was then enriched with a VADER sentiment score and metadata such as date and source, plus extracted country mentions and mapped currencies.
The market data came from Yahoo Finance via yfinance, using daily closing exchange rates for four USD-referenced currency pairs: GBP/USD, INR/USD, JPY/USD, and CAD/USD. Each currency pair was stored in its own CSV so the time series could be updated independently and anomalies could be traced without breaking the full dataset.
Analysis
The first takeaway from the exploratory analysis was scale. Over the one-year window, the dataset contained 6,897 posts, and posting frequency stayed high throughout the period, often above twenty posts per day during the election season. For the FX question, that firehose is mostly noise, because most posts do not reference a foreign country directly. After filtering to posts that contain direct country mentions and including common abbreviations, the dataset shrank from nearly 7,000 posts to roughly 400 FX-relevant posts.
Those country-mention posts were mostly focused on a single country at a time, which matters because it reduces ambiguity when aligning a post to a single currency. There were multi-country posts too, usually in comparative statements, and those tended to show slightly stronger sentiment polarization because they emphasize contrast, praising one partner while criticizing another.
Sentiment itself was more balanced than the stereotype suggests. Using VADER compound polarity, approximately half of the posts scored as positive. When sentiment was segmented by country, Japan showed the highest average positive sentiment, Canada and India were more mixed, and the United Kingdom sat near the middle. That distribution shaped the working hypothesis for the rest of the analysis: the more useful signal is not direction, it is intensity. Extreme sentiment can coincide with short-term volatility in USD pairs, but it is unlikely to deliver durable or directional predictability in price movement.
Methodology
The Truth/Tweet pipeline was built to be transparent and repeatable using lightweight tools. Collection was automated with a Fish shell script (fetch_and_save_trump_tweets.fish) to handle repeated runs needed under rate limits. Sentiment analysis was performed in Python using NLTK and VADER because it is designed for social media text and remains interpretable. Country identification was implemented with a regex scan over post text, backed by pycountry to standardize names and reduce false matches. Those country hits were then mapped to currencies using a programmatic dictionary built from pycountry plus forex-python, producing a consistent country to currency linkage for downstream joins.
The exchange rate pipeline pulled daily closes with yfinance for GBP/USD, INR/USD, JPY/USD, and CAD/USD, and wrote each series to its own CSV. This kept the workflow modular and made the merge step straightforward, since correlations and event-window checks can be run per currency without mixing time series.
To test whether extreme sentiment can monetize volatility, a long straddle backtest was implemented. Since proprietary FX options chains were not available, synthetic weekly options with a fixed premium of 0.001 were generated per leg, which implies a 0.2% total premium cost for the straddle. A position was opened at the close on any day where abs(sentiment) >= 0.75 and closed at the next close, producing a one-day holding period. Across the four currency pairs, this produced 68 straddle trades. Importantly, an early version of the backtest appeared mildly positive, but after correcting payoff logic errors, the validated implementation produced a true overall average return of -34.1795%.
Results & Next Steps
The headline finding is that Trump-style social media sentiment shows up more as a short-term volatility signal than a directional one. Around highly polarized posts, USD pairs can get briefly noisier, but the effect is small and usually fades within a day.
That’s why the trading idea struggled. We tried a simple “bet on movement” trade (a long straddle): it makes money only if the currency moves a lot right after a very emotional post. In practice, the market usually didn’t move enough to cover the cost of placing that bet, so the strategy lost money on average.
For future work, I would prioritize two specific next experiments. First, run a formal event study on a multi-year sample with explicit timing conventions and controls for overlapping macro/geopolitical events, reporting abnormal returns and abnormal realized volatility over windows like [0,1], [0,3], and [0,5] days with statistical tests. Second, test trading ideas with more realistic assumptions: real option pricing (not a fixed cost), clearer timing rules, and smarter triggers that combine sentiment with “is the market already in a volatile mood” plus “is this post unusually attention-grabbing.”