U.S. stock indexes ended the day Wednesday with modest gains as investors sized up the latest company earnings and new data showing residential construction slowed last month. Energy stocks led among the gainers as oil prices headed higher, while consumer-focused companies lagged the most.

ON WALL STREET: At the close, the Dow Jones industrial average was up 40.7 points, about 0.2 percent, at 18,202.6. The Standard & Poor’s 500 index had gained 4.7 points, about 0.2 percent, to 2,144.3. The Nasdaq composite index was 2.6 points, about 0.05 percent, at 5,246.4.

advertisement | advertise on newsday

OIL PRICES: As markets closed, the price of U.S. benchmark crude was up $1.05 at $51.67 a barrel on the New York Mercantile Exchange. In London, the price of Brent crude, the international benchmark, was up 90 cents at $52.58 a barrel.

ALL ABOUT EARNINGS: Investors are poring over company earnings reports to gauge the market’s prospects for growth in coming months and get a better handle on the state of the economy. About 80 of the companies in the S&P 500 are scheduled to report quarterly results this week.

HOME CONSTRUCTION: The Commerce Department said residential construction slowed 9 percent in September to a seasonally adjusted annual rate of 1.05 million units. That’s the second straight monthly pullback and the slowest pace in 18 months. A steep drop in apartment construction overshadowed a surge in single-family home construction.

STEADY CHINA: The 6.7 percent annual pace of growth reported by China was supported by strong consumer spending that helped offset weakness in trade. That was in line with the two previous quarters and better than some forecasters expected. “We won’t get the full breakdown until tomorrow but we suspect that the key driver was stronger growth in real estate services, on the back of buoyant property sales. Financial sector growth is also likely to have recovered as last year’s equity bubble dropped out of the base for comparison,” analyst Julian Evans-Pritchard of Capital Economics said in a commentary.