While I agree overall the stock market does not have that much to do with the President notwithstanding Trump taking credit for any market surge under his administration there is one index which Trump uniquely improved just for being Trump: NFIB small business optimism index
As soon as Trump was elected the index surged from 94.9 to 105.8 (in late 2016) a level only matched in the 2003-2005 period. It then went on to rise to a record high of 108.8 in 2018. As soon as Trump was defeated in 2020 the index slumped from 104.0 to 95.9. One can most likely attribute rising economic activity for small businesses to Trump being Trump which is fairly unique in recent economic history.
I've always attributed this to small business owners, especially the ones included in this survey, being a conservative group. Remember, NFIB is the group with its name on the Supreme Court case that nearly overturned Obamacare. In 2010, all 25 of its Congressional members were Republicans and the survey is drawn only from NFIB members. Thus it does not represent small business owners as a whole. There's no other explanation for the persistently low ratings during the Obama recovery, as well as the sudden and dramatic election-based shifts that you noted.