The Dow Jones industrial average led the major indexes higher Thursday, notching a record close on the second-to-last trading day of the year. It was the Dow’s 71st record close for the year.

The index added 63.21 points to close at 24,837.51, with UnitedHealthand IBM contributing the most to the gains. The Dow did not hit an intraday high, but remains less than 0.2 percent away.

As of Thursday’s close, the Dow was on pace for slight weekly gains. The last time the Dow rose in each of the final six full weeks of the year was in 1954. That does not include weeks encompassing two different years.

DJIADow Jones Industrial Average24837.51
S&P 500S&P 500 Index2687.54
NASDAQNASDAQ Composite6950.16

“Those that are in [the market] are hoping we might be able to make a new high at the close of the year,” Robert Pavlik, chief investment strategist at SlateStone Wealth. “I think 2018 is going to be a pretty good year.”

CNBC’s survey of 14 major market strategists found the median estimate for the S&P 500 in 2017 is 2,590, about 3.6 percent below Thursday’s levels. The median forecast for the S&P 500 next year is 2,850, about 6.1 percent above Thursday’s levels. The S&P has rallied 20 percent this year.

The S&P 500 rose 0.2 percent to close at 2,687.54 with utilities and telecommunications leading advancers, and consumer staples the greatest laggard. The index closed within half a percent of its all-time highs hit on Dec. 18.

The S&P was also tracking for weekly gains as of Thursday’s close. The index would close out the year with six straight weeks of higher trade for the first time the since in 1971.

Trading activity Thursday was again muted, with the second-fewest amount of shares transacted of any full trading day this year. U.S. markets were closed Monday for the Christmas Day holiday and will be closed this coming Monday for New Year’s Day.

“I just think there’s money that’s still on the sidelines,” said Marc Chaikin, CEO of Chaikin Analytics. “I think people are putting off selling until January because they can put off the gains [until the 2018 tax year]. There’s a lack of sellers.”

Meanwhile, the Nasdaq composite also added 0.2 percent to close at 6,950.16 as gains in big technology companies like Apple and Facebookoffset declines in biotechnology stocks like Gilead and Amgen. The index is less than 1 percent away from its all-time high.

Information technology is the top-performing sector in the S&P 500 this year, up 38 percent since January.

“We’re seeing a lot of these companies moving into the sweet spot … Whether it’s mobile advertising, whether it’s online retail, whether it’s streaming video,” said Ark Invest CEO Cathie Wood during CNBC’s “Halftime Report” Thursday. “If you look at mobile advertising, both Facebook and Google, they own that, that’s roughly 20 percent of total advertising.”

Commodity prices, typically an indicator of global growth, also held near recent highs. Copper briefly rose more than 1 percent to its highest level in nearly four years. Oil held just below the psychologically key $60 level, a 2.5-year high which it touched earlier this week; crude settled up nearly half a percent at $59.91.

S&P on track to do something it’s never done before

On a monthly basis, the indexes are also set for a historic end to the year. On a total return basis, which includes dividends, the S&P is on pace for notching gains in every month of the calendar year for the first time in history, according to Ryan Detrick, senior market strategist at LPL Financial.

“That’s never happened in the history of the S&P for a calendar year,” Detrick told CNBC. “The S&P is up 20 percent, and we’ve seen that in the past, [but] what makes this year exceptional is just the total lack of volatility.”

“The one stat that gets us is that the largest pullback [in 2017] was 2.8 percent, that’s the smallest since 1995.”

Should the Nasdaq composite finish December higher, it will have posted gains in 11 of 12 months in 2017, a first for the tech-heavy index.The Dow is on pace for its first nine-month winning streak since 1959 and the S&P is on track for its first nine-month winning streak since 1983.

“I think it’s reflective of the fact the economy has definitely shown some improvement,” Pavlik said. “I think the U.S. stock market is reflective of all that [economic growth] along with better earnings and an improvement in sentiment.”

In economic news, the advance trade deficit in goods increased to $69.7 billion in November from $68.1 billion in October. Weekly jobless claims came in at 245,000 versus expectations of 240,000.

The Chicago PMI for December rose to 67.6, its highest since March 2011, according to Reuters.

Traders gather for the IPO of Singapore-based Sea Limited on the floor of the New York Stock Exchange (NYSE) in New York, U.S., October 20, 2017.

Brendan McDermid | Reuters
Traders gather for the IPO of Singapore-based Sea Limited on the floor of the New York Stock Exchange (NYSE) in New York, U.S., October 20, 2017.

The 2-year Treasury yield was little changed near 1.91 percent, just off nine-year highs, while the 10-year yield also traded mildly higher around 2.43 percent.

Overseas, major Asian indexes closed mildly lower. The Shanghai composite gained 0.6 percent, while the Nikkei 225 fell just over half a percent.

The euro strengthened to trade near $1.195 as the U.S. dollar index fell to its lowest since Dec. 1. The dollar index is down more than 9 percent this year, tracking for its worst year since 2003.

Gold futures for February delivery settled nearly half a percent higher at $1297.20.