Stocks rose on Wednesday boosted by tech shares as investors cheered solid economic data. The S&P 500 climbed back to a new high for the year.

The rose for a third-straight day, gaining 0.7 percent to close back above 2,800, a key level watched by investors. The Dow Jones Industrial Average closed 148.23 points higher at 25,702.89. The Nasdaq Composite advanced 0.7 percent to close at 7,643.41.

The S&P 500 tech sector rose 0.7 percent, led by a 3.8 percent gain in Nvidia. Chipmakers rose broadly, with the VanEck Vectors Semiconductor ETF (SMH) advancing 0.4 percent. Tech shares have been on fire this week, with the sector rising more than 3.5 percent.

Facebook, Amazon, Netflix, Alphabet and Apple all closed higher on Wednesday.

"The move in tech, it almost feels like they're sniffing out something is coming" on the U.S.-China trade front, said Quincy Krosby, chief market strategist at Prudential Financial. "The moves in the semis and Apple are suggesting a deal may be in the coming weeks; perhaps not at the end of March, but sometime in the near future."