Presidents love to take credit for a rising economy and stock market, and Donald Trump is doing so with customary brio, amplified by his trusty Twitter account. But amid the self-congratulations, the truth is that other forces at play before he took office are primarily fueling the good news.

In a series of recent tweets, President Trump touted his administration's policies for sparking the heady numbers. "GDP was revised upward to 3.1 for last quarter." he wrote. "Many people thought it would be years before that happened. We have just begun!"

There's little doubt that the GOP-controlled Congress' progress on a tax-cut bill -- Senate and House negotiators must meld their different versions before final passage -- has spurred the most recent leg up in the stock market. The plan to slice the corporate tax rate to 20 percent from the current 35 percent, for instance, should boost per-share earnings for companies in the Standard & Poor's 500 by $10 next year, from the projected $141, according to UBS Wealth Management.

GDP was revised upward to 3.1 for last quarter. Many people thought it would be years before that happened. We have just begun! — Donald J. Trump (@realDonaldTrump) September 29, 2017

And as Mr. Trump indicated, GDP has been robust of late, up 3.1 percent in this year's second quarter, 3.3 percent in the third period despite the late-summer hurricanes, and around 3 percent is expected in the fourth quarter. Consumer spending and new home sales are climbing, and the unemployment rate is at a low 4.1 percent. Plus, the S&P 500 has advanced some 18 percent since his election.

Get Breaking News Delivered to Your Inbox

After the Dow Jones industrials index broke through the 24,000 mark last week, Mr. Trump tweeted: "If the Dems had won the Presidential Election, the Market would be down 50% from these levels."

Maybe, maybe not. To Nicholas Atkeson, co-founder of Delta Investment Management, "the president's impact on the stock market and business cycle is minimal." And any credit or blame that presidents get for the economy, he said, often stems from factors beyond their control, chiefly the natural workings of the business cycle.

"Economic fundamentals have driven the market the most," not Washington developments, said Brent Schutte, chief investment strategist at Northwestern Mutual Wealth Management. He also noted, though, that the administration's "pro-business message has emboldened corporate America."

That's an important point, and it illustrates the one area where presidents have some economic clout, although it's shared with Congress: overseeing federal spending and tax policy. Mr. Trump's bid to lower US corporate taxes -- which are among the highest in the industrialized world -- and trim regulations are heartening to the corner-office crowd that that makes hiring and business expansion decisions.

"He's attacking the two things that make us less competitive," said Jim Brilliant, portfolio manager of CM Advisors Fixed Income Fund (CMFIX). "You have to separate the Trump persona from the Trump policies."

The Dow just broke 24,000 for the first time (another all-time Record). If the Dems had won the Presidential Election, the Market would be down 50% from these levels and Consumer Confidence, which is also at an all-time high, would be “low and glum!” — Donald J. Trump (@realDonaldTrump) November 30, 2017

Polling data suggest that more of the public is beginning to believe that Mr. Trump is the prime mover in the economy and the stock market. A Gallup survey found that 45 percent approve of his handling of the economy, better than the 35 percent who approve of him overall.

That said, Mr. Trump's actual sway over economic matters is as limited as previous presidents. That's because:

Luck plays a role

When a president serves is crucial to the public's assessment of his record. Herbert Hoover, Jimmy Carter and George H.W. Bush all had the disadvantage of occupying the White House during economic downturns and weren't reelected. Barack Obama took over with the economy at its low point, so he rode its slow improvement, with unemployment dropping to 4.7 percent from 10 percent.

Mr. Trump assumed the office during boom times, which means any slides later in his tenure might put him in the inglorious company of Hoover, Carter and the first Bush.

The recovery began before Mr. Trump was elected

Even though the rebound from the 2008-2009 Great Recession was slow, the general movement was up, which is what the public wanted to see. During Mr. Obama's presidency, the recovery managed to surmount temporary problems, like the European debt crisis, the oil price bust and China's economic slowdown.

And the stock market, anticipating brighter tomorrows, responded: The S&P 500 climbed 180 percent over Mr. Obama's eight years. Since Mr. Trump's inauguration, the S&P is up 16.8 percent. But from the time Mr. Obama became president to this point during his first year, the stock index vaulted 37 percent.

Central banks are key players

Even before Mr. Obama occupied the White House, the Federal Reserve, which is independent from the Oval Office, was moving to prevent the financial crisis from turning into the second Great Depression. The Fed pushed short-term interest rates to almost zero and launched a massive bond-buying program, designed to pump money into the economy and reduce long-term interest rates.

Right now, the Fed is slowly raising short-term interest rates to a more normal level and has stopped purchasing bonds and is instead whittling down the huge trove it holds. Its aim is to avoid wrenching moves that would disrupt capital markets and perhaps bring on a recession.

Presidents have nothing to do with setting monetary policy, except indirectly -- through naming Fed officials. Mr. Trump has exerted some influence by tapping Jerome Powell to be the body's next chair. Yet, Powell has signaled that he'll adopt the gradual rate-raising regime of his predecessor, Janet Yellen.

Low rates have benefited stocks because investors can't secure the returns they used to receive from bonds and other fixed-income instruments, which tend to be safer than equities. "Investors need to take on more risk, so they go to the stock market," said David Levy, chairman of the Jerome Levy Forecasting Center. In 1992, he recalled, a 30-year Treasury yielded 7.8 percent, but today it yields just 2.9 percent.

Major central banks throughout the world have followed the Fed's lead, scooping up bonds and slashing rates. That has helped smooth over various troubles, such as the debt crisis that embroiled Southern Europe. Central bank help has been a slow-acting medicine that finally has taken hold.

The global economy is doing well

Europe, Japan and China, stumbling economically not long ago, have recovered their balance, and the world has now entered a rare period where all the major economies are growing nicely. That has aided the US, whose exports are expanding faster than imports. Helping that are the resurgent economies of these large trading partners, which have pushed up the values of their currencies, while the dollar has fallen, which makes US goods cheaper and thus more competitive.

As a result of the growth, stocks are going up worldwide, from Brazil to India, with many foreign bourses eclipsing US stocks' performance. America's chief executive has had next to no influence on making all this happen.

Corporate earnings are ballooning

Profits have marked a steady upward trend over the past couple of years, which politicians have very little impact on. Research group FactSet estimates that earnings will jump at a double-digit pace for every quarter next year, with technology companies continuing to lead. For example, Apple (AAPL) this year launched new smartphones to great acclaim, delivering earnings above expectations for its most recent quarter and a stock price that's up more than 50 percent in 2017.

Dwight Eisenhower, Ronald Reagan and Bill Clinton were presidents who happened to preside over an America on the march economically. Mr. Trump has made big promises. He had better hope that fortune continues to favor him -- because much is out of his hands.