DEV Community

akshay-bhatnagar-05
akshay-bhatnagar-05

Posted on

I built an automated system that tracks presidential stock mentions and follows the price for 4 days

Ever notice how a single offhand comment from a public figure can move a stock within hours? I wanted to actually track that β€” not just react to headlines after the fact, but systematically catch mentions and see what happens to the price next.

So I built Wire Desk: a small automated pipeline that watches for statements referencing specific companies or sectors, classifies them as direct (his own words, via Truth Social/White House) vs. indirect (news coverage reporting on him), then follows the stock's price for four trading days so I can judge the reaction myself instead of trusting a headline.

πŸ”— Live site: https://akshay-bhatnagar-05.github.io/trump-stock-tracker/
πŸ”— Source: https://github.com/akshay-bhatnagar-05/trump-stock-tracker

How it works

  1. Three sources monitored daily β€” Truth Social (via an RSS mirror), official White House press releases, and news wires via NewsAPI
  2. Keyword matching against a watchlist of companies/tickers I care about
  3. Direct vs. indirect tagging β€” this turned out to be the most useful design decision. A statement from someone carries very different weight than a journalist writing about them, and treating those the same was the biggest flaw I noticed in similar tools
  4. 4-day price tracking via yfinance, so I can see the actual before/after reaction instead of just the headline
  5. Daily email digest + a live dashboard, fully automated via GitHub Actions β€” the whole thing runs on a schedule with zero manual steps

The stack

  • Python (requests, yfinance, feedparser) for the detection/tracking logic
  • GitHub Actions for the daily cron job
  • A static HTML/CSS/JS dashboard, reading from a JSON file the script regenerates every run
  • GitHub Pages for hosting β€” the whole thing costs $0 to run

What I deliberately avoided

While researching this, I found an open-source project that brute-forced 31.5 million rule combinations against historical posting data to find a "61.3% hit rate." Their own README honestly flags the risk: testing that many combinations basically guarantees some will look great by pure chance (the classic multiple-comparisons/data-snooping problem). I wanted the opposite β€” simple, explainable logic over a big number that might just be noise.

Honest caveats

This is a research/awareness tool, not a trading signal. By the time a mention is caught here, it's already public, and a "confirmed" multi-day trend is usually already priced in. It's useful for staying informed fast β€” not for predicting anything.

Would love feedback on the architecture, or if anyone's built something similar with different source coverage. Repo's open, feel free to fork it.


Tags: #python #githubactions #webdev #opensource #finance

Top comments (0)