U.S. stocks struggled most of the day Thursday but ended with gains as investors re-evaluated the influence of the strengthened Japanese yen, future moves by the Federal Reserve and oil pricing.

At the close on Wall Street, the Dow Jones industrial average was up nearly 80 points, about 0.5 percent, at 16,416.6. The Standard & Poor’s 500 index gained 2.9 points, about 0.2 percent, at 1,915.5. The Nasdaq composite added 5.3 points, about 0.1 percent, at 4,509.6.

advertisement | advertise on newsday

CRUDE ENERGY: As the trading day ended, the price of benchmark U.S. oil futures, which had been up most of the day, dropped 53 cents, about 1.6 percent, to $31.75 a barrel in trading on the New York Mercantile Exchange. The March 16 contract jumped $2.40, or 8 percent, to close Wednesday at $32.28 a barrel. In London, Brent crude, a benchmark for international oil prices, fell 53 cents, about 1.5 percent, to $34.51 a barrel.

RATE RETHINK: Investors are dialing back expectations that the Fed will continue gradually raising interest rates after recent data showed the U.S. economy had a weak start to the year. On Wednesday, the private ISM survey found U.S. services companies grew in January at the slowest rate in nearly two years. Meanwhile, the dollar sank after New York Fed president William Dudley told financial news agency MNI that the U.S. central bank would have to take into account tight global financial conditions when considering further rate hikes.

ANALYST’S OPINION: “A lot of the pressure in Asia has been taken off by the fact that yen strengthened so much overnight,” which makes Chinese exports more competitive in Asia and reduces the need for Beijing to let China’s yuan fall further, said Andrew Sullivan, sales trader at Haitong Securities. “People are expecting the Fed to be on the back foot now” when it comes to rate hikes, he said. “There’s a lot out there that suggest the Fed that isn’t going to be as bullish as it might have been earlier.”