U.S. President Donald Trump arrives at an event to celebrate the anniversary of first lady Melania Trump's "Be Best" initiative in the Rose Garden at the White House in Washington, U.S., May 7, 2019. Jonathan Ernst | Reuters

Don't underestimate the power of the "Trump put." Analysts say the stock market has been hanging in after trade talks with China hit a rough spot because investors believe a deal is coming, and they also expect President Donald Trump to take action if the stock market looks like it is heading for a real meltdown. The put is the belief that Trump will not let the stock market collapse, since he views it as a measure of his own success. On Friday, stocks cut steep losses and turned positive, after Treasury Secretary Steven Mnuchin said talks with Chinese Vice Premier Liu He were "constructive," as they ended for the day. Several hours later, Trump tweeted that the talks were constructive and that he has a good relationship with Chinese President Xi Jinping. That sent stocks even higher, and the Dow, down more than 350 points during the day, closed 114 points higher to 25,942. For the week, the Dow was down 2.1%. tweet tweet Analysts say stocks could contain losses, as long as investors believe the U.S. and China are moving toward an agreement rather than an escalating trade war. "Trump was effective in helping the markets when it came to tax policy in 2017 and now in coming to an agreement with China," said Peter Boockvar, chief investment officer at Bleakley Advisory Group. "Every time he talks about talks going well with China, that's what the markets want to hear. If he says something good, the markets are going to rally."

Talks between Liu and U.S. officials ended just before noon Friday. After Mnuchin's comments that talks were "constructive," markets were waiting to hear more — and Trump delivered. Traders are concerned about the uncertainty of how China might respond to U.S. tariffs over the weekend, and say markets could be volatile around that on Monday. "What you now expect is some kind of Chinese retaliation over the weekend. I think you have a weak Monday," said Andrew Brenner of National Alliance.

Liu He, China's vice premier, left, shakes hands with U.S. President Donald Trump during a meeting in the Oval Office of the White House in Washington, D.C., April 4, 2019. Andrew Harrer | Bloomberg | Getty Images

Trump's trade skirmish with China took stocks from a record high last Friday to now a weekly loss. The S&P 500 is down 2.2% in its worst week since December. But unlike the December sell-off, this one-week slide has to do directly with White House policy, as opposed to recession fears or worries about Fed policy that slammed the market last year.

Willing to sacrifice?

The question now is whether the president's willing to sacrifice some market gain. "I think there's a lot of faith that he doesn't want to do things that will be too damaging to the stock market. But on the other hand, he is committed to changing the trade relationship with China," said Ed Keon, chief investment strategist at QMA. "Some of the tweets today, when he talks about how well the market has done do suggest he may be able to tolerate some downside to attain a policy goal." Following a group of tweets about China and trade Friday morning, Trump tweeted that 401(k) retirement funds have soared 466% since the market bottomed in 2009. tweet The president also tweeted that he is not in a rush for a deal and that China should not renegotiate deals at the last minute. tweet U.S. stock futures rose early Friday, even after the U.S. moved forward to raise tariffs to 25% from 10% on $200 billion in Chinese goods. Strategists point to positive sentiment from China, where state funds were reported to be buying the market, pushing the Shanghai composite up 3%. But by morning, Trump tweeted he was in "no rush" to strike a deal. That took the air out of the market, and more selling kicked in after the opening bell.