NEW YORK -- The stock market, struggling with widespread concern over recent volatility, Thursday won a modest victory when prices closed slightly higher after fighting to overcome an early selloff. Trading was moderate.

The Dow Jones industrial average, which fell 57.20 Wednesday, rose 0.17 to close at 1879.31. The Dow fell 27 points in the first hour and then climbed back to hold a 9-point advantage that slipped away in the final half hour.

Advances edged declines 791-729 among the 1,947 issues trade. Volume totaled 158 million shares, compared with 181.7 million shares traded Wednesday.

Broad-market indexes also inched higher. The NYSE composite stock index rose 0.25 to 136.97. Standard & Poor's 500-stock index rose 0.51 to 243.14. The price of an average share added 6 cents.

The dollar ended mostly higher after fluctuating in a narrow range. Traders said the dollar's slide, which began earlier in the week, was stemmed by unconfirmed reports of dollar buying by Japan's central bank and the Federal Reserve.

Traders said the market's optimism of last week had turned sour because of uncertainty over prospects for improvements in the U.S. trade deficit.

Analysts said the increasing gloom was fueled by statements by U.S. Trade Representative Clayton K. Yeutter that he didn't think the U.S. trade gap would shrink substantially until the second half of the year.

However, Yeutter, speaking to reporters in Hong Kong and Beijing via satellite from Washington, said a gradual rise in U.S. exports during the past 18 months indicates America is making a turnaround in trade.

The stock market's drop on Wednesday "scared a few people away," said "We have not seen much program activity today and institutional interest has been pretty light."

Rodd Anderson, vice president in equity trading at Shearson Lehman Bros. Inc., said the stock market was disturbed yesterday by the Commerce Department report Wednesday showing housing starts off 16.2 percent in December and the Japanese trade report on Tuesday showing that nation's trade surplus widened last month.

"Some people are starting to worry about a recession, and {investors} have become a tad defensive," Anderson said. "The market needs some consistency" to recover from the October plunge and the 140-point setback on Jan. 8.