ServicesPredictive Stock Analysis: Bridging Macroeconomic Trends and Earnings Volatility

Predictive Stock Analysis: Bridging Macroeconomic Trends and Earnings Volatility

The Challenge

In the high-stakes world of institutional investing, hedge funds are constantly looking for a predictive “edge.” My team and I were tasked by a specialized Data-Analytics-as-a-Service firm to investigate one of the most volatile periods in the financial calendar: Earnings Season.

The goal was to move beyond looking at earnings in isolation. We wanted to determine if historical stock price patterns, when synthesized with broader macroeconomic indicators like inflation and interest rates, could provide a more robust framework for predicting post-earnings stock performance for major S&P 500 technology leaders.

Data Sourcing & Engineering

To build a reliable model, I worked with several disparate datasets, requiring extensive cleaning and alignment:

  • Market Data: 10 years of daily OHLC (Open, High, Low, Close) price data for Apple, Google, and NVIDIA.
  • Financial Data: Quarterly earnings dates, Earnings Per Share (EPS) figures, and revenue surprise metrics.
  • Macroeconomic Data: Inflation (CPI) and interest rate data sourced directly via the FRED API to provide the economic “backdrop” for each earnings announcement.

A key part of my workflow involved time-series alignment—engineering the data so that 10 years of price history centered precisely around “Earnings Windows” (T-10 to T+10 days). This allowed us to isolate the specific impact of the announcement from general market noise.

The Technical Approach

Using Python within a Google Colab environment, I applied several analytical techniques to uncover hidden relationships:

  • Correlation Analysis: I investigated the relationship between macroeconomic volatility and stock “drift” prior to earnings dates.
  • Predictive Modelling: We built and tested models—including Logistic Regression and Random Forests—to forecast whether a stock would outperform market benchmarks over 3, 6, and 12-month horizons.
  • Feature Importance: I conducted an analysis to identify which macro factors (such as interest rate hikes) had the strongest predictive power on a company’s post-earnings recovery.

My Role: Visualisation Lead

As the Visualisation Lead for this project, my responsibility was to translate complex regression outputs into a high-impact narrative for stakeholders. I designed interactive dashboards that allowed users to:

  1. Drill down into specific earnings periods.
  2. Compare predicted outcomes against actual market performance.
  3. Visualise “Macro Risk” levels during specific fiscal quarters.

The project was a success, receiving a Distinction (81%) for technical rigour and clarity of communication.

Impact & Outcomes

The final delivery included a modular, well-documented Python script and an algorithm that allows for the analysis to be refreshed with new market data. By quantifying the “Macro-Earnings” relationship, we provided a framework for more evidence-based decision-making, helping stakeholders understand not just if a stock might move, but why it moves in the context of the global economy.


Contact info