The Dow surged past the 22,000 mark Wednesday for the first time. (Reuters)

The Dow Jones industrial average closed above 22,000 Wednesday, a record high in what has become one of its longest bull markets in history.

The extraordinary rise of the stock markets since early 2009 — when the Dow was a mere 7,063 — has greatly fattened the portfolios of American investors, especially the wealthiest ones. And it has played a role in boosting the political fortunes of President Trump who on Wednesday once again took credit for the markets’ performance.

The surprisingly persistent gains this year have come courtesy of robust profits at big companies, low interest rates and a rare alignment of developed economies in good or improving health at the same time. So far, those have been more powerful forces on stocks than world events such as North Korean nuclear missile tests, Venezuela’s economic and political meltdown, or legislative gridlock in Washington.

The markets’ most recent run-up does indeed have something to do with Trump’s win in November, several analysts said. Back then, some on Wall Street cheered the ascent of a businessman into the White House and his promises to cut taxes, invest in infrastructure and increase military spending. The Dow turned sharply up right after the election and has risen 23 percent since then.

Some companies had more to gain from Trump’s pronouncements than others and saw their stocks jump, an effect Wall Street brokers call the “Trump Trade.”

Boeing, which generates much of its profits from its Defense, Space and Security division, has seen its shares soar more than 70 percent since Trump’s election. It has accounted for 45 percent of the Dow’s rise this year, far more than any of the other 29 companies in the index.

“We’ve picked up over $4 trillion of net worth in our country, our stocks, our companies,” Trump said at a White House event on immigration Wednesday. “The stock market hit the highest level that it has ever been and the country is doing very well.”

Since becoming president, Trump has taken credit for stock market gains he once dismissed. (Meg Kelly/The Washington Post)

By the late spring, reports from prominent analysts showed Wall Street was growing skeptical of Trump’s pledges on taxes and infrastructure. But the markets kept marching higher. Stock analysts attribute this to a simple fact: Big corporations, such as Apple, McDonalds and Boeing — which lean heavily on overseas sales — continue to make a lot of money.

“The market has pretty much shrugged off Washington’s dysfunction,” said Chris Gaffney, president of World Markets at EverBank. “The larger story is about the return of the consumers both here in the states and in the emerging markets of China and India.”

A weakening dollar — an unusual trend during a bull market — has only helped boost earnings at big corporations because American goods have become cheaper to overseas customers and sales to those customers have greater value when they are converted into U.S. currency.

The effect of the dollar is “starting to show up in company earnings,” said Craig Birk, executive vice president of portfolio management at Personal Capital, a California investment firm with $4.9 billion under management. “It’s also provided some confidence that the strength we saw in [quarterly] earnings … can continue for the rest of the year. The dollar weakness has been pretty universal around the world. July was the fifth consecutive month of dollar declines.”

Yet not everyone has shared in the stock market’s stunning rise.

Nearly half of America has no money invested in the stock market, according to the Federal Reserve. And the rich are far more likely to own stocks than middle or working-class families, surveys show.

Eighty-nine percent of families with incomes over $100,000 have at least some money in the stock market compared to just 21 percent of households earning $30,000 or less, a recent Gallup survey found.

“Lot of people in America tragically aren’t participating in the stock market,” says Brad McMillan, chief investment officer at Commonwealth Financial Network, a financial advisory firm that works mainly with “Main Street” America.

Many ordinary investors are still sitting in the sidelines, missing out on one of the longest-running bull markets in American history because they are still scared from the financial crisis, McMillan added. Stock ownership before 2008 was 62 percent, Gallup found. Even after recent inflows, only 54 percent of Americans are invested now.

Most ordinary investors who are in the markets invest through mutual funds, retirement plans or 529 college-savings plans. According to a 2016 paper by the Tax Policy Center, only 25 percent of Americans owned individual stocks in 2015.

Others worry that average investors have been pouring more money into the markets this year, with more than eight years of gains already passed.

Michael Farr, a Washington investment manager said the Dow’s 22,000 mark “should be celebrated. It heralds the success of the American economy.

“But,” he continued, “the individual investor should remember that the rule is buy low and sell high. This is not low. Market’s don’t say high forever. This will come down.”

The Dow’s close on Wednesday was its sixth consecutive record high.

Ed Yardeni of Yardeni Research called the most recent surge in stocks a “summertime lullaby” in a recent blog post.

“For stock investors, the living has been relatively easy since March 2009, when this great bull market started,” he said. “It would have been far easier if we all fell asleep since then and just woke up occasionally to make sure we were still getting rich.

“Now it seems that we are all getting lulled to sleep by the monotonous advance of stock prices,” Yardeni wrote. “ They just keep heading to new record highs with less and less volatility.”