Warren Buffett has been investing in the stock market for nearly 81 years, and his financial success has become the stuff of Wall Street legend. In 1965, Buffett brought his considerable business savvy to bear on Berkshire Hathaway (BRK.A -0.76%) (BRK.B -0.69%) when he took control of the company, and its value has since increased by a factor 43,100. Much of that wealth creation can be attributed to shrewd investments Buffett has made.

Berkshire had $318 billion invested in equity securities (stocks) at the end of the third quarter -- presumably a material contributor to its $770 billion market capitalization -- and nearly two-thirds of those invested assets were unrealized gains. Suffice it to say, Buffett has a knack for picking great stocks, so many investors monitor when and where Berkshire deploys its capital.

Well, the company released its third-quarter earnings results last week, and they contained a clear warning for Wall Street. The report showed Berkshire buying $1.7 billion in equities, but selling $6.9 billion in equities, meaning the company was a net seller of stocks to the tune of $5.2 billion during Q3. The logical conclusion: Buffett sees very few buying opportunities in the market.

Should investors avoid stocks right now?

A thoughtful investor looks at their computer.

Image source: Getty Images.

Economic indicators point to trouble for the stock market

The U.S. economy expanded at an annualized 4.9% pace in Q3, easily topping the long-term average of 2%, but warning signs in the underlying numbers suggest weakness ahead. Consumer spending was the primary growth driver during the quarter, but consumers took on debt and depleted savings to make that happen. Those trends mean consumer resilience could crumble in the coming months, especially with student loan payments starting again.

Additionally, several economic indicators point directly to a downturn. The Treasury yield curve has been inverted for the past year, and the affected portion of the curve has inverted prior to every recession since 1955. Meanwhile, the Conference Board Leading Economic Index continued to fall in September, marking 18 consecutive monthly declines, and the Conference Board expects a shallow recession in the first half of 2024.

A recession would be bad news for the stock market. The S&P 500 (SNPINDEX: ^GSPC) slipped by an average of 31% during the last 10 recessions, according to Truist strategist Keith Lerner.

How to interpret Warren Buffett's warning to Wall Street

While Berkshire was a net seller of equities during the third quarter, investors must interpret that warning carefully. Warren Buffett is not advocating complete avoidance of the stock market. That much is clear, because Berkshire purchased stocks during Q3.

Instead, Buffett and his fellow investment managers (Todd Combs and Ted Weschler) are probably concerned by high valuations across the market. Stocks look more expensive as the risk-free rate of return rises and the 10-year U.S. Treasury yield recently reached a 16-year high. That upward momentum in bond yields could also stunt economic growth because higher yields imply a higher cost of borrowing for businesses.

Investors should consider three more data points as well. First, Berkshire is somewhat limited in its ability to deploy capital. It would need to invest several billion dollars in a company to make any new stock a meaningful portion of its $318 billion portfolio, and buying the requisite number of shares may be impossible. Second, financial filings are backward-looking indicators; Berkshire could be buying stocks hand over fist in the current quarter. And third, historical data suggests that the stock market will experience significant growth in the long term.

The S&P 500 has consistently created wealth for patient investors

The S&P 500 has returned about 10% annually over the long term, and investors have no reason to expect a different outcome going forward. Moreover, attempting to time the market could have catastrophic consequences because the S&P 500 typically rebounds well before economic activity hits bottom. That means investors who sit on the sidelines during a recession will almost certainly miss the meat of the rebound, which would virtually ensure their underperformance.

Buffett expressed a similar opinion in an op-ed piece written for The New York Times in 2008. For context, the U.S. economy was buckling under the weight of the Great Recession at the time, and the S&P 500 had already fallen 40% from its high. But Buffett offered the following levelheaded insight:

Let me be clear on one point: I can't predict the short-term movements of the stock market. I haven't the faintest idea as to whether stocks will be higher or lower a month or a year from now. What is likely, however, is that the market will move higher, perhaps substantially so, well before either sentiment or the economy turns up.

Here's the bottom line: Investors should exercise caution in the current market environment given the precarious state of the economy. It's important to pay attention to valuations, avoid stocks that seem too expensive, and accumulate shares of reasonably priced stocks at a slower pace. However, there is no reason to avoid the stock market completely. In fact, doing so would probably backfire in the long run.