NEW YORK — The stock market closed out the second quarter regaining its upward momentum as investors were encouraged by an improving economy.
Stocks have resumed their upward trajectory after getting off to their worst start in five years in the first quarter. Investors sold stocks in January as they worried about the impact of an unusually harsh winter on the economy. The dangers of the intensifying conflict between Russia and the Ukraine also weighed on the markets.
By contrast, there were fewer worries in the second quarter.
As the weather improved, there was more encouraging news about hiring and manufacturing. Stocks were also propelled higher by a turnaround in some of the riskier parts of the market. Internet, biotechnology and small-company stocks all rebounded after dragging the market lower in March.
Company earnings, already at record levels, continued to grind higher. Even an escalating conflict in Iraq that pushed up oil prices in June wasn’t enough to stop stocks from rising.
“I’m not seeing anything that’s going to derail the overall upward climb of the market,” said Karyn Cavanaugh, senior market strategist with Voya Investment Management. “The economic backdrop is getting better, so companies will make even more money.”
The Standard & Poor’s 500 index fell 0.73 points today, less than 0.1 percent, to 1,960.23, just two points from its record close of 1,962.87 set June 20. The index rose 4.7 percent in the quarter and closed at an all-time high on 16 occasions during in the period.
The Dow Jones industrial average fell 25.24 points, or 0.2 percent, to 16,826.60 and posted a gain of 2.4 percent in the quarter. The Nasdaq composite rose 10.25 points, or 0.2 percent, to 4,408.18, rising 5 percent in the quarter.
Stocks flickered between small gains and losses today, keeping major indexes close to record levels, as investors assessed the latest data on housing.
Home builders rose following news that the number of Americans who signed contracts to buy homes shot up in May. The National Association of Realtors said its seasonally adjusted pending home sales index rose 6.1 percent to 103.9 last month. It was the sharpest month-over-month gain since April, 2010.
Utility stocks also did well. The sector rose 0.8 percent, making it the biggest gainer of the 10 industry sectors that make up the S&P 500 industry.
The group has climbed 16.4 percent this year as bond yields have fallen, forcing investors to look elsewhere for income. Power company stocks are regarded as a steady investment and they also pay rich dividends.
General Motor was among the day’s losers.
Trading in the automaker’s stock was briefly suspended in the afternoon after the company announced that it was recalling at least 7.6 million more vehicles dating back to 1997 to fix faulty ignition switches.