Here's what history tells us about what to expect from the stock market's long-term performance following the 2020 presidential election: If President Trump wins reelection, it will probably go up. And if his challenger, former Vice President Joe Biden, heads to the White House, it will still probably go up.

Regardless of who's in office, stocks tend to underperform the first two years after an election and then deliver superb results in year three. Going all the way back to the first election in 1789, a Fidelity analysis found that four-year stock market returns have been nearly identical no matter which party is in the Oval Office: 8.6% for Republicans and 8.8% for Democrats. 

The stock market's performance is driven by much bigger forces than who becomes commander in chief. Here are three factors that matter way more to Wall Street than who wins the presidential election.

The Wall Street entrance of the New York Stock Exchange.

Image source: Getty Images.

1. How bad the coronavirus gets

2020 has been the year of COVID-19. The final week of October started with three consecutive days of stock market drops, as fears mounted about a global uptick in cases. 

It's easy to draw a false correlation between election results and stock market performance. But typically, stocks continue to move in the direction they were headed pre-election because of what was already happening in the world at large.

The S&P 500 index fell by more than 6% between Election Day 2000 and President George W. Bush's inauguration. But stocks had been on a downward spiral since the dot-com bubble started collapsing the previous March. The S&P 500 tanked by about 20% between Election Day 2008 and President Obama's inauguration in January 2009. But the U.S. had already entered a recession in December 2007, and the stock market had cratered less than two months before the election after the financial collapse.

On the same note, stocks rose between Election Day and Inauguration Day in 2004 and 2012, when Bush and Obama were reelected, just as they did after President Trump's 2016 victory. But they simply continued their upward trajectory.

A spike in COVID-19 cases, whether they result in more mandatory lockdowns or people voluntarily staying home out of fear, is way more likely to trigger another stock market crash than who occupies the Oval Office.

2. What actions the Fed takes

The Federal Reserve is widely regarded as the most powerful economic institution in the world. It wields far more power over market forces than the president. It sets interest rates. It tells banks how much they have to keep in their reserves. It injects money into the economy when times are bad. In 2020, the Fed has aimed to stabilize the economy with unprecedented actions, like buying corporate bonds and creating a program to lend directly to troubled state and local governments.

While the president appoints its chairmen -- and also has the right to fire them -- the Fed is theoretically supposed to operate without political influence. The chair serves a four-year term, and presidents have historically put politics aside and reappointed their predecessor's Fed chief. Current chairman Jerome Powell's term doesn't end until early 2022, but he's earned bipartisan approval for his actions during the pandemic.

3. The level of gridlock in Washington

Wall Street is often said to love gridlock. When Congress is split, it's supposed to be harder to pass new regulations and spending measures. That may be true during normal years, but that hasn't been the case in 2020.

The S&P 500 hit its pandemic rock bottom on March 23 at 2,191.96. But in the week that followed, the index surged nearly 20% as the House and Senate passed the $2 trillion CARES Act and Trump signed it into law. 

Bank of America Merrill Lynch analyzed the impact of the House's initial rejection of the 2008 Troubled Asset Relief Program (TARP) to estimate what would have happened had lawmakers failed to pass the CARES Act. It concluded that the ensuing bloodbath would have resulted in the S&P 500 plummeting all the way to 1,720. In recent weeks and months, the stock market has risen and fallen in lockstep with hopes of another stimulus package. The Democratic-led House and Republican-controlled Senate have now been stalemated over additional relief for months.

The bottom line: It doesn't matter who the commander in chief is if Congress can't agree on legislation for the president to sign. Gridlock may be good for stocks to an extent. But in a true crisis, Wall Street craves government intervention more than gridlock.