Which Stocks Have Good Performance In A Certain Month/Quarter Of Year?

Squeeze the apple

As an ex Quant still fueled with a deep interest in stock market, I have always wanted to explore more applicable strategies in Vietnam stock market in particular.

But be aware, this article is not written to be deep but to be real.

Let’s get real!

One of the most popular term in trading is seasonal effect, it means that after a fixed period of time, stock price will move up or down similar to the pattern in the past.

Is it real? And if it real, will trading be an easy game?

Well, firstly, yes - there were many seasonal effect which are discussed in many research papers many times and many years ago: “Santa Clause Rally”, “Sell in May and go away”, “January effect”, “President vacancy effect”, etc.

Secondly, a big “NO”- because these seasonal effects are true STATISTICALLY, and it depends on the timing you buy and sell stocks (Don’t underestimate the volatility of intraday prices), and the weights you assign to the stocks in your portfolio.

The main purpose of this article is finding the answer for the question posed on the title itself: Which stocks have good performance in a certain month /quarter?

To find the right answer, let us understand clearly the question: What is “good performance”?

From my perspective, “good performance” is described in one of following cases below:

  • Stocks that have positive return in that month/quarter in many years
  • Stocks that have odds of having positive return in that month/quarter in many years
  • Stocks that have highest average return in that month/quarter in many years
  • Stocks that have highest stable return in that month/quarter in many years. In this case, I measure the stability of stock return by Sharpe ratio.

Now let us get to the real part:

First, I collected daily stock price data in Vietnam Stock Market. I narrow down the list by focusing on stocks listed on HSX (Ho Chi Minh Stock Exchange). The data is downloaded from CafeF - the most popular website about finance in Vietnam (here).

Let’s jump in the codes now:

In the codes above, I loaded data from a csv file and renamed columns <Ticker>, <DTYYYYMMDD>, <Open>, <High>, <Low>, <Close>, <Volume> to simple names: Ticker, Date, O, H, L, C, Volume. Column Date was reformatted as date type, then data is sorted by Ticker and Date. After that, I built new features as Month, Quarter, Year from Date. The features Lagged_time_month and Lagged_time_quarter are leveraged later to get monthly/quarterly data.

The next thing is not easy at all, so surely I can say it is the most valuable part of this article : It’s about creating a function that searches for stocks that have good performance in a certain month of year.

And here we are, the answer for the question: Which stocks have good performance in a certain month of year.

Results for quarterly period is as shown:

Tada, we are done! If interested in this study, you can visit my github. However, if you want to invest based on this idea per se, you should be aware of stocks’ liquidity: the higher, the better.

Quant Researcher, Data Scientist, Food Hater (so I eat them a lot).