The stock market likely wasn't foremost on President Donald Trump's mind when he said during his inauguration, "From this day forward, it's only going to be America first." But it's worked out that way for investors.

As the year's halfway point approaches, the Dow Jones Industrial Average is almost exactly flat for 2018, mainly because investors have been selling shares in global corporations that have a lot to lose from the president's recent tariffs and trade battles. Procter & Gamble, which gets 55% of its sales outside the United States, is down by 14%. Johnson & Johnson, which draws nearly half its revenue from overseas, is down by 11%. Goldman Sachs' 10% decline helps explain CEO Lloyd Blankfein's lament last week that the president's trade policy "does not make any sense to me at all."

Investors have decided that home is where the heart is. Shares in smaller companies that do most of their business stateside have been among the market's best performers this year, with the Russell 2000 index of small- capitalization stocks up 10%.

A prime beneficiary of the trend is Nathan's Famous, which has been satisfying Coney Island visitors' hot dog needs since 1916 and is readying for its annual Fourth of July eating contest. Last week its stock hit an all-time high, reflecting the Brooklyn brand's expansion to more than 200 restaurants across the country. Executive Chairman Howard Lorber, a longtime friend of Trump, was an economic adviser to his presidential campaign.

Although Nathan's is mostly a bet on Americans' unending fondness for franks and crinkle-cut fries, the company is also growing overseas, mostly in countries that Trump holds in high regard. Last year five Nathan's restaurants opened in Russia, four in Kyrgyzstan, two in Kazakhstan and one in the Philippines. As it happens, areas that Trump has criticized—including Canada, China, Europe and Mexico—got none.