For President Trump, the markets are a flawless indicator of how well he is doing and/or how poorly his opponents are. Any decline is a reflection of the failures of Democrats or the media; any increase is a reflection of his own savvy handling of the economy.

Or, in the weeks after the 2016 election, a reflection of how excited they were about what he might do. Trump began taking credit for the economy before he was even inaugurated and continued to claim credit for that transition period repeatedly during his four years in office.

Over and over, he claimed that his economic success should be measured by the increase in stock prices that began on Nov. 8, 2016.

“You’ve got to go by November 9th,” he said at a rally in New Hampshire in August 2019, “because you know the markets have gone through the roof since November 9th. That’s the day after I won the election. So I won the election, the markets went up thousands of points. Things started happening.”

“Let me tell you,” he added, “if for some reason I wouldn’t have won the election, these markets would have crashed, and that will happen even more so in 2020.”

This claim that voting against him and for President-elect Joe Biden would mean economic doom was itself a recurring theme. On Election Day, Trump called in to “Fox & Friends” and riffed on changes in the markets.

“We have a headwind on the stock market, because on the chance that Biden got in, you will have a stock market go down like you wouldn’t believe, if he got in,” he said. “And I see the markets are projected to be up quite nicely today, and it was up yesterday very nicely because people are starting to think that I’m going to win.”

So what happened? Not that. From a week before the 2016 election to three weeks after — where we are now, relative to this year’s contest — the Dow Jones industrial average gained 1,084 points, and the S&P 500 was up 92.94 points. From a week before Nov. 3 of this year until the markets closed Monday, the Dow was up almost twice as much — 2,128 — and the S&P up more than twice as much.

Of course, those indexes are starting from a higher point than they were in 2016. If we look at the percentage shifts relative to Election Day, the Dow gained 7.7 percent and the S&P 6.2 percent through Monday, bigger increases than were seen in the three weeks after the 2016 contest.

But Trump being Trump, he’s taking credit for these gains, too. Even after telling “Fox & Friends” that the markets would sink, he insisted last week that the Dow was nearing 30,000 because of news that the country might soon be able to deploy a vaccine to contain the coronavirus.

At one of his rare appearances since losing the election, Trump made a similar claim.

“As we continue to combat the virus, our economy is rebounding far beyond any expectations,” he said Nov. 13. “I see the stock market is up almost 400 points today again, and it’s ready to break the all-time record.”

It broke that record Tuesday, if only temporarily. And the gains were, in fact, in part a function of optimism about the vaccine candidates that were reported in the past several weeks. They were also, according to the Wall Street Journal, a function of Trump seeming to abandon his unlikely effort to overturn the results of the election and of enthusiasm for Biden’s proposed nominees, including having Janet L. Yellen serve as treasury secretary.

Markets are complicated things, with assumptions often baked into prices and fluctuations occasionally emerging from unexpected prompts. They are a rough measure of an economy, which is itself a massive, complex thing — and a thing mostly but not entirely separated from individual decisions made by any president.

Trump would like to claim credit for both the boost in the markets after he won in 2016 and the boost after he lost in 2020. It’s more likely that those gains were largely unrelated to the immediate results of the elections themselves.

We know what happens next. If market prices continue to improve for the next year or so, Trump will say that’s because of him. If they decline, Trump will blame his opponents.

It brings to mind a tweet from Trump that has faded into the fog of history.

Good news is always a function of Trump, even when it’s not. Bad news is never a function of Trump, even when it is. So turns the great wheel of life.