Markets are sweating hard ahead of the midterm elections, but the event historically portends a strong performance for stocks, regardless of whether it’s a red or blue wave, a split decision or a status quo in Washington. The S&P 500 tends to perform well after presidential and midterm elections. According to a CNBC analysis of S&P 500 returns after elections from 1980 to 2024, the index rose an average of 0.2% after one day and one week, and 1.1% after one month in presidential and midterm elections. A year later, the index gained an average of 13.7% after the midterm elections and 13.8% after the presidential election. The returns were positive in 91% of the cases. And the S&P 500 rose after all 11 midterm elections from 1982 to 2022. Short-term returns were less reliable, particularly after the presidential election, which produced slightly negative average returns after one day and one week. “There’s some anxiety going into this election,” Ryan Detrick, a CNBC contributor and chief market strategist at Carson Group, told CNBC. “Once you get past that, it’s a big relief and the markets tend to do pretty well.” Markets prefer stagnation. Still, the market generally prefers divided government: one party in charge of the White House and the other with at least one chamber of Congress. Through 10 midterm elections and five presidential elections that left neither party in charge, the S&P 500 rose an average of 15% after one year. One-year returns were positive in 14 of 15 cases. By comparison, the index gained an average of 11.5% in the year following elections that resulted in single-party control. “If you have a big red wave or a big blue wave, the markets don’t really like it as much because there’s too much one-way spending and too much power,” Detrick said. Leaving Democrats in control of Congress with a Republican in the White House (a scenario that may emerge from Tuesday’s elections) was also positive. A CNBC analysis found that after three midterm elections (1986, 1990 and 2006), when Democrats controlled both chambers and a Republican held the presidency, the S&P 500 averaged a decline of 0.5% on the day of the reaction, but was up 3.4% a month later and 10.9% after a year. It is true that elections can be coincidental events with factors that are much more important to market performance. The S&P 500 plunged 22.1% in the year after the 2000 election due to the dot-com bust, marking the worst post-election performance since 1980. By contrast, the S&P 500’s best post-election year was a 38.3% gain after the 2020 election, when markets massively recovered from the COVID-induced sell-off. Investors should note that, according to Société Générale, Federal Reserve policy and the corporate earnings cycle ultimately matter more than elections. Stocks fell after the 2018 midterm elections, for example, when Democrats wrested control of the House during President Donald Trump’s first term. More importantly, the Federal Reserve tightened monetary policy that year, raising interest rates four times, and the S&P 500 ended the year down 6.2%, although the market was up 11.7% a year after the election. The big deciding factor now is AI and whether declines in the technology will continue. As long as the AI wave keeps moving and the economy keeps growing, “this bull market is probably alive and well,” Detrick says. But a Democratic sweep of the House and Senate would almost certainly put pressure on the development of AI infrastructure and could lead to further reductions. The bond market is also nervous about rising yields globally and a mini debt crisis in France. And the war with Iran could worsen after the election if President Trump makes good on his threats of more attacks or if Iran escalates. “Seasonality is not destiny, and concerns around Iran, AI and France will not mysteriously disappear,” Jim Reid, global head of macro and thematic research at Deutsche Bank, said in a note. If history is any guide, we could see a Santa Claus rally and S&P 500 gains after the midterms. But this is still an AI-driven market, with geopolitics, the Federal Reserve and the bond market largely in charge. —CNBC’s Chris Hayes contributed reporting.