When stocks open on Nov. 3, expect a rapid relief rally as one of the biggest uncertainties plaguing investors lifts. The conventional wisdom is that a postelection rally will last into early 2005, as November-January is historically a strong period for shares. But just how far any presumptive rally goes will depend not only on whether President George W. Bush or Sen. John Kerry wins, but also on who controls Congress and the winner's early moves.

Conversely, another contested election will likely hit stocks as it did four years ago -- in the gut. The

Dow Jones Industrial Average

fell over 600 points in the aftermath of the 2000 election. Another knock-down, drag-out brawl in Florida (or in any number of other key swing states) coming amid the backdrop of higher oil prices, the war on terror and a weakening economy would be even worse this time around.

All that is to say the election matters a great deal for the markets, and especially for industries such as energy and health care that are deeply affected by government policies and programs.

Leading up to the election, the tightening of the race this month has weighed on stocks, many investors agree. A victory for either Bush or Kerry might be good for some sectors and bad for others, but with polls still virtually deadlocked, prudence dictates staying on the sidelines. Once the election is over, the theory goes, then it's time to place your bets -- meaning stocks will get a boost once the election is decided, whoever wins.

"The race remains too close to call, and for this reason we expect political rhetoric to be at a fever pitch, which could heighten volatility and keep investors on the sidelines until all the votes are in," Kurt Wolfgruber, chief investment officer at Oppenheimer Funds, recently wrote. "Regardless of the outcome, reducing the level of uncertainty will likely serve as a positive catalyst for the markets."

Even investors who don't foresee much long-term impact from the election see the uncertainty factor currently at play.

"At the moment, the election certainly seems to be giving investors yet another reason not to buy stocks, and so stock prices could conceivably remain volatile near term," said Craig Blum, managing director of U.S. equities at TCW, who does not believe elections ultimately have a "significant impact on fundamentals."

So in the short term, assuming one side can declare victory on election night or the day after, look for a quick "relief rally" next month.

Beyond that conventional outlook lies a debate over just how much of a long-term impact the next president will have on the economy or on specific sectors. It's unquestionable that President Bush's agenda has aided drugmakers such as

Johnson & Johnson

(JNJ) - Get Report

and coal producers such as

Peabody Energy

(BTU) - Get Report

and

Arch Coal

(ACI) - Get Report

, as he kept government buying power out of the new Medicare drug law and eased environmental rules.

Some argue that Kerry won't be able to change much, since Congress is likely to remain in the hands of the Republicans, resulting in gridlock.

But that's not necessarily the case, according to Jim Lucier, an analyst at Prudential Equity Group who used to work at the conservative group Americans for Tax Reform. Lucier says Bush has shown how a president can make big changes without congressional approval by altering executive orders and policies at agencies such as the Environmental Protection Agency and the Food and Drug Administration.

Kerry could undo land use and environmental policies Bush enacted that have benefited resource and energy companies, for example, Lucier wrote last week. And if Republicans lose control of the Senate, a distinct possibility, the changes could be more far-reaching.

"In short, under Kerry and a Democratic Senate, we would see a gridlocked future that is still benign for most industries but could result in 'Maalox moments' for those companies and industries that incur political disfavor," Lucier wrote, such as energy, autos, health care and student loan providers.

Kerry's high-profile tax hike and health care plan, however, might be a tougher sell assuming Congress remains in Republican hands. Kerry's biggest challenge on those issues may be to lose gracefully. Republicans took control of the House in 1994 in large measure because of President Clinton's overreaching and bungling on health care. (Remember Harry and Louise?)

Administration policies could have an impact on bond rates, though that's much harder to forecast. Bush has run up the highest annual deficit ever, but long-term interest rates remain quite low because of the

Federal Reserve's

moves and a strong appetite from Asian governments for Treasury securities.

Kerry has committed to improve the debt situation, and a president has quite a bit of power over the budgeting process, because members of Congress all have needs that must be met for constituents back home. Furthermore, plenty of Republicans aren't happy with excessive deficit spending. There's clearly an opportunity for more responsible spending policies.

Bush has promised that if re-elected, he will push for individual accounts in Social Security that could be invested in the stock market. That might be great for the market, but it seems like a very tough sell on Capitol Hill, as the nonpartisan Congressional Budget Office estimates about $1.5 trillion would be needed to replace money put in the new accounts that had been going to current Social Security beneficiaries. And it's not as though Bush made much of an effort to enact the plan in his first term even though the Congress was controlled by Republicans.

On the other hand, Bush did push aggressively for multiple tax cuts, including on dividends and capital gains, during his first term. He has pledged to make those and other cuts now due to "sunset" permanent if re-elected.

If for no other reasons, the election matters to investors because of the candidates' starkly different views on tax policy.

Atypical Election

Finally, there is substantial research showing that the party that is in the White House makes a difference for stocks. Unfortunately, it's not a unanimous verdict.

According to widely cited calculations by Ned Davis Research, the stock market had a median gain of 8% in all election years since 1900, and 15% in years when Republican presidents were re-elected.

University of California at Los Angeles business school professors Pedro Santa-Clara and Rossen Valkanov tried to take out the effects of the business cycle and found that small growth firms do far better under Democrats than under Republicans, about a 22% better gain on average. The market as a whole did somewhat better, a 9% advantage, under Democrats and with less volatility.

For stocks, this year hasn't been typical of most election years in the past 50 years, again according to Ned Davis Research. The

S&P 500

averaged a 12.8% gain in the past 12 election years. That's not as good as the 24% average gain in the year before a presidential election (like 2003 when the S&P gained 29%), but it exceeds the 7% gain in the first year after an 8% gain in the second year after.

As a caveat, some more academic research done by Dimensional Funds using criteria developed by Nobel Prize-winning economist Eugene Fama shows that the effects on the market may be pretty short-lived.

Looking at the monthly returns on stocks in excess of the return of risk-free Treasury bills, the study found statistically significant and above-average returns in the three months after a presidential election, but 12-month returns were similar to returns in nonelection years.

Not surprisingly, market returns ahead of elections can help predict the winner, according to the Dimensional study. In the 10 elections since 1928 when then incumbent was not re-elected, stocks underperformed T-bills by an average of 1.4% in October, compared with 2% outperformance in years when incumbents were re-elected and 0.1% outperformance for all Octobers (including election and nonelection years).

So far in October, the S&P 500 has lost 1.7% and three-month T-bills are yielding 1.83%.

To read

RealMoney

columnist Barry Ritholtz' take on the election, click

here.

In keeping with TSC's editorial policy, Pressman doesn't own or short individual stocks. He also doesn't invest in hedge funds or other private investment partnerships. He invites you to send

your feedback.