NEW YORK (AP) _ Stocks rallied sharply this morning, supported by a stronger dollar, rising bond prices and the belief that U.S. trade deficit figures to be released Friday won't be as bad as feared.

''People who thought the bear had set its claws in this market are surprised,'' said Peter J. DaPuzzo, manager of the retail equity group at Shearson Lehman Brothers Inc.

The Dow Jones average of 30 industrials was up 18.97 points to 2,568.24 as of 11 a.m. EDT. Broader market barometers also rose.

Analysts said both the bond and stock markets were focusing on the prospect that the July trade deficit wouldn't surpass the $15.7 billion shortfall reported for June, partly because Japan said its August trade surplus narrowed significantly to $5.15 billion from $7.48 billion a year earlier.

Speculation that the U.S. trade deficit may show shrinkage helped buoy the dollar and lessened fears of higher inflation and interest rates.

On the New York Stock Exchange, advancing issues outran decliners by more than a 3-to-1 margin, with 1,016 up, 329 down and 402 unchanged. Big Board volume totaled 61.77 million shares after 90 minutes of trading.

The NYSE's composite index of all listed common stocks was up 1.25 to 177.08. On the American Stock Exchange, the market value index was up 2.46 at 350.01.

Among actively traded blue chips, Philip Morris rose 1 3/4 to 112 , International Business Machines rose 1/4 to 157 1/2 , General Electric rose 5/8 to 60 5/8 and American Telephone & Telegraph rose 3/8 to 32 5/8 .

On Wednesday the Dow Jones industrial average, which had fallen 177.30 points over the nine previous sessions, rose 4.15 to 2,549.27.

Advancing issues slightly outnumbered declines on the NYSE, with 812 up, 759 down and 436 unchanged. Big Board volume totaled 164.91 million shares, against 242.80 million in the previous session.