Create a Waterfall Chart to Visualize Return Contributions

Published in Market Analytics
November 12, 2023
Create a Waterfall Chart to Visualize Return Contributions

Create a Waterfall Chart to Visualize Return Contributions

The Top 8 Stocks Contribute Over 90% of YTD Returns

Waterfall charts are an invaluable tool for visualizing how different components contribute to a whole. While commonly used in financial reporting for showcasing income statements, profit margins, and the like, they’re particularly useful for analyzing the dynamics of stock index returns. In this case, we’ll focus on the S&P 500 Year-to-Date (YTD) performance.

Reference: Top-heavy, ultra-narrow Wall St needs to bulk out

You might have heard that the market has been rallying, but did you know that the rally is largely driven by a few key players, such as Nvidia? The question that naturally arises is, by how much? In this lesson, we will walk you through the process of obtaining raw data, cleaning it up, web scraping, and ultimately visualizing this data using a waterfall chart. Our analysis will reveal that the top 8 stocks account for 90% of the S&P 500 returns for the first half of the year. What’s more, this is real-time code; you can run it at any point for the most current data, or even adapt it for other indices like Nasdaq or TSX60—or your own portfolio.

What You’ll Learn

  • Fetching real-time data
  • Web scraping with pandas
  • Data wrangling
  • Creating waterfall charts

Why This Matters

Understanding the forces shaping an index like the S&P 500 is critical for any investor. While the index may be a gauge for the broader market, its performance is far from a democratic process. Often, just a handful of stocks may disproportionately impact the index’s returns. Unpacking this performance through a return contribution analysis can unveil critical trends and concentrations.

For instance, as of 1H 2023, a mere 10 stocks have been the driving force behind the S&P 500’s performance. Which stocks are these? To which sectors do they belong? Is their performance an outcome of company-specific factors, or do they reflect broader market trends? These are the questions ...

This content is for subscribers only. Please sign in to read more.

Sign In