U.S. stocks rose on Tuesday as technology shares cut sharp losses from the previous session.

The Dow Jones industrial average closed 389.17 points higher at 24,033.36 with Nike as the best-performing stock in the index. The gained 1.3 percent to close at 2,614.45, with tech rising 1 percent and energy leading. The Nasdaq composite advanced 1 percent to 6,941.28.

"So far, this is a reaction to an oversold condition," said Bruce Bittles, chief investment strategist at Baird. "What we're looking for now is an upside volume explosion" of nine stocks rising for every declining stock to confirm a new upward trend is starting out. "Unless we get that, all rallies are suspect."

Netflix shares rose 1.2 percent while Amazon gained 1.5 percent in volatile trading, while Facebook advanced 0.5 percent.

The major averages briefly hit session lows as tech stocks hit their lows of the day. Amazon traded lower momentarily after President Donald Trump bashed the company again on Twitter.

"Our 'Tweeter-in-Chief' attacked Amazon again and that took the FANG stocks lower," said Dave Lutz, head of ETF trading at JonesTrading about the slip earlier in the session.

Amazon surged to session highs late in the session after Bloomberg reported, citing sources, that the White House had no plans to take action against the company. The major averages also hit their highs of the day after the news.