It's only fitting that stocks are set to close near all-time highs as the decade comes to an end.

With two weeks left in the 2010s, the S&P 500 (SNPINDEX:^GSPC) hit an intraday all-time high at 3182.68, up 185.4% from its closing price of 1115.10 on Dec. 31, 2009. With dividends reinvested, you would have seen returns of 246% over the decade simply by holding an index fund.

A stock chart going up with a man in a suit in the background.

Image source: Getty Images.

There's no question that the 2010s was a banner decade for stocks. The S&P 500 gained every year except 2018 and often rose by double digits.

Ten years ago, though, it was hardly clear that things were going to work out like that. Investors were still reeling from the worst recession in 80 years and were understandably nervous about the recovery. However, the most notable thing about the stock market during the 2010s is that the event that so many prognosticators expected to happen -- the next recession -- never did. The U.S. economy remains strong and healthy today, with the unemployment rate near all-time lows. And with stock indices jumping another 26% so far this year, a recession still seems far away.

The 2010s were rife with predictions about the next recession. Below is a sample of headlines from pundits who predicted a downturn at nearly every point in the decade.

  • Aug. 20, 2011: "And Here Comes the Recession of 2011"  -- Business Insider
  • Sept. 21, 2012: "The Coming 'Obama Recession' of 2013" -- Forbes
  • Nov. 28, 2013: "U.S. Recession Is Nigh ... and the Fed Can't Stop It: SocGen's Edwards" -- CNBC
  • July 22, 2014: "Economist who predicted busted housing bubble says another recession is coming" -- The (San Jose) Mercury News
  • Sept. 9, 2015: "Global recession in next two years is 'most likely' scenario, says economist" -- The Guardian
  • Jan. 15, 2016: "A recession worse than 2008 is coming" -- CNBC
  • June 19, 2016: "The next president will likely face a recession" -- CNN
  • Dec. 30, 2016: "How to get ready for the economic recession coming in 2017" -- Theconversation.com
  • Oct. 4, 2017: "The next recession is coming (and it's set to reshape our economy as we know it)" -- Inc.
  • Dec. 13, 2018: "Is a recession coming in 2019? Nearly half of U.S. CFOs think so" -- Fox Business
  • Dec. 10, 2019: "CFOs brace for a potential recession" -- The Wall Street Journal

Some of those predictions are understandable. After all, the U.S. is now in its longest economic expansion on record, passing the one that ran through much of the '90s earlier this year, but all of those predictions have turned out to be wrong. Selling on recession-based fears would have been a bad move over the last decade.

As the economy churns into the 2020s, here are a few takeaways for investors from the recession of the 2010s that never was.

1. Don't worry about macroeconomics

On the website FiveThirtyEight, Ben Casselman writes, "If there's one truism in macroeconomics, it's that we're really bad at predicting recessions." Professional economists have little idea where the economy is going to be in a year, and it's a mistake for the average investor to make moves based on macroeconomic risk factors like Brexit or a China trade deal that can change almost daily. While investors are right to be wary of a recession (as no one wants to see 50% of their portfolio wiped out), you're better off investing in safe, recession-proof stocks rather than selling and missing out on a big rally like we've seen this year.

2. Take bad news/forecasts with a grain of salt

In the local news, "If it bleeds, it leads" tends to be the rule of thumb. In the financial media, headlines and clicks are often driven by fear and greed. A recession, therefore, is almost always good fodder for fear-based clicks, and there is usually some data point showing a reason for doom and gloom. Like the weather, a bad economic forecast is newsworthy. It's a call to action: Sell your stocks, save your money, make a plan for when times get tough. A good economic forecast is generally just the status quo -- not exactly newsworthy. "Carry on as you were" isn't the advice you want, but it is the information you generally need.

3. History doesn't always repeat itself

So many economists had predicted a recession simply because the economic expansion has gone on for so long. But every economic cycle is unique, and this one started from the depths of the worst financial crisis in 80 years, likely giving it more room to run, especially in areas like the housing market. While another recession will almost certainly happen someday, it's not a law of nature. In Australia, for example, the economy has expanded for 28 years in a row, baffling economists.

Here in the U.S., a low inflation rate has persistently confounded economists, and inflation tends to rise as a sign of an overheating economy before a recession.

The good news

According to the law of averages, it's unlikely that the stock market will triple again in the 2020s. But if a recession does hit, it probably won't be as bad as the financial crisis that traumatized so much of the country. A recession, defined as two straight quarters of negative growth, is sometimes so mild that economists don't even know it happened until it's over. The recession of the early 1990s, for instance, lasted just eight months, and the S&P 500 had recovered its losses, which were about 25% from peak to trough, in less than eight months -- before the recession even ended.

The lesson from the 2010s, then, seems to be that it's worth being mindful of a potential recession, but it shouldn't change your investing strategy. Over the long term, the S&P 500 has returned 9% annually, and that includes recession and other financial shocks. The last decade was a reminder why, with enough time, staying in the market has always been a better decision than holding cash.