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 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.

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. Watch: How the midterms will affect Trump's economy