At a conference held by a top investment bank in Manhattan last week, attendees were asked to submit what they thought was the biggest risk to the global economy. When their concerns showed up on the conference screen, these words were the most popular: Trump, trade war and protectionism.

Outside, meanwhile, the stock market was having another up day.

In recent weeks, against the expectations of many on Wall Street, investors have not run for the exits as President Trump has stepped up trade brawls with China, Canada and the European Union. On Friday, when the Trump administration and China announced tit-for-tat tariffs on $50 billion of goods from each country, the Standard & Poor's 500 index finished barely lower. The index has gained 2 percent since the end of February, when Mr. Trump began to take action on trade in earnest, and it remains up 30 percent since his election in November 2016.

More from the New York Times:

Why the Fed tweaked an obscure interest rate this week

Google, rebuilding its presence in China, invests in retailer JD.com

CEOs think the Kim meeting was a bad deal for Trump

Why have the markets held up when the prospect of a trade war unnerves many on Wall Street? The United States economy appears to be a picture of health and corporate earnings are surging. That seems to have investors betting that the collateral damage will be manageable.

The Federal Reserve Bank of Atlanta predicted that the United States economy could grow at 4.8 percent rate in the second quarter, which would be the second-highest quarterly growth rate in the past decade. Unemployment is at multiyear lows, retail sales are strong, consumer confidence is high and the inflation rate remains relatively subdued. This strong run could continue if tax cuts for businesses and consumers prompt higher spending.

And, most important to investors, companies' earnings are set to rise at their fastest pace since the years immediately following the financial crisis. Wall Street analysts expect the profits of companies in the S.&P. 500 to surge 26 percent this year, after a 17 percent rise last year.

Rising profits might explain why investors are putting more money in the United States stock market while getting out of other countries. In the past six weeks, a net $29 billion has poured into funds that invest in United States stocks, while $13 billion flowed out of those focused on European stocks, according to Bank of America Merrill Lynch. At the start of this year, analysts expected solid growth around the world, but now Europe's economy is showing signs of weakness, and turbulence has returned to the markets of some developing countries.

But there are few signs in the United States that anxiety about trade is causing a significant pullback in business spending. "We really don't see it in the numbers," Jerome H. Powell, the chairman of the Federal Reserve, said last week. "It's just not there."

Economists are not forecasting big hits to the United States economy from the trade policies either in effect or imminent. Goldman Sachs's economists predicted that the $50 billion of tariffs against China would shave no more than two-tenths of a percentage point off gross domestic product after two years.

Investors may also believe that this period of high tension and tariff threats are the prelude to some sort of deal. The decision to extend a lifeline to ZTE, the Chinese electronics firm subject to United States penalties, showed that the Trump administration and its Chinese counterparts are capable of agreement.

Of course, the trade battles could escalate instead. Mr. Trump has threatened to impose an additional $100 billion of tariffs on China, which would most likely retaliate with its own tariffs. That would do more economic damage and cause some nervy days in the stock market, but not necessarily calamity, said Brad W. Setser, a fellow for international economics at the Council on Foreign Relations. Countries, he said, have ways to soften the blow. "You would start to see some real disruption and higher short-term costs but not the sort of costs that would trigger a recession" in either the United States or China, he said.

Still, there are signs of fear lurking in the stock market.

The S.&P. 500 remains below its peak hit in January, and some analysts say the trade tensions may be holding it back. "Why hasn't the overall market made a new high considering all the fiscal stimulus?" David Rosenberg, chief economist at Gluskin Sheff, said. Stocks of technology companies and smaller companies have done particularly well in recent weeks, indicating that investors right now are drawn to companies that are less vulnerable to trade wars, Mr. Rosenberg added.

Also, it is too early to conclude that the United States can mostly shrug off trade battles. Many American businesses have operations abroad or get a large share of their revenue from foreign markets. The retaliation by other countries has barely begun.

Tariffs push up the costs for businesses, which in turns crimps their profits. If companies start to warn that profits will come in below expectations because of trade, the stock markets in the United States could decline sharply.

Home-building companies provide an example of what might happen. United States homebuilders face a range of rising costs. One of them is they have to pay more for Canadian softwood lumber after the Trump administration imposed tariffs of 20 percent on that product last year. The Standard & Poor's index for stocks in home-building companies is more than 10 percent below its recent peak.

The United States economy could start to disappoint. Interest rates are rising, in part, because the United States federal government is borrowing large sums to cover the fiscal shortfall that resulted from the recent tax cuts. Higher interest rates can quickly crimp growth. This may happen as the economies in Europe are wobbling and those of several large developing countries are showing signs of stress. "There is reason to suspect that we slow the pace of growth in the second half," said James W. Paulsen, a stock market strategist at the Leuthold Group.