Table of Contents

Introduction

This is the part 3 of our Python for Stock Market Analysis series and here, we will explore some of popular growth rates that can be used to see how well is our value is changing over the period of time. Lets take some of scenarios:

The scenarios can be many more but lets focus on some.

Again we will be using the data reading part's code from the previous blogs.

Rate of Return

Lets suppose that we bought a stock 2 months ago and we want to find out how much profit we currently have then we might subtract the price at the time we bought from the current price. And it can be simply called return. The rate of return is simple measurement that tells us how much has been the price increase from the base period. It is calculated as:

$$ ror = \frac{V_{current}-V_{initial}}{V_{initial}} * 100 $$

RoR is the simplest growth rate and it does not take external factors like inflation into consideration.

Month Over Month (MOM) Growth Rate

This is the simple measurement of the growth rate where we simply calculate the rate of change from the previous month.

$$ rate = \frac{v_t - v_{t-1}}{v_{t-1}} * 100 $$

Where,

Lets calculate this in our python. But first, lets make a dataframe to store the closing price of the month only.

Looking over the data of last 100 months, we have used MOM closing price on the primary y axis while MOM growth rate is on secondary y axis. The Growth rate does not seem to be increasing but is fluctuating.

Compounding Monthly Growth Rate (CMGR)

Compounding monthly growth rate is the rate of closing price that would be required for an stock's closing price to grow from its base closing to its ending closing price. And it can be calculated as:

$$ CMGR = \left[\left(\frac{{V_{t}}}{V_0} \right)^{\frac{1}{n}} - 1\right]*100 $$

Where,

Since this growth rate is compounding, we can calculate this in entire history of the closing prices or calculate on the some moving window like in 5 months.

Simple CGR

Lets take a value at the first month as the base value.

Looking over the above plot, there seems to have huge loss in closing price before 1990 but looking over the latest dates, there seems to be having positive but low growth rates.

It might not be always an good idea to look over the CMGR by taking initial value of closing price as a base value but we could select a window over which we will calculate a CMGR so that we could compare the Growth in that window only. This can be thought as, we bought a stock today and our base day will be today. And while calculating CMGR, we will take closing value of today.

Windowed CMGR

In this part, we will calculate the growth rate in some time period only but not from the beginning. So lets find indices for each window. In below code block, we took all the index of mdf and then looped over the each chunk of indices of size equal to the value of window.

Looking over the above plot, one can make some sense like:

Year over Year (YoY) Growth Rate

Looking over the plot above, YoYGR seems to be increasing but what about Compounding Growth?

Compounding Annual Growth Rate (CAGR)

It is simply a modified version of CMGR. In CMGR, we calculate rates based on the month while in CAGR, we do same for the year. So, lets create a dataframe for annual closing prices.

Simple CAGR

CAGR Seems to be increasing but CMGR did not give us an insight as strong as this one. Since CMGR looks over only month's data, growth rate could be small in that little time.

Windowed CAGR

Lets look over the 5 window year's CAGR.

Using a window gave us pretty bad result but it might be because our window is small.

Now it is nearly identical to the CAGR. If we kept adding window size, it will eventually become a CAGR.

Thank you everyone for reading this blog. Please stay tuned for the next one.

References