When Warren Buffett buys stocks, investors pay attention. You can get great advice and portfolio inspiration from following the investing guru. More than specific stock picks, though, Buffett's buying and selling activity can also give investors a clue about overall market trends.

Based on Berkshire Hathaway's most recent filings, there's a clear trend it's betting on now: the housing industry. Buffett typically steers clear of "hot" stocks and hype, and part of what makes him a legendary investor is the ability to see trends early and find value in places where other investors aren't looking.

The big news in the recent filing were three new positions in D.R. Horton (DHI 0.78%), NVR (NVR -1.01%), and Lennar (LEN.B) -- all homebuilders. And it's not just Buffett. Other top asset managers have also bought stocks recently that indicate their faith in a recovery of the real estate and housing industries.

Israel Englander's Millennium Management bought more shares of Home Depot (HD 0.94%) in the second quarter, and Bill Ackman's Pershing Square Capital Management recently upped its stake in developer Howard Hughes (HHH 1.05%)

Let's see why this could be a great time to tap into this trend, and what stocks may make sense for you.

Why invest in housing now?

There's a housing shortage in the U.S. According to a new study from Realtor.com, the U.S. is short by 6.5 million homes -- what the study calls crisis levels. Redfin data shows that newly listed homes were down 25%. 

That's a huge opportunity for homebuilders and smart investors. With mortgage rates sky-high, fewer people are buying both new and existing homes. But as the Federal Reserve begins to consider stopping its rate hikes, the housing industry should start up again soon. And that means investors who buy now can find bargains on stocks that should soar when the housing market improves.

The three homebuilding stocks Buffett bought are three out of the four largest homebuilding companies in the U.S. -- PulteGroup is the other. It's clear what he thinks. But these might not be the best stocks for you to buy.

Should you invest like Buffett?

Berkshire Hathaway is a holding company that owns many businesses outright, such as See's Candies, and large percentages of public companies like Coca-Cola. It has positions in around 45 stocks these days, and management carefully allocates the billions of dollars its investors have given it to achieve its objectives.

Buffett is known as a value investor, and he typically looks for undervalued stocks of companies with strong management. Many of his holdings are consumer goods companies, and although he has embraced some tech -- with more-recent positions in Amazon and his favorite, Apple -- tech doesn't place high on his list as a category.

There are investors out there who try to mimic Buffett's portfolio, and that's certainly one investing strategy. You can also benefit from his wisdom by simply buying Berkshire Hathaway stock, which has outperformed the market more often than not.

People moving into a new home with boxes.

Image source: Getty Images.

But there are several reasons you might want to play this housing trend a bit differently than Buffett. First of all, he would be the first to say that you should invest in companies you know and understand.

If you never heard of D.R. Horton before Buffett bought it, it might not be the best stock for you. Do some thorough research, and you might decide it's a great stock to buy. But it might be more in your interest to buy stocks from companies you already know and love while still betting on the return of the housing industry.

For example, you might want to invest in Home Depot or competitor Lowe's Companies (LOW -0.04%). If you think millions of new houses are going to go up, there will be a need for construction materials, along with the usual home-improvement products. Both of these stocks are underperforming the market this year, and low prices could mean big opportunity. These are both safe, dividend-paying stocks that should reward investors for years, whether you think the housing market is recovering soon or not.

If your portfolio has the leeway to invest in higher-growth and perhaps riskier stocks, another way to play the trend is investing in furniture companies. Buffett loves these stocks, and Berkshire Hathaway is actually the largest furniture company in the country because of some of its fully owned subsidiaries. 

Furniture retailers are feeling the pinch of inflation right now, like most retailers. But that just means bargain share prices for forward-thinking investors. Wayfair (W 2.08%) stock has almost doubled this year based on investor enthusiasm, and Buffett just sold high-end furnishings retailer RH (RH 2.28%), which is up 25% in 2023 -- but both stocks still look like they have room to run. 

Yet another way to benefit from a housing boom is to buy digital real estate stocks like Redfin, Zillow Group (Z 1.68%), or Opendoor Technologies (OPEN 3.38%). All three are on the rise this year. Opendoor is up 175% in 2023, and while it's risky, its opportunity makes it compelling for risk-tolerant investors.