times series plot of stock prices and returns

Stock prices and returns – How to plot time series?

The purpose of this tutorial is to show you how to plot time series of stock prices and returns using Excel. And, we will also explain how to interpret these plots to gain a better understanding of stock prices and returns.

We will use Microsoft Corporation (MSFT) shares and Kellogg Company (K) shares as examples. We downloaded data on the historical monthly prices of these two stocks for the 30-year period between January 1, 1990 and January 1, 2020 from Yahoo! Finance. Let’s plot time series of these prices and the returns implied by them.

Time series plots of stock prices

time series plot - MSFT prices
Figure 1: Microsoft monthly prices (Jan 1, 1990 to Jan 1, 2020)

We begin with the share price of Microsoft (Figure 1). We observe impressive growth over the 30-year period, especially after 2012. However, it would be wrong to say that the increase in the share price has been smooth over the years. In fact, we detect clear downturns, for example, during 2000 (around the burst of the Dot-com Bubble) and 2008 (the Credit Crunch).

We observe an upward trend over the 30-year period for Kellogg shares (Figure 2) as well. Again, although the long-run trend is upward, there are lots of ups and downs along the way. This pattern is typical across stocks as they are sensitive to broad market movements.

time series plot - Kellogg prices
Figure 2: Kellogg monthly prices (Jan 1, 1990 to Jan 1, 2020)

Time series plots of stock returns

How about the returns? When we examine the monthly returns of Microsoft (Figure 3) and Kellogg (Figure 4), we don’t observe an obvious trend, which was the case for monthly prices. Instead, we see sort of a noise process.

For Microsoft, most monthly returns lie within the [−30%, +40%] band. This doesn’t mean at all that more extreme returns won’t be observed. It just means that most returns fell into this interval in the past, but there is always a risk of a monthly return of less than −40%.

For Kellogg, the corresponding band is [−20%, +20%], which is narrower than the one for Microsoft. This hints to us that the monthly returns of Kellogg shares are less volatile than those of Microsoft shares. We’ll investigate this further in our next post.

MSFT returns
Figure 3: Microsoft monthly returns (Jan 1, 1990 to Jan 1, 2020)
Kellogg returns
Figure 4: Kellogg monthly returns (Jan 1, 1990 to Jan 1, 2020)

Step-by-step guide for producing time series plots in Excel

The steps you need to follow to produce the charts shown in Figures 1-4 are as follows:

  1. Store in one column the stock prices (or returns).
  2. In the adjacent column, store the dates (daily, monthly, etc.).
  3. Go to the Insert tab and click on the “line chart” icon.
  4. Next, click Select Data under the Chart Design tab.
  5. When the pop-up menu shows up, in the Chart data range field, enter the column with the stock prices (or returns).
  6. In the same pop-up menu, in the Horizontal (Category) Axis Labels field, enter the column with the dates.
  7. Click OK to produce the chart.
  8. You can use Add Chart Element (under the Chart Design tab) to edit the chart title, axis titles, and so on.

Video tutorial

Below you can find a summary of the discussion above in a video format.

What is next?

This tutorial is part of the series on analyzing stock returns.

Feel free to share this post if you enjoyed reading it. Also, please get in touch with us if you noticed any errors or have any suggestions/questions.