Stocks rose on Tuesday as large tech companies like Apple and Amazon outperformed while investors remained cautiously optimistic Washington and Beijing could move forward on a trade deal.
The Dow Jones Industrial Average gained 256.10 points to close at 23,787.45, posting its first three-day winning streak since late November. The rose 0.97 percent to 2,574.41 as the real estate and communications services sectors outperformed. The Nasdaq Composite climbed 1.1 percent to 6,897. For the year so far, the Dow and S&P 500 have risen 1.97 percent and 2.7 percent, respectively. The Nasdaq is up nearly 4 percent in that time period.
Apple shares rose 1.9 percent after CEO Tim Cook tried to assuage some of the concerns plaguing the tech giant. In an interview with CNBC's Jim Cramer, Cook said Apple's "ecosystem has never been stronger." Apple took a beating last week after slashing its quarterly revenue forecast, citing a slowdown in China. Cook also said he feels good about the "real-time" information he receives regarding the U.S.-China trade talks.
Amazon also gained 1.66 percent, while Facebook jumped 3.26 percent. Netflix and Alphabet also closed higher. These gains add to the so-called FAANG trade's sharp rise since Dec. 24. Through Tuesday's close, Facebook shares have surged 15.9 percent since then, while Amazon has rocketed 26.8 percent. Alphabet shares, meanwhile, are up 11 percent in that time period. Netflix's stock is up nearly 37 percent in that time.
"People are getting a bit more optimistic. I think investors noticed that the FAANG stocks are solid companies and their valuations came down a lot after the big sell-off," said Ryan Nauman, market strategist at Informa Financial Intelligence. There's also "some optimism in trade and the FAANGs have been pretty highly correlated to the developments of trade."
Tuesday's moves come as several officials from the world's two largest economies continue talks to resolve their ongoing trade dispute. U.S. Commerce Secretary Wilbur Ross told CNBC on Monday that both global powers could reach a settlement "they can live with, and that addresses all the key issues."
China's Foreign Ministry previously said Beijing had "good faith" to work with Washington to reach an agreement before a March deadline.
President Donald Trump also tweeted on Tuesday that U.S.-China trade talks are "going very well."
Strategists at MRB Partners said in a note the U.S.-China trade situation is setting itself up for a more benign outcome than had been previously expected.
"The U.S.-China power struggle will persist for years, but both economies are now slowing and neither government has the latitude to pursue policies that could threaten to trigger a global recession," they said. "The Argentina handshake will morph into a near-term truce."
However, investors are still grappling with an ongoing U.S. federal government shutdown that started over a disagreement on funding for a wall along the U.S.-Mexico border. Trump is scheduled to deliver a prime-time address Tuesday night and is expected to focus on the standoff over his proposed border wall that has shut down large chunks of the federal government.
Bank shares struggled, however. J.P. Morgan Chase fell 0.2 percent, along with Wells Fargo and Bank of America. The losses came after Jefferies downgraded J.P. Morgan, citing the possibility of no rate hikes from the Federal Reserve.
Chipmakers also fell. Nvidia and Applied Materials fell 2.5 percent and 4.05 percent, respectively. Lam Research also slipped. The decline in chip stocks came after Samsung slashed its fourth-quarter earnings guidance due to lackluster demand for memory chips.
"Apple and Samsung warnings are important as they signal tighter margins, less pricing power and increased competition," said Larry Benedict, founder of The Opportunistic Trader. "This affects more than these giants."
"We are not optimistic here," Benedict added.
—CNBC's Sam Meredith contributed to this report.