Tuesday's stock market action is an indicator of what could come if the United States and China strike a trade deal — even if it's a bad one, CNBC's Jim Cramer said.
"Today's rally was a reminder that if we do get any breakthrough in the trade talks whatsoever, you're going to get an epic rebound" the "Mad Money" host said. "Today may smack more of fantasy than of fact, but now you know what the market would feel like if President [Donald] Trump and the Chinese Communist Party can find a way to bury the hatchet."
As of Tuesday, an imminent deal seems unlikely, with both countries refusing to compromise, Cramer said. But investors found a silver lining in the U.S. Commerce Department's decision to relax restrictions on Huawei, allowing American companies to fulfill networks and software orders for the Chinese phone company through Aug. 19.
Stocks that are caught in the crosshairs of the trade war were able to make gains during the trade day. Chipmakers like Micron Technology and Xilinx rallied — 3% and 4.6%, respectively — on the news and buoyed the market. Shares of Qualcomm, Nvidia and Lam Research also expanded as much as 2.2%.
"You got a glimpse of what could happen if we just got a trade armistice," Cramer said.
Cramer noted that Huawei supplier Qorvo, which slashed its first quarter earnings guidance by 15 cents per share Tuesday morning, was able to gain 0.44% during the trading day. The semiconductor company lost nearly $2 billion in market capitalization as a result of the earnings cut, he added.
"I think it's already baked in, and more important, if the export ban ends up being delayed indefinitely, the stock could roar right back," he said.
Boeing also hinted at a potential upside from a trade deal. The recently troubled airplane manufacturer surged 1.69%.
"I think you could've had an even bigger move, maybe double, but the stock stalled out when a Wall Street Journal article published claiming that Boeing downplayed the doomsday scenario that led to the crash of Ethiopian Airlines Flight 302," Cramer said.
Apple shares also rallied just under 2%. Cramer said the market expects the iPhone maker to be a target of China's retaliation against Trump's tariff hike earlier this month.
"This rebound is all about China. With Trump easing up on Huawei, the Chinese have an incentive to hold off on going after Apple. And if they never end up being targeted, well this stock could roar," Cramer said.
Cramer warned investors who are betting against Caterpillar to be cautious about their assessments. He explained that the construction machinery manufacturer recently boosted its dividend by 20% and is buying back large amounts of stocks, which can reduce the amount of shares on the market and bolster the stock price.
"CAT's levered to worldwide sales and, more important, earnings. This is not the old Caterpillar," Cramer said. "CAT rallied today thanks to the deescalation with China, but really it shouldn't be trading in lockstep with China in the first place."
Disclosure: Cramer's charitable trust owns shares of Apple, Nvidia, and Lam Research.