Romney Obama
The Republican National Convention will take place in Tampa, Fla., from Aug. 27 through Aug. 30. Former governor Mitt Romney is the presumptive Presidential nominee, and Representative Paul Ryan is his Vice Presidential running mate. The Democratic National Convention will be held in Charlotte, N.C., from September 3-6, with President Barak Obama and Joseph Biden as nominees for President and Vice President. Reuters

While some may see the made-for-television national political conventions as a colossal waste of time and money, analysts have been busy crunching numbers to figure out which way these carefully choreographed productions will affect the stock market.

The Republican National Convention will take place in Tampa, Fla., from Aug. 27 through Aug. 30. Former Massachusetts Gov. Mitt Romney is the presumptive presidential nominee, and he has chosen Wisconsin Rep. Paul Ryan is his running mate. The Democratic National Convention will be held in Charlotte, N.C., Sept. 3-6, with President Barack Obama and Vice President Joseph Biden as nominees for re-election.

"Should history repeat itself, the S&P 500 will likely rise during the upcoming Republican Convention and in the five days following, but then fall slightly during the Democratic Convention, before resuming its upward track in the subsequent week," Sam Stovall, chief equity strategist at S&P Capital IQ, wrote in a note to clients.

Decades have passed since convention delegates have actually decided a presidential nominating fight. Candidates and their policy positions are now determined long in advance. But Wall Street may still be susceptible to messages delivered during the conventions.

There once was a time when Wall Street loved Barack Obama -- it was in 2008. But this time around, more of those who make big bucks are funneling their donations to Mitt Romney and conservative super PACs.

Employees in the securities and investment sector have donated $56.4 million to Republicans and $35.1 million to Democrats through individuals and PACs through May, according to the Center for Responsive Politics. It's a reversal from 2008, when they gave $96.6 million to Democrats and $72.2 million to Republicans by the end of the election cycle.

The conventional wisdom is that the Republicans are Wall Street's party of choice. They regard Wall Street as being fiscally conservative, and therefore more likely to support the Republican candidate. So when Republicans are on the stage, the stock market ought to perform better.

Data since 1948 indicate that the S&P 500 (INDEXSP: .INX) did indeed perform better during and after Republican conventions. The index enjoyed a median gain of 0.32 percent during Republican conventions, while suffering a media loss of 0.23 percent when Democrats gathered. In the week following the conventions, the stock market fell by 0.04 percent for Republicans and 0.34 percent for Democrats.

After analyzing the 16 completed presidential elections since 1948, Stovall found that the correlation between these limited performance periods for Democrats and Republicans was an intriguing -0.62.

A correlation between two variables is a single number that can range from -1 to 1, with positive values close to one indicating a strong direct relationship and negative values close to -1 indicating a strong inverse relationship. Typically, correlations higher than 0.6 (or lower than -0.6) are considered to be strong.

This relationship makes it easier to predict what may happen during the second convention, typically held by the party that controls the White House.

In other words, whenever the S&P 500 rose during the first convention on the calendar, it usually fell during the second convention.

During the seven times when the GOP held their conventions first, the S&P 500 rose six times (falling only in 1996) and recorded a median increase of 0.24 percent. Meanwhile, the S&P 500 posted a median drop of 0.46 percent when they went second.

So if stocks rise during the Republican convention next week, the odds strongly suggest they'll fall when the Democrats kick off their convention in Charlotte on Labor Day.

Last week, the S&P 500 (INDEXSP: .INX) broke away from the 1,400 level where it had stalled for much of August. The index is currently near a four-year high, rising about 9 percent in the past six weeks.

Of the 28 presidential elections since 1900, an improvement in the S&P 500 prior to an election preceded an incumbent victory 80 percent of the time, or 16 of 20 of times. The S&P 500's direction during that period carried an accuracy rate of 82 percent, according to S&P Capital IQ data.

The latest presidential tracking polls from Gallup and Rasmussen both show an extremely close race for the White House.

In the latest Rasmussen poll, Romney had 44 percent support, up by a single point over Obama, who had 43 percent support. In the Gallup poll, Romney had 47 percent support, a two-point lead over Obama. Both polls are within the margin of error, so going into the conventions it is still a race that is too close to call.