Say whatever you will about the kookiness of following stock market cycles. Although seasons and cycles can’t perfectly predict the market’s next move, certain historical patterns have shown a scary propensity to repeat.  

For example, analyzing the quarterly performance of stocks reveals several intriguing historical trends. Among these is the fact that fourth-quarter equity returns have been consistently positive.

Going back to 1949, the Dow Jones Industrial Average and S&P 500 have recorded positive gains in every fourth quarter during presidential post- and pre-election years along with mid-term and election years. During pre-election years like 2015, fourth-quarter stock market gains have averaged 2.3 percent for the Dow and 3 percent for the S&P 500 over the past 65 years, according to the Stock Market Almanac.

Although the Nasdaq Composite’s historical return only goes back to 1971, it too has consistently gained during the fourth quarter, averaging a 5.1 percent positive return.

This year, bullish seasonal factors are aligning with fundamentals, and increased mergers and acquisitions (M&A) activity in the U.S. has lifted stock prices.

Over the past three months, the sectors that have experienced the biggest increases in M&A deal activity, relative to the same three months a year ago, have been technology services (549 deals vs. 480), commercial services (517 vs. 461), and health services (181 vs. 126), according to FactSet Research.

And the index ETFs for two of those sectors – the Technology Select Sector SPDR (XLK) and Health Care Select Sector SPDR (XLV) — as well as the and Consumer Staples Select Sector SPDR (XLP) — have all outperformed the S&P 500 year-to-date.

Another sign that fourth quarter magic is on the verge of repeating is the bullish technical price action.

The S&P 500 just hit a two-month high after holding support at its 200-day moving average. In other words, stocks have staged an impressive rally since hitting lows in August. And although the S&P MidCap 400 ETF (MDY) and iShares Russell 2000 small-cap ETF (IWM) have lagged, both have been trending higher over the past two months. 

Heading into the 2016 election year, the fourth quarter’s magic is expected to stay alive although be less impressive than during its pre-election cycle. The Dow and S&P 500 have posted average fourth quarter gains of 2 percent and 1.9 percent, respectively, in election years, while the NASDAQ has lost 0.8 percent.