Bill Miller is coming off a rough patch, which he says has created a good time to be an investor.

“The markets are a gift in the sense that there are prices out there that make no sense,” Miller, whose Legg Mason Opportunity Trust lost 23 percent this year through Tuesday, said in an interview with Bloomberg’s Betty Liu. “Almost everything is a buy in my opinion.”

Plunging oil prices, China’s slowing economy and the possibility of further interest rate increases by the Federal Reserve have rattled U.S. markets. The Standard & Poor’s 500 Index has fallen 11 percent from its high in May, including a 6.9 percent loss this year as of Tuesday’s close.

Miller and co-manager Samantha McLemore still have a strong long-term record at the $1.6 billion Opportunity Trust. The fund has beaten 69 percent of peers in the past five years, according to data compiled by Bloomberg.

Examples of sectors that Miller cited as undervalued include airlines and homebuilders, both of which benefit from low oil prices. Builders sold the most new homes last year since 2007 as buyers embraced longer commutes. Delta Air Lines Inc. will save more than $3 billion this year with lower fuel costs, Chief Executive Officer Richard Anderson said last month.

Homebuilders, Airlines

A Bloomberg index of homebuilders is trading near its lowest levels since 2012. An index of four airline stocks is down 15 percent this year.

Miller, 66, co-founded Baltimore-based Legg Mason Capital Management and gained fame running its Value Trust, which beat the S&P 500 Index every year from 1991 through 2005. That mark was tarnished in 2008, when the fund got stuck holding too many bank and mortgage stocks amid the credit crunch and lost 55 percent.

The U.S. economy remains strong with a low likelihood of recession, unless stocks fall so far that they cause a collapse in the wealth effect, Miller said in the interview.

“All of that on-the-ground information is telling you there’s nothing wrong with the U.S. economy,” Miller said. “What’s telling you there’s something wrong is the stock prices.”