Source: Bank of America Merrill Lynch
The best stock market returns occur when Washington, D.C., is locked in the "gridlock" that comes with different parties controlling the two houses of Congress, data shows.
The best S&P 500 returns under a Republican president occurred while Congress was split, with that scenario producing 12 percent annual returns, according to data from Bank of America Merrill Lynch.
Play Video Investors brace for midterm elections — Here's what six experts say could happen to markets
Democrats are expected to retake control of the House from the GOP. Republicans, meanwhile, are expected to maintain a slim majority in the Senate.
"Markets typically like gridlock in D.C.," Joseph Song, U.S. economist at Bank of America Merrill Lynch, said in a note. This outcome may "modestly reduce risk of trade tension, and be supportive of risk assets."
Song also said the industrials and materials sectors could benefit from a divided government as both parties could find common ground on a "small" infrastructure bill.
The broad index also does OK when Republicans control the White House and Democrats lead both houses of Congress. In these instances, the S&P 500 averages an annual return of 8.6 percent.
However, a Democratic-led Congress this time around could lead to more investigations into President Donald Trump and increases the likelihood of a government shutdown, both of which add volatility to the stock market, Song says.
The best scenario for the stock market has been a Democratic president and a split Congress, returning 16 percent annually.