The stock market said a quiet holiday farewell yesterday to a booming and profitable year in which share prices moved to all-time highs.

Nineteen-eighty-five ended with the closely followed Dow Jones average of 30 industrial stocks closing at 1,546.67, up 335.10 points for the year, a 27.7 percent gain. The Dow industrials began the year at 1,211.57. It was the most points gained in a single year.

After flirting with new highs yesterday, the Dow closed the day with a loss of 3.79 points on New York Stock Exchange volume of 112.6 million shares.

Trading during the holiday period has been characterized by light volume and considerable selling to establish losses for tax purposes.

"It's been a great year," said Michael Metz, market strategist at Oppenheimer & Co., in New York, looking over the gains of 1985. Metz, however, expressed doubts about whether the rally would continue its run through 1986.

The bullish fever that grabbed hold of the market Sept. 20 and has been driving stocks to ever-higher levels took the Dow to a record 1,553.10 on Dec. 16, a gain of 341.53 points before the market backed down.

The three-month drive also carried several of the broader market averages to new records. They included the Standard & Poor's 500, which ended the year at 211.28, a gain of 44.04 points for the year, or 26.33 percent. Yesterday's trading brought the market average within a whisker of 212.02, the all-time high for the S&P 500 set on Dec. 16.

Similarly, the Wilshire 5,000 Equity Index, a measure of all stocks with daily quotations, ended the year yesterday at 2,164.69, which is 462.69 points higher than last Jan. 1, for a gain of 27.19 percent. The index reached its peak on Dec. 16, at 2,170.39.

Hildegard Zagorski, market strategist for Prudential Bache in New York, said she expects the market's momentum to continue through 1986.

"The market has been in an uptrend in the latter part of 1985, and that bodes well for the market in 1986," Zagorski said.

She also said that, during the new year, she expects to see large amounts of money flowing into stocks and bonds from maturing certificates of deposit and from newly generated individual retirement accounts.

Metz said the market had responded to what he called a "liquidity rally." He added that elements of the rally included the drop in interest rates, increases in the nation's money supply and contractions in the supply of stock because of corporate mergers and acquisitions.

Despite the rally, "The external world hasn't changed that much," he said, adding that problems still unaddressed include the U.S. trade deficit, the debt problems of foreign countries and the U.S. budget deficit. "Gramm-Rudman is not going to work," Metz said of the balanced-budget plan enacted by Congress. "It's an absolute facade."

Metz said he does not think 1986 is likely to be as good a year for the market as 1985. "We've just delayed facing the basic problems," he said.

The market soon will be looking for more concrete indications of economic progress such as gains in corporate profits, according to Metz.

Nineteen-eighty-five was notable for its huge trading volume. The New York Stock Exchange, the American Stock Exchange and the National Association of Securities Dealers set volume records.

The NYSE, at the 25-billion-share mark, is 2 billion shares ahead of last year. The Amex, at 2 billion shares, is ahead of its 1983 peak.

In yesterday's trading, Union Carbide was the most active NYSE-listed issue, adding 3/4 to 71. GAF Corp. fell another 3 3/8 to 59 1/8 after dropping 5 3/4 Monday on news that its stockholders face heavy dilution of their holdings if GAF's bid for Union Carbide succeeds.

MidCon was the second-most-active issue, adding 3 1/2 to 69 1/2 amid speculation that Occidental Petroleum might bid for the natural gas pipeline company. Occidental fell 2 1/4 to 30 3/4.

Phillips Petroleum was the third-most-active issue, up 1/4 to 12 1/8.

In the technology sector, IBM fell 3 1/4 to 155 and Digital Equipment lost 3 1/4 to 132 1/2.

Among other blue chips, U.S. Steel added 3/8 to 26 5/8, AT&T edged up 3/8 to 25 and General Motors (ex-dividend) fell 1 3/4 to 70 3/4.

In the telecommunications sector, Bell Atlantic jumped 2 1/2 to 106 1/2 and Ameritech rose 2 3/4 to 106 1/2. Bell South added 3/4 to 49.