Given the recent record highs in the S&P 500 and the Dow Jones industrial average, you might think Americans would feel excited about the future of the stock market. But you’d be wrong, a Bankrate national survey has found.

When we gave people a few choices and asked them to pick the best way to invest money they wouldn’t need for more than 10 years, the most popular answer was real estate. Next were cash investments, such as CDs and savings accounts.

You need to have a very well-diversified portfolio that should include stocks, bonds, some alternatives and real estate.

The stock market was a distant third, tied with gold and other precious metals.

These preferences don’t match up with investing strategies that experts say will deliver the best returns over the long term.

Stocks remain unloved by many

The bull market that started in 2009 and continues today is the second longest in U.S. history, but has yet to make a dent in Americans’ perceptions of the market, according to Bankrate’s polling data.

Back in 2013, relatively early in the bull market, 14% of Americans told us stocks were the best long-term investment available. Now, 16% feel that way.

Michael Weinfeld, a retired journalist living in Herndon, Virginia, is one of them.

He says that while he has experienced his fair share of market volatility — including losing half of his daughter’s college fund to the stock market crash of 1987 — he has enjoyed big gains over the long term by holding on tight.

“I’ve been riding the stock market up and down since the middle ’80s, and I’ve learned a lot about how to weather all of these disasters,” Weinfeld says. “As long as you diversify and just wait it out, history shows that the market will eventually bounce back.”

Houses are tangible. You can physically see and feel the product. So you know where your money is going: It’s going into that house. With stocks, you have no clue where your money is going.

ADVISER SEARCH: Find a financial adviser today to help you get the best stock market returns.

Many still smarting from market bumps

Brad Barber, a professor of finance at the University of California, Davis, chalks up the relative unpopularity of stocks to leftover suspicion from the dot-com bust of the early 2000s and the financial crisis of 2008-2009.

“If you come of age in a period when you view the market as being tumultuous, that probably makes you less likely to invest in the stock market,” Barber says.

But those who stay out of the stock market on principle are probably doing themselves a disservice, says Avani Ramnani, CFP and director of financial planning and wealth management at Francis Financial.

“You need to have a very well-diversified portfolio that should include stocks, bonds, some alternatives and real estate,” Ramnani says.

“Over the long period of time, we’ve seen that the stock market returns between 6-7% from a diversified portfolio,” she says — which beats many of the investment options that proved more popular in our poll.

Financial security improving

Americans may not be bullish on the future of the stock market, but their present is looking pretty good. For the 26th consecutive month, the Bankrate Financial Security Index — based on survey questions about how people feel about their debt, savings, net worth, job security and overall financial situation — shows Americans’ sense of financial well-being continues to improve.

That’s even though feelings of job security dropped a bit this month, despite a strong June employment report that was released the week our survey was conducted, says Greg McBride, CFA, Bankrate’s chief financial analyst.

While Americans’ sense of job security is still improved from a year ago, the reading was not as glowing as those seen in recent months.

Bankrate’s Financial Security Index is compiled using 5 monthly survey questions that track Americans’ feelings about their job security, savings, debt, net worth and overall financial situation. A reading above 100 indicates improvement in financial security, while a reading below 100 reflects weaker financial security.

Date, Financial Security Index

Put your money where your house is

The most popular long-term investing option in our survey was real estate, favored by a quarter of Americans.

That makes sense to Sterling White, co-founder of Holdfolio, a real estate investment firm.

“Houses are tangible. You can physically see and feel the product. So you know where your money is going: It’s going into that house,” White says. “With stocks, you have no clue where your money is going.”

White also sees real estate as a sanctuary from the disruptions and volatility of the stock market.

But Ramnani, of Francis Financial, says it has some clear downsides.

“It is an illiquid asset. It’s not something you can turn around overnight. It takes a while to sell,” she says. “When you need the money, you don’t know what the real estate market is going to do.”

And unlike intangible investments such as stocks and bonds, owners can’t just leave an investment property in an account online somewhere and forget about it.

“There is the cost factor,” Ramnani says. “You have to maintain it.”

Cash and carry

Millennials were the generation most likely by far to value cash investments above the others, with 32% of those between ages 18 and 35 endorsing cash, including a whopping 43% of younger millennials ages 18-25.

Ramnani says she’s “concerned that so many people think that’s such a good investment for such a long period of time.” Because while deposit accounts do protect investors against losses, they don’t protect them from the inflation that will eventually make the invested money worth less.

“Right now, especially, you’re getting practically no interest from cash investments like savings accounts and CDs,” she says.

UC Davis’ Barber thinks what’s driving Americans toward cash is pessimism over the economy.

“My hunch is that in periods of high uncertainty or risk, that cash is a preferred safe haven,” he says.

Golden touch

Gold’s tie for popularity with stocks in our survey is another powerful signal of investors’ uncertainty about the future, Barber says.

“Gold has always been viewed by many people as a safe haven,” he says.

Still, that doesn’t make it a good thing to put your money into. The glittery precious metal has a poor long-term track record for creating wealth for investors.

“Gold probably has no real place in a traditional investment portfolio,” Barber says. “It’s really not an investment, it’s a commodity. So I think this is more folklore than it is good economics.”