Stock Analysis
How a stock behaved through Fed rate cycles, and how sensitive it is to interest rates, inflation and unemployment.
Open the app →View on GitHub →
What it does
Enter any US stock or ETF ticker and get up to 30 years of analysis in three parts:
- Price & trend: the full price history (adjusted for splits and dividends) with 50- and 200-day moving averages, golden and death crosses, and the Fed funds rate overlaid. Headline numbers include returns over 1, 5 and 10 years, annual growth rate, the worst fall and how long it took to recover, and volatility.
- Through Fed rate cycles: how the stock did while the Fed was raising rates, holding, or cutting, with annualized returns for each and a cycle-by-cycle table.
- Sensitivity to the economy: how the stock’s monthly returns moved with changes in interest rates, inflation and unemployment. Results are in plain English, flagged as either a clear link or possibly noise, with a rolling chart showing whether the relationship holds over time.
Try SPY for the market as a whole, then compare a bank like JPM with a growth stock like NVDA.
Bring your own free keys
The tool runs on your own free API keys: one from Tiingo for stock prices and one from FRED for economic data. The first time you open the app, it walks you through getting both, which takes about two minutes, and tests them before saving.
Your keys stay in your browser. Tiingo and FRED don’t accept requests directly from web pages, so each request passes through a small relay on this site that uses your key for that one request and never stores or logs it. Results are cached in your browser, so repeat lookups don’t use up your quota.
Getting the statistics right
The first version of this project, written in Python with Flask, correlated the stock price with the Fed funds rate. That turns out to be misleading: any two series that drift over decades look strongly related, whether or not they are.
This version works with changes: monthly stock returns against monthly changes in each economic measure. It also reports how much those factors actually explain, which is usually a small share. That’s an honest answer: most of what moves a stock month to month is the company and the market, not the macro data.
How it’s built
- App: React and TypeScript. All statistics run in the browser and are unit-tested, including moving averages, drawdowns, rate-cycle classification, and a least-squares regression checked against textbook formulas.
- Data: a Cloudflare Worker relays requests to Tiingo and FRED using each visitor’s own key. It validates input, rate-limits, and translates provider errors into plain messages. Nothing is cached or stored on the server.
- Usage counts: an optional, anonymous daily “used the app” count (no keys, no tickers), so I can see whether the tool is worth building further.
- Charts: uPlot, which handles 7,500+ daily points smoothly.
Prices from Tiingo; economic data from FRED, Federal Reserve Bank of St. Louis. This product uses the FRED® API but is not endorsed or certified by the Federal Reserve Bank of St. Louis. For education only, not investment advice.