Find The Worst & Best Months To Invest Using Python

randerson112358
4 min readSep 7, 2021

Use Python To Determine The Worst & Best Months For Returns

Disclaimer: The material in this article is purely educational and should not be taken as professional investment advice. Invest at your own discretion.

In this article I will attempt to determine the worst & best months for returns in the stock market.

To do this analysis, I will be using about 46 years worth of data from the S&P500 which is made up of 500 large cap companies in the US stock market, and is considered as a benchmark for the US economy.

The idea is to gather stock data from the S&P500, and get the daily simple returns for each month. Once I have that, I plan to average the daily simple returns for each month and display them visually using a graph. This I believe will tell me the best and worst months to invest.

Video

If you prefer not to read this article and would like a video representation of it, you can check out the YouTube Video. It goes through everything in this article with a little more detail and will help make it easy for you to start programming the code even if you don’t have the programming language Python installed on your computer. Or you can use both the article and the video as supplementary materials for learning! All of the code…

--

--

No responses yet