Buoyed by better-than-expected trade deficit figures, the Dow Jones industrial average shot up 39.96 points to 1956.07 yesterday, giving the widely followed stock market average a gain of 44.76 for the week.

Most of the action came in the first half-hour of trading, when the Dow soared more than 50 points following the Commerce Department's announcement that the November trade deficit had dropped 25 percent to $13.2 billion. Market analysts had said that if the trade figure, indicating the excess of U.S. imports over exports, was below $14 billion, stock prices would rise.

The Dow was up 56.20 at 12:30 p.m. and was still up 53.05 when the final hour of trading began at 3 p.m. But in the final hour, the Dow gave up almost 14 points.

"Volume is light and trading is dull," said John Burnett, senior trader at Donaldson, Lufkin, Jenrette. "Ninety percent of the action was on the opening."

The increasingly global nature of stock trading was evident yesterday on the London Stock Exchange. Within an hour of the Commerce Department's announcement, the 100-share Financial Times index turned a 5-point deficit into a gain of more than 50 points.

Across America yesterday, market watchers were pleased by the trade numbers, but they remained cautious about the outlook for stock prices in this uncertain period following Oct. 19th's 508-point drop in the Dow.

"I think most of our investors are very interested in the stock market," said James W. Abruster, an analyst with Robert W. Baird & Co. in Milwaukee. "While they are somewhat discouraged by what happened in October, they are still very interested in good fundamental stocks."

In sunnier Pompano Beach, Fla., market analyst William Bretz of Juncture Recognition said the stock market rise yesterday was a temporary blip in a downward trend that will run at least another month. Bretz is a technical analyst who predicts broad market trends, rather than picking the direction of individual stocks.

"We will go back down again into late February or March and by that time if that base formation holds together, which I expect it will, then I think you will have a real good rally in the summer," Bretz said.

Bretz said his view of the market has been enhanced by the sunny Florida weather. "The last couple of days were cold, miserable and rainy," he said. "Right now, it is 70 degrees and the sun is shining so I feel much better. I bet this sounds good to you up there."

Meanwhile, in Des Moines, Iowa, where the weather is cold and the focus is on politics rather than profits, R.G. Dickinson & Co. stockbroker Rich Wankerl was more pessimistic. "Long-term, I don't think we are out of the bear market yet," Wankerl said. Asked who he would support for president in the Iowa caucuses, Wankerl paused and then said, "I forget the names. Who is available out there?"

In the great Northwest, David Poole of Gallagher Capital Corp. in Portland, Ore., applauded the decision by the New York Stock Exchange to put certain restrictions on computer-directed program trading whenever the Dow moves up or down by 75 points in a single day. But he said the firm's clients, mostly large institutional investors, are still reeling from the October market collapse. "They are still shocked about what happened in October," said Poole, a self-described analyst, broker and trader. "And they are exceedingly cautious."

In downtown Washington, Lee Folger, the chairman of the Folger Nolan Fleming Douglas Inc. brokerage firm, said his clients are still nervous, despite the positive news on the trade balance. "I think that our investors are concerned about the market volatility and that certainly one set of trade numbers does not allay that concern," he said.

Volume on the NYSE was 197.94 million shares, not heavy by recent standards. The New York Composite Index closed at 141.16, up 3.19. The American Stock Exchange Composite Index was up 4.43 to 268.31 and the over-the-counter composite was up 5.91 to close at 340.14.

On the Big Board, IBM closed at 119, up 3 1/8; GE closed at 46 1/4, up 1 3/4; Exxon was up 2 1/8 to 40 7/8. Locally, Marriott Corp. was up 1/2 to 29 1/4; Riggs Bank lost 1/8 to 19 3/8; and Martin Marietta gained 5/8 to 43 7/8.

The National Association of Securities Dealers, which was criticized for poor execution of trades in the over-the-counter market during October's market collapse, said yesterday it received permission from government regulators to proceed with a new automated system. "This alternative means of accessing market makers helps overcome the limitation of telephone contact, particularly in high-volume fast-moving markets," said NASD President Joseph Hardiman.