Here's what you need to know in the muni bond market
A volatile stock market could be the best friend to the municipal bond market, which has suffered through a shaky year amid a deluge of ugly headlines.
Investors changed gear in 2013, yanking money from fixed income funds and pouring it into the stock market as the S&P 500 gained 29 percent and some other indexes fared even better.
Munis paid as big a price as any sector, surrendering $58 billion for the year, according to the Investment Company Institute. During a run in which the group saw outflows in 42 of 45 weeks, some $74.3 billion came out of the $3.7 trillion market—a fraction of the total assets under management but an indicator nonetheless of a disturbing trend.
But as confidence grows over the condition of state and local government, sentiment is showing the early signs of a shift.
(Read more: 2014 top trends in mutual fund investing)
Lipper reported outflows of just $19 million over the past week, compared to a $1.47 billion loss the previous week. Of course, one week does not come close to establishing a trend, but if the outflows continue to subside, investors worried about a stock market correction will be looking for better places to put their money to work.
"Muni fund flows during the month of December were heavily influenced by tax loss selling. With the tax loss selling season now behind us, it's not surprising to see outflows diminish," Chris Mauro, muni analyst at RBC Capital Markets, said in a note to clients. "Nevertheless, this week's drop in outflows was very sharp and should this trend continue over the next few weeks, we would view it as a very positive signal for the muni market."
While the stock market has wobbled, munis have done fairly well. The S&P Municipal Bond Index has risen 1.3 percent so far in 2014. Mauro said investors should watch flows to gauge which way the sector is heading.
"If muni fund flows post flat or even positive in the coming weeks, we believe that the biggest beneficiary will be the long end of the muni market," he said. "The allure of the equity market will continue to be a challenge for municipal funds as equity fund flows will likely come, in part, at the expense of municipal bond funds."
Indeed, a stock market drop in the wake of Friday's lackluster jobs report was met with a rally, showing that the buy-the-dips mentality remains in the stock market.
(Read more: 'Lofty' market ripe for at least 10% drop: Goldman)
Munis also have struggled to overcome a stream of bad news, particularly from Detroit's bankruptcy and the troubles in Puerto Rico.
While the latter's problems may seem obscure to some investors, they're not: About two-thirds of all U.S. mutual funds have exposure to Puerto Rico, and more than one-fifth have at least a 7 percent allocation.
That's why the best approach to muni investing is somewhat counterintuitive to conventional market psychology. Diversification—usually thought of as a buffer in down times—could be an investor's worst enemy as the Detroits and Puerto Ricos and Stocktons continue to pop up.
"My direction would be simple individual bonds that they can buy and hold that are not part of a fund, either open-end or close-end, or an ETF," said Marilyn Cohen, president of Envision Capital Management in Los Angeles. "Then you don't have to worry about other people's anxieties and other people's finger on the trigger."
Cohen also warned against being lured in by general obligation bonds, advocating offerings more tied to revenue instead, "but you have to be picky."
Local and state governments have laid off more than two million workers and cut expenses over the past few years in an attempt to get their finances in order.
While underfunded pensions and uneven economic growth remain substantial challenges, austerity has improved the local fiscal outlook and provides allure for investors looking for fixed-income exposure.
"Let's leave Puerto Rico and Illinois out—revenues are better, tax receipts, personal income tax receipts, on and on. Are they going to start tackling their unfunded pension liabilities and health care liabilities...or totally squander it and spend it?" Cohen said. "Then we haven't learned anything from the credit crisis. That's something people really need to look at."
—By CNBC's Jeff Cox. Follow him on Twitter @JeffCoxCNBCcom.