Warren Buffett often is referred to as the "Oracle of Omaha" -- and for good reason. This native of Omaha, Nebraska has built a fortune, thanks to his ability to invest wisely through any stock market environment. This has helped Buffett lead Berkshire Hathaway to a compounded annual gain of nearly 20% over 58 years, compared to a compounded increase of about 10% for the S&P 500 over that time period.

The Berkshire Hathaway chairman generally has been spot on when it comes to making moves in the market. Even better, Buffett has given us insight into his strategy throughout the years. He once wrote that part of it has to do with being "fearful when others are greedy" and "greedy only when others are fearful." So it's important to listen to what Buffett says and watch his investing choices.

Right now, the billionaire is doing something for the first time in more than 30 years -- and it could be a warning for investors. Does this top investor know something Wall Street doesn't?

Warren Buffett is seen at an event.

Image source: Getty Images.

The S&P 500 roars into a bull market

First, let's talk about the current stock market environment. Early last year, the S&P 500 confirmed its presence in a bull market, and the good times have been rolling pretty much ever since. The index went on to hit multiple highs and register a 23% gain for the year. And the benchmark has been on the rise as this new year starts, too.

Excitement about artificial intelligence (AI) stocks and other growth players has driven this momentum -- and investors also have been optimistic about the start of a lower-interest-rate environment and a potentially better economy ahead. But Buffett's comments and latest moves suggest investors may be too optimistic.

In his latest shareholder letter, Buffett said markets are showing more "casino-like behavior" than in the past, and the top investor has been a seller of stocks in recent quarters -- even cutting positions in some of his favorite and biggest holdings such as Apple and Bank of America. In the first three quarters of the year, he cut the former by 67% and the latter by 23%. This brings me to the action that may be a warning for investors.

A $325 billion cash level

Today, Buffett is holding his highest level of cash since 1990. Berkshire Hathaway's cash level stands at about $325 billion as of the end of the third quarter, which is about 30% of its total assets. This could suggest caution and the idea that buying opportunities may be limited, considering the run-up in stock prices.

A look at the S&P 500 Shiller CAPE ratio illustrates my point. This valuation measure looks at earnings per share over a period of 10 years to account for various economic cycles that may affect a company. Today, this measure has surpassed 36 for only the third time since the S&P 500's launch as a 500-company index back in the late 1950s.

S&P 500 Shiller CAPE Ratio Chart

S&P 500 Shiller CAPE Ratio data by YCharts.

This indicates stocks are at one of their most expensive levels ever -- and Buffett's record cash stockpile shows the billionaire isn't rushing out to buy stocks.

Should you stop buying stocks?

What does this mean for you as an investor? Should you stop buying stocks right now? No -- and Buffett isn't, either.

For example, recent filings show he added to his shares of Internet domain registry company Verisign (VRSN 0.29%) over the past two months. Verisign is trading for about 24x forward earnings estimates, down from more than 35x a couple of years ago. Opportunities can be found today, even in an overall pricey environment.

Does Buffett know something Wall Street doesn't? Not necessarily.

Measures like the Shiller CAPE ratio clearly show us stocks are expensive. But, as always, Buffett refuses to get caught up in the current market mood and pile into stocks just because they're on the rise. And Buffett's record cash level, instead of a warning, is a reminder that it's crucial to set aside cash -- according to your budget -- for opportunities ahead and to be selective when buying.

This is something to keep in mind during any market phase, but it's particularly key when the market is booming, and you may be swayed by a fear of missing out. This strategy has worked well for Buffett over time -- and the great news is it could work for the rest of us, too.