President Donald Trump in the Rose Garden of the White House in Washington, DC, May 16, 2019.

"The costs of the trade war in our view are about its indirect impacts," Deutsche Bank's chief strategist, Binky Chadha, said in a note to clients. "The trade war has been key in preventing a recovery in global growth and keeping US equities range bound. Foregone US equity returns from price appreciation (12.5% annual rate) for 17 months are worth $5 trillion."

Given the bulk of equity returns come from stock price appreciation, in an escalated trade war with China and now Mexico, the U.S. is losing trillions of dollars in foregone returns as markets sink on the negative headlines, the bank said Friday.

President Donald Trump 's trade battles are costing the U.S. stock market $5 trillion and counting, according to Deutsche Bank.

That number was set to get worse Friday with the Dow Jones Industrial Average down more than 250 points.

Earlier this month, Trump said that China reneged on a trade deal that was on the brink of being passed. Trump then hiked tariffs on $200 billion worth of Chinese goods and China retaliated with tariffs on $60 billion worth of imports.

On Thursday, Trump tweeted that on June 10 the United States will impose 5% tariffs on all Mexican imports. The president said these levies will stay in place until illegal migrants stop coming into the U.S. from Mexico.

The majority of equity returns, 75% to 85%, come from price appreciation and the S&P 500 has risen in a clear trend channel with a 12.5% price appreciation rate annually since the economic recovery began in 2009. However, Chadha said that tracing back to the January 2018 steel and aluminum tariffs, trade war equities have been range-bound.

"The trade war played a key role in exacerbating global growth in manufacturing and in preventing a recovery from" factors like Brexit, the note said.

—Source Deutsche Bank

The is down 5.33% in the month of May through Thursday's close and down 5.6% from its 52-week high.

Chadha said the trade war impacts are quickly becoming comparable to the implications of the European financial crisis and the dollar and oil shocks on U.S. equities.

— With reporting from CNBC's Michael Bloom