Warren Buffett's Berkshire Hathaway (BRK.A -1.27%) (BRK.B 0.20%) held $344 billion in cash and equivalents in the second quarter, just shy of the $348 billion it reported at the end of the previous period. The company was also a net seller of stocks for the 11th straight quarter.

Together, those capital allocation decisions amount to a grim warning for investors: Buffett sold more stock than he bought despite his company holding a near-record amount of investable cash, and despite the S&P 500 (^GSPC -1.60%) plunging as much as 19% from its record high during the second quarter.

Buffett evidently sees very few compelling buying opportunities in the stock market, likely because the S&P 500 trades at a historically expensive valuation. That applies to his own company. Buffett, after repurchasing $78 billion in Berkshire stock over a period of 24 quarters, has now gone four consecutive quarters without repurchasing a single share.

Here's what investors should know.

A downward-trending stock price chart shown in red.

Image source: Getty Images.

History says the stock market is headed lower in the next one, two, and three years

The cyclically adjusted price-to-earnings (CAPE) ratio is a valuation metric typically used to gauge whether entire stock market indexes are overvalued or undervalued. It was developed by Nobel-winning economist Robert Shiller during the dot-com bubble, so it is sometimes referred to as the Shiller P/E ratio.

Whereas the traditional price-to-earnings (PE) ratio is based on earnings from the last 12 months, the CAPE ratio is calculated with average inflation-adjusted earnings from the past decade. That eliminates cyclical fluctuations that occur throughout the business cycle to produce a more accurate picture of where an index's valuation stands.

The S&P 500 had a CAPE ratio of 37.8 at the end of July, well above the historical average of 21.2. Indeed, its monthly CAPE ratio has exceeded 37 on only 39 occasions since its was created in 1957, meaning its valuation has been this high less than 5% of the time throughout history.

Unfortunately, the S&P 500 has historically performed poorly under such conditions. The following chart shows its average return over different time periods following incidents where its monthly CAPE ratio measured 37 or more.

Holding Period

S&P 500 Return (When CAPE Ratio Is 37+)

1 year

(3%)

2 years

(12%)

3 years

(14%)

Data source: Robert Shiller.

The S&P 500 has generally declined during the one-, two-, and three-year periods following incidents where its CAPE ratio topped 37. Put differently, history says the index -- which is widely considered the best benchmark for the entire U.S. stock market -- will drop 3% by July 2026, drop 12% by July 2027, and drop 14% by July 2028.

Some additional perspective on Warren Buffett's $344 billion warning

Investors should consider Warren Buffett's capital allocation decisions in another context. Yes, Berkshire has been a net seller of stocks for 11 consecutive quarters, and it held $344 billion in cash and equivalents on its balance sheet in the second quarter. Those facts clearly suggest Buffett is hesitant to buy stocks, but some of that hesitancy is probably due to the size of his company.

To elaborate, Berkshire Hathaway's market capitalization currently exceeds $1 trillion, and its stock portfolio is worth more than $280 billion. Consequently, buying a few billion dollars in stock will not move the financial needle for the company, which severely limits its options when deploying capital in the market. Indeed, Buffett himself has made that point.

"There remain only a handful of companies in this country capable of truly moving the needle at Berkshire, and they have been endlessly picked over by us and by others," Buffett wrote in his 2023 letter to shareholders. "All in all, we have no possibility of eye-popping performance."

So while individual investors should heed Buffett's $344 billion warning to some degree, they should not avoid the stock market entirely. They are not constrained in the same way Berkshire is constrained. Put differently, buying a few thousand dollars in stock can move the financial needle for most people, meaning they have far more options than Berkshire. However, given the S&P 500's elevated valuation, investors should focus on reasonably priced stocks they are comfortable holding through volatility.