The major domestic equity indexes began the new year on a positive note, with the Nasdaq closing above 7,000 for the first time on Tuesday, on optimism that 2018 will bring more gains for the market.

The Nasdaq, driven by gains in Apple, Facebook, Amazon and Alphabet, breached 6,000 in April of last year and closed above 5,000 in 2015 for the first time in 15 years. The technology index added 1.4 percent on Tuesday, following a 37-percent surge in 2017 that made it the best-performing S&P 500 sector.

The S&P 500 also hit a record high close. Besides technology, S&P consumer discretionary, healthcare, energy and materials indexes all were up more than 1 percent on the day.

Major stock indexes closed out 2017 with their best performances since 2013. Many investors say the rally could continue this year with help from the recently approved U.S. tax overhaul that is anticipated to boost profits as well as the economy.

The S&P consumer discretionary index was up 1.5 percent, helped by a gain in Amazon of 1.7 percent. J.C. Penney, Nordstrom and Kohl’s higher after a bullish Citigroup note on the retail sector detailed benefits from the corporate tax cuts.

Energy shares were up even though oil prices fell. Oil hovered near mid-2015 highs amid large anti-government rallies in major exporter Iran and ongoing supply cuts led by OPEC and Russia. The S&P energy index rose 1.8 percent.

Shares of casino operators Wynn Resorts and Melco Resorts & Entertainment were down after a report showed a lower-than-expected rise in Macau gambling revenue in December.

Abbott Labs rose 3 percent and hit an intraday record of $59.20 after two brokerages upgraded the company’s stock to “overweight.” Shares of Allstate lost ground to the tune of 2.7 percent following a brokerage downgrade.

Approximately 6.7 billion shares changed hands on the major domestic equity exchanges, a number that compares favorably to the 6.3 billion daily average over the past 20 trading days, according to Thomson Reuters data.