By Barbara Kollmeyer, MarketWatch , Ryan Vlastelica

9 of 11 S&P 500 sectors rise

U.S. stocks rose in a thinly traded session on Tuesday, with the Nasdaq hitting its latest in a series of records as the market's recent upward bias continued, helped by a gain in technology shares.

The 20,000 milestone, meanwhile, remained elusive for the Dow Jones Industrial Average, which came within 20 points of the psychologically important level only to give up most of the day's gains.

Read: Dow's 20,000 dalliance is a reminder that it's the best active fund ever fashioned (http://www.marketwatch.com/story/the-dow-is-arguably-the-best-active-fund-ever-engineered-2016-12-22)

Overall, stocks saw a broad but slight advance, with all but two of the S&P 500's 11 primary sectors higher on the day. Retail stocks were in focus as investors looked to the first reads on the strength of the holiday shopping season.

"We'll probably drift higher to finish the year, because that's typical from a historic basis," said Wayne Kaufman, chief market analyst at Phoenix Financial Services. "We're getting ready for 2017, waiting to see if there will be any kind of unwind in the 'Trump rally' because a lot of anticipation has been built into stock prices and it may be too much."

Also read:In One Chart: Stock-market inflows may have lot further to run (http://www.marketwatch.com/story/stock-market-inflows-may-have-a-lot-further-to-run-according-to-this-chart-2016-12-27)

Total composite volume, which includes New York Stock Exchange, Nasdaq,NYSE MKT and NYSA Arca composite volumes, was 4.081 billion shares--the second-lowest for a full-day trading session this year, according to final numbers.

The final trading week of the year is typically a quiet one, with light trading and few planned news events--such as central bank announcements or corporate earnings--to dictate market direction. Many traders were out of the office following the Christmas holiday, for which the equity market was closed on Monday, while others are waiting for the new year to make big portfolio changes.

Some investors may be looking to take profits given the sharp rally that occurred following the U.S. presidential election. The Dow is up almost 9% since the election, bringing its year-to-date gain to 14.5%. The blue-chip average has come within 0.1% of the psychologically significant level of 20,000, but has been unable to overcome the final hurdle. The Dow is coming off its seventh straight weekly gain.

See:What Dow 20,000 means for stock-market investors (http://www.marketwatch.com/story/what-dow-20000-means-for-stock-market-investors-2016-12-14)

The S&P 500 is up about 6% since the election, and it is up 11% for the year, while the Nasdaq Composite has gained 9.6%, driven by a postelection rise of more than 5%. Small-cap stocks have been particular outperformers; the Russell 2000 is up 21.4% in 2016, with nearly 15% of that rise occurring since the election.

The Dow Jones Industrial Average rose 0.1%, or 11.23 points, to end at 19,945.04, while the S&P 500 advanced 5.09 points, or 0.2%, to 2,268.88 and the Nasdaq Composite Index added 24.75 points to settle at 5,487.44, a gain of 0.5%. In addition to ending at a record close, the Nasdaq also struck a new intraday record of 5,512.37.

The Nasdaq was boosted by a rise in technology shares; the sector rose 0.5% on the day, the best performer among S&P 500 industries. Nvidia Corp.(NVDA) rose 6.9%, ending at a record.

Read: Growing signs that the Dow might not make it to 20,000 by the end of 2016 (http://www.marketwatch.com/story/dow-20000-isnt-a-foregone-conclusion-in-2016so-dont-break-out-the-bubbly-2016-12-22)

In the latest economic data, the S&P Case-Shiller index (http://www.marketwatch.com/story/rise-in-us-home-prices-shows-no-sign-of-abating-2016-12-27) of home prices climbed 0.6% in October and was up 5.1% in the past year, unchanged from the prior month. Consumer confidence in December jumped to 113.7 from a revised 109.4 in November, hitting its highest level since 2001 (http://www.marketwatch.com/story/consumer-confidence-hits-highest-level-since-2001-2016-12-27).

Opinion: What this week's stock market will tell you about 2017 (http://www.marketwatch.com/story/what-this-weeks-stock-market-will-tell-you-about-2017-2016-12-26)

(http://www.marketwatch.com/story/what-this-weeks-stock-market-will-tell-you-about-2017-2016-12-26)Among Tuesday's biggest movers, retailers Amazon.com Inc.(AMZN) and Wal-Mart Stores Inc.(WMT) were in focus amid postholiday Christmas shopping (http://www.marketwatch.com/story/retail-etfs-rise-as-early-indications-point-to-strong-holiday-shopping-season-2016-12-27) as the first. The SPDR S&P Retail ETF(XRT) rose 1% on Tuesday, while the Amplify Online Retail ETF(IBUY)--which only holds companies that get a majority of their sales from online purchases--rose 0.7%.

Amazon shares rose 1.4% while Wal-Mart edged 0.2% higher.

Across other markets, Asian stocks had a largely lackluster session (http://www.marketwatch.com/story/asian-stocks-trade-mixed-toshiba-takes-a-hit-over-loss-report-2016-12-27), while European equities traded mostly flat (http://www.marketwatch.com/story/european-stocks-struggle-for-direction-in-first-day-of-post-christmas-trade-2016-12-27). London markets remain closed for an extended Christmasbreak.

Opinion:New Year's Resolutions: What money pros vow to do better in 2017 (http://www.marketwatch.com/story/new-years-resolutions-what-money-pros-vow-to-do-better-in-2017-2016-12-26)

Crude prices posted gains (http://www.marketwatch.com/story/oil-prices-steady-as-investors-wait-for-production-cuts-to-roll-out-2016-12-27) of 1.6%, while gold and silver prices moved higher. The dollar inched up against major rivals (http://www.marketwatch.com/story/dollar-inches-up-as-market-keeps-a-close-eye-on-trumps-economic-plans-2016-12-27).

(END) Dow Jones Newswires

December 27, 2016 16:57 ET (21:57 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.