People wait in line to take a picture with the bronze bull in the Financial district on Wall Street in New York City. / Spencer Platt, Getty Images

by Adam Shell, USA TODAY

by Adam Shell, USA TODAY

NEW YORK - It was a somewhat scary but ultimately satisfying second quarter for stock investors.

U.S. stocks shook off recent fears of a coming shift by the Federal Reserve to a less market-friendly monetary policy and a weak day Friday to finish the quarter in positive territory. The Standard & Poor's 500 stock index, after a 2.4% second-quarter gain, finished the first half of 2013 up 12.6%, its best start to a year since 1998.

The Dow Jones industrial average gained 2.3% in the quarter, extending its first-half gain to 13.8%. The Nasdaq composite notched a quarterly gain of 4.2% and is up 12.7% for the year.

While the April-through -June quarter wasn't nearly as profitable as the first quarter, when the major indexes posted double-digit percentage gains after the economy avoided going over the so-called "fiscal cliff," the bull market in stocks remained intact.

The continued move higher came despite a bout of nerve-rattling volatility beginning in late May that was sparked by heightened uncertainty over the Fed's timetable for pulling back on its massive bond-buying program. The Fed's purchases of mortgage-backed bonds and long-term U.S. government bonds, which began in late 2008, have been instrumental in driving borrowing rates to record lows and goosing asset prices, including stocks. The prospect of less Fed support for markets and the economy led to initial negative reactions in both the stock and bond market.

"The market went straight up for a while, but net net there is still value out there (following the recent pullback)," says Michael Bapis, managing director of a HighTower wealth management firm The Bapis Group.

While he won't rule out more market turbulence this summer, Bapis expects stocks to be higher at year's end, as he expects the economic news to keep coming in the upside, which suggests that the Fed's policies have helped boost growth.

The major highlight of the quarter came in late May when the S&P 500 and Dow industrials broke through their prior 2007 peaks to notch fresh all-time highs. The three-month span also saw a the first price "pullback," or drop of more than 5%, since November, when stocks sold off in late June on Fed-related fears. Other key market events included a big selloff in 10-year Treasury notes, which caused yields to spike as high as 2.66%, a full percentage point higher than a year ago and its highest level in 22 months. Stock market drops of 20% or more in Japan and China also spooked investors late in the quarter.

There is a contingent on Wall Street that thinks if the Fed is right, and the economy and jobs market will keep improving as the year progresses, stocks will do just fine in the remainder of the year. Of course, markets could take a hit if interest rates suddenly soar or if China's economy slows more than expected or a crisis occurs there or in other countries around the globe.

Andres Garcia-Amaya, global market strategist at J.P. Morgan Funds, says the Fed taking its foot off the stimulus pedal is a positive, not a negative for stocks going forward.

"If the reason the Fed is starting to taper its bond purchases is because the economy is getting better (and inflation is tame), that is actually good for equity markets," says Garcia-Amaya. "The analogy is the training wheels are coming off. And that means more market volatility. At first the market will be wobbly, just as a kid trying to ride a bike on his own. If we continue to get data that shows gradual improvement, the stock market will realize this is healthy and it will mean stronger earnings. Stocks will be OK in a rising rate environment."

Baggini still thinks stocks are the most appealing investment for the second half of the year. Cash still paying zero interest remains unappealing. So do 10-year Treasuries, as selling pressure will likely continue and cause principal losses for bond investors. And, while real estate has fared well recently, it's still an illiquid investment.

"If things are improving with low inflation it makes good sense and is a good time to be investing in the stock market," says Baggini, adding that so-called cyclical stocks that benefit when the economy turns up are a better bet than more defensive stock investments.