INDIANAPOLIS — When President Trump said Thursday he held a “long and very good conversation” on trade with President Xi Jinping of China, it kicked off a brief rally in financial markets and a flurry of questions about why the tensions between Washington and Beijing had suddenly eased.

The answer is, they haven’t really. The explanation for Mr. Trump’s newly soothing tone lies less in the state of trade negotiations — which remain on hold — than in the president’s domestic political calculations, particularly in states heavily dependent on trade, like Indiana.

Four days before a midterm election that features a nip-and-tuck Senate race in this state, Mr. Trump is trying to quell fears of a protracted trade war with China. His reassuring message may resonate in Indiana, the United States’ largest producer of steel but also home to soybean farmers who have been hurt by China’s retaliatory tariffs on American agriculture.

“We’ve had very good discussions with China,” Mr. Trump told reporters at the White House, as he left for a pair of political rallies in Indianapolis and Huntington, W.Va. “We’re getting much closer to doing something. They very much want to make a deal.”