Oil and gas exploration companies led U.S. stocks modestly higher Wednesday, giving the market its second gain in two days.
Energy stocks, already the best-performing category this year, got a boost from U.S. crude oil prices, which climbed to their highest level in 15 months. Companies that make consumer products were the biggest laggards.
Investors brushed off new data showing residential construction slowed last month. Instead, the focus remained on the latest crop of companies reporting quarterly results.
Overall earnings of companies in the Standard & Poor's 500 index have been down on an annual basis for the past five quarters. But this earnings season, results so far suggest the start of a turnaround, said Paul Christopher, head global market strategist for Wells Fargo Investment Institute.
"We do think the earnings recession is ending," Christopher said. "We're still early in the reporting season, but we see so far the trends that we're looking for."
The Dow Jones industrial average rose 40.68 points, or 0.2%, to 18,202.62. The S&P 500 index rose 4.69 points, or 0.2%, to 2,144.29. The Nasdaq composite index ticked up 2.58 points, or 0.1%, to 5,246.41.
Indexes wavered between small gains and losses in early trading Wednesday, then turned higher by midday and stayed higher for the rest of the day.
Morgan Stanley rose 1.9% to $32.93 after the investment bank said its earnings soared 62% in the third quarter, thanks to big gains in bond trading. Goldman Sachs disclosed similar results Tuesday.
Quarterly results from other companies failed to impress traders.
Intel, which issued a downbeat earnings outlook, slumped 5.9% to $35.51.
Manhattan Associates tumbled 10.4% to $52.85 after the business software company reported weak quarterly sales and cut its revenue outlook.
Lighting maker Cree also served up weak sales and an earnings outlook that fell short of Wall Street's expectations. The stock tumbled 11.1% to $22.41.
About 80 of the companies in the S&P 500 were scheduled to report quarterly results this week. Earnings for the third quarter are projected be down about 0.9% overall from a year ago, according to S&P Global Market Intelligence.
That forecast is largely due to the energy sector, which has been hard hit by falling energy prices.
That wasn't the case Wednesday. A report of a drawdown in oil inventories helped lift crude prices. U.S. benchmark crude oil climbed 2.6% to $51.60 a barrel. Brent crude, the international standard, advanced 1.9% to $52.67 a barrel.
The pickup in oil prices sent shares in several energy, exploration and drilling services companies higher.
Transocean jumped 5.7% to $10.46, Halliburton rose 4.3% to $49.07 and Newfield Exploration climbed 3.9% to $44.18.
Global stock markets were mostly steady Wednesday after China reported that its economy expanded at a firm pace in the July-through-September quarter.
In Europe, Germany's DAX rose 0.1% and France's CAC 40 gained 0.3%. The FTSE 100 in Britain advanced 0.3%. Japan's Nikkei 225 index rose 0.2%, Australia's S&P ASX/200 climbed 0.5% and the Kospi in South Korea was flat. Hong Kong's Hang Seng index lost 0.4%.
Wholesale gasoline was little changed at $1.51 a gallon. Heating oil rose 2 cents to $1.59 a gallon. Natural gas fell 9 cents to $3.17 per 1,000 cubic feet.
Gold rose $7 to $1,269.90 an ounce. Silver rose 3 cents to $17.66 an ounce. Copper was little changed at $2.10 a pound.
Bond prices barely budged. The yield on the 10-year Treasury note held steady at 1.74%.
In currency markets, the dollar fell to 103.39 yen from 103.89 yen, and the euro weakened to $1.0969 from $1.0977.
2:25 p.m.: This article was updated with closing prices, analysis and additional information.
1:15 p.m.: This article was updated with the close of markets.
8:15 a.m.: This article was updated with more recent prices and additional market information.