NEW YORK — Stocks made modest gains Thursday as the market again turned higher late in the day. Energy stocks led the way as investors continued to hope that oil prices have stabilized after almost two years of steep declines.
For the second day in a row, stocks opened with small losses and gradually rose during the afternoon. Energy companies surged and are now slightly higher for the year. Industrial companies such as Caterpillar and John Deere also rose. Drugmakers led a decline in health care stocks.
The Dow Jones industrial average gained 44.58 points, or 0.26 percent, to 16,943.90. The Standard & Poor’s 500 index edged up 6.95 points, or 0.4 percent, to 1,993.40. Tech stocks lagged, and the Nasdaq composite index added 4 points, or 0.1 percent, to 4,707.42.
Stocks have eked out small gains over the past two days, aided by steady oil prices and reports showing the U.S. economy is on solid footing. After a big jump Tuesday, the market is on target for its third consecutive weekly gain.
The price of U.S. crude wavered between small gains and losses, finally closing down 9 cents at $34.57 a barrel in New York. Brent crude, the benchmark for international oils, added 14 cents to $37.07 a barrel in London. The price of U.S. oil has risen more than 30 percent in three weeks, and Brent crude has erased its losses for the year.
ConocoPhillips rose $2.07, or 5.7 percent, to $38.56 and Southwestern Energy jumped $1.13, or 18.2 percent, to $7.34.
Chesapeake Energy continued to skyrocket after the company said it does not expect to be prosecuted or fined as part of a federal investigation into founder and former company head Aubrey McClendon, who left the company in 2013.
Early Wednesday, McClendon was indicted by a federal grand jury on charges of rigging gas-lease bids. Later in the day, officials announced that McClendon had died in a single-car crash in Oklahoma City.
The stock, which jumped 23 percent Wednesday, added another 87 cents, or 25.6 percent, to $4.27 on Thursday. The stock tumbled 74 percent in 2015.
J.J. Kinahan, chief market strategist for TD Ameritrade, said that after Tuesday’s surge, investors are being patient and looking for good news about the state of the economy. That could come Friday morning, when the government reports its latest employment figures.
The Commerce Department said orders to U.S. factories grew 1.6 percent in January, the biggest gain in seven months. A category that measures business investment rose by the largest amount in 19 months.
Supermarket operator Kroger dropped $2.85, or 7 percent, to $37.80 after investors were disappointed with its quarterly sales and its forecasts.



