FORTUNE — One of the questions I get asked these days is whether a win by Mitt Romney or by Barack Obama would be better for the stock market. To which the only honest answer is “I have no earthly idea.” Any competent and dispassionate market analyst will tell you that the financial and psychological states of the U.S. and world economies are the major factors, and that the President’s influence on these matters is far less than most people think it is.
Case in point: George W. Bush. He was a Republican, a free-market guy, right? Stocks, according to the conventional wisdom, should have boomed during his reign. After all, he dropped taxes on investment income to their lowest point in modern history in the name of helping investors and the economy. Well … oops! Rather than being a golden age for stock investors, his tenure was a disaster. The U.S. market lost 25.1% during his two terms, according to statistics assembled for me by Wilshire Associates. Had historical averages held, the market’s total return — capital gains plus reinvested dividends — would have more than doubled investors’ money during the eight years that Bush was in office. Instead, investors ended up with a quarter less than they started with.
And guess what? The best first-term presidential market (at least so far) has come during the administration of … Barack Obama, who has been reviled on Wall Street for allegedly crippling corporate America with insults and regulation, and who has pushed through higher taxes on investment income of upper-echelon households. Yet stocks produced a whopping 95.9% total return from Obama’s Inauguration through Fortune’s mid-September presstime.
Finding Obama at the top isn’t what I expected to see when I asked Wilshire to calculate returns by presidential administrations for me. We started with Ronald Reagan because Wilshire didn’t begin tracking daily market returns with its Wilshire 5000 index until 1980. That’s why Reagan, who took office in 1981, is the first President on our list. (You can find all the numbers in the table at the bottom.)
If George W. Bush, the investors’ supposed friend, produced the worst return of any President starting with Reagan, whose administration showed the best return? No, not Reagan, beloved in some places (and notorious in others) for kicking off our orgy of tax cuts. It was Bill Clinton, who pushed through a hefty tax increase during his first term.
Think about it. Under two Democratic Presidents, stocks have shown the best return, while three Republicans bring up the rear.
Tempting as it is to tweak my more conservative friends with this fact, it would be wrong to attribute the Clinton and Obama returns to their policies and presidencies. Clinton inherited a great economy (and no, I don’t attribute it to Reagan’s policies as supply-side types do, and neither should you) and left office after the Internet stock bubble burst, but well before it bottomed. Bush inherited a tanking stock market and left amid a financial panic. Does Clinton deserve full credit for everything good during his tenure? Does Bush deserve full blame for everything bad? Yes, if you’re an ideologue. No, if you’re intellectually honest.
Obama took office with stocks at really low levels, which he had nothing to do with. After a sickening two-month drop during which his critics tracked the “Obama market,” things stabilized, thanks to coordinated actions by central banks and governments throughout the world. The panic was alleviated, and “Obama market” largely disappeared from public discourse.
About half the gain during Obama’s tenure came his first year. By contrast, Reagan had a loss in his first year. Other year-by-year returns have varied all over the lot, as you can see. “There’s no pattern here — it’s just random,” said Bob Waid, managing director of Wilshire Analytics. “If these were causal relationships, you would see a different pattern.”
The bottom line: Go ahead, vote for whichever candidate you want. But don’t think that your guy’s winning — or losing — will determine what happens to the stock market. That’s just not how the world works.
This story is from the October 8, 2012 issue of Fortune.