Shareholders have been buying bonds and dumping stock funds for months—even when the markets have been improving. Will investors regain their old appetite for stock funds any time soon? Probably not, says Brian Reid, chief economist of the Investment Company Institute (ICI), the mutual fund trade group. “The attitudes of investors have changed, and we are not likely to return to strong demand for stock funds for some time,” he says.

Reid, who surveys fund shareholders, sees a new spirit of caution. After suffering big losses in recent years, investors have begun taking to heart all the talk about asset allocation. More portfolios are including sizable positions in bond funds. Instead of emphasizing traditional stock funds, many investors have been putting money into target-date funds and other balanced portfolios that hold a mix of stocks and bonds. Most importantly, bond sales probably are climbing because of demographics. “The baby boomers are aging, and older investors prefer bonds,” says Reid.

The behavior of baby boomers began changing a decade ago. As the bull market of the 1990s roared, investors raced to buy stocks, and sales of equity funds hit their all-time peak in 2000. Many portfolios included nothing but equities. Then when technology stocks collapsed, fund shareholders became wary. Fund sales remained subdued, even as stocks climbed from 2003 through 2007.

As the credit crisis unfolded in 2008, investors stampeded, selling stock funds. At first, the behavior didn’t seem altogether unexpected. Whenever markets sink, the enthusiasm for stock funds wanes. But this time was definitely different. For starters, the amount of sales was unsettling. In 2008, investors pulled $233 billion out of equity funds, according to the ICI. It was the biggest annual outflow that had occurred since the ICI began keeping data in 1984. The next largest annual outflow came in 2002 when shareholders withdrew $27 billion.

Besides setting records for the amount of outflows, the current sales downturn is proving to be the most prolonged on record. Even after markets recovered in 2009, outflows continued—and the withdrawals have persisted through the first eight months of 2010. In the past, equity funds never suffered two years of outflows in a row.

The flow into bond funds has become a flood. In 2002, $108 billion moved into bond funds, an all-time high. The record was smashed in 2009 when investors poured $375 billion into bond funds. Now some analysts warn that the emphasis on bonds could be overdone. As the economy recovers, interest rates will rise, the analysts note. That will hurt bond prices and encourage investors to buy stocks.

While bonds may not tank tomorrow, it does seem likely that stock markets will eventually recover at least some of their old gusto. To prepare for the day when the pendulum swings, consider a strategy developed by Morningstar. The fund tracker suggests that investors buy fund categories that are suffering outflows. Often such unloved funds are close to hitting a trough and about to enjoy a revival.

Because categories don’t always rebound immediately, Morningstar uses a diversified approach. To implement the strategy, you invest in the three equity fund categories that recorded the most redemptions during the preceding 12 months. Then you hold the funds for three years. Investors who followed the strategy from 1994 through 2009 would have enjoyed annual returns of 8.1 percent, compared to 6.2 percent for the S&P 500.

While the system doesn’t work every year, it has uncovered some unlikely categories that went on to deliver huge returns. The group of unloved funds chosen at the start of 2000 included funds specializing in precious metals, Latin American stocks, and convertibles. At the time, gold sold for $282 an ounce, Latin American economies were deeply troubled, and convertible bonds looked like stodgy fixed-income instruments. All three categories went on to deliver strong returns in the next decade, surpassing the S&P 500 by wide margins.

This year, the most unpopular category is large growth, which recorded outflows of $39 billion during the 12 months ending in August. Other unpopular categories are large value and world stock. To bet on a revival of large growth, you can use an index fund, such as Vanguard Growth Index (VIGRX).

For some extra juice, consider Wells Fargo Advantage Growth (SGROX), an active fund that focuses on stocks with rapidly growing earnings. If the market revives, this fund should be a leader. When stocks recovered in 2009, Wells Fargo jumped 47.3 percent, outdoing the S&P 500 by 20 percentage points. For a large value choice, consider Prudential Jennison Equity Income (AGOCX). The fund has delivered steady results by holding a diversified basket of dividend-paying stocks. A solid entry in the world stock category is Oppenheimer Global Opportunities (OPGIX). The fund has a big stake in fast-growing technology stocks that will soar when the next bull market appears.