(Bloomberg)  U.S. stocks would probably rally through February should Barack Obama's party lose control of the Senate in November, according to a Birinyi Associates Inc. study of returns going back to Harry Truman's presidency in 1946.

The six times that the Senate changed hands during elections in the middle year of presidents' terms, the Standard & Poor's 500 Index posted an average three-month gain of 5.2%, falling only after Democrats surrendered the Senate in 2002. Bets on Intrade show a 22% chance that President Barack Obama's Democratic party will give up its Senate majority this year.

The S&P 500 retreated during the two months leading up to the 1946 and 1994 midterm elections, when first-term Presidents Truman and Bill Clinton lost control of the Senate and House of Representatives, according to a report today from Westport, Connecticut-based Birinyi. Following the vote, the benchmark measure of U.S. stocks posted an average three-month gain of 3.4%, the report said.

"We took a special interest in 1946 and 1994 when a first- term Democratic president lost both houses of Congress to the opposing party," Birinyi analysts Cleve Rueckert and Daniel Erdelyi wrote in a report today. "In both cases the market was down in the two months prior to the election, and was up over the ensuing three months."

An advance this year would come after Obama presided over the biggest rally during the start of a presidency since Franklin D. Roosevelt in the 1930s. This year's midterm election will be held on Nov. 2. Bets on Intrade, an online exchange where people can bet on events including elections, show a 72% chance Republicans will take control of the House.

The best performance for the S&P 500 in Birinyi's study was 1954, when the index rallied 13% as Republican President Dwight D. Eisenhower lost control of the House and Senate to the Democrats. The equity measure advanced 12% once Ronald Reagan, also a Republican, lost the Senate in 1986. The average return for the three months following all midterm elections since 1962 is 7.5%, according to Birinyi.

The Dow Jones Industrial Average has jumped an average of 5% during the two months between the November congressional elections and Dec. 31 in the 16 winning Dow years over the past 23 midterm cycles, according to a Sept. 1 report from Janney Montgomery Scott LLC's Dan Wantrobski. The average return for all midterm voting years is a 2.3% gain, while the seven losing years had a negative return of 4% on average, Wantrobski said.

The S&P 500 has risen 7.2% since Aug. 31, paring its loss since reaching a 19-month high on April 23 to 7.6%.