The other big reason behind the stock market highs is the easy monetary policy of the past decade. QE's led to lower interest rates, which has had investors looking elsewhere for yields, and defensive stocks and higher-risk stocks are the big beneficiaries, which drives those prices even higher. The former simply shows up on indices such as the Dow Jones instead of where they historically show up (bond spreads). And the latter usually leads to more automation (tech companies usually being higher-risk), which affects job security, which then affects wages and keeps a lid on inflation, which means the Fed keeps interest rates lower, so investors chase yields elsewhere... etc. That becomes kind of a doom loop that doesn't have anything to do with any one president.
That and stock market indices are an awful way of rating an economy, particularly the Dow Jones. The Dow is just an arbitrary collection of companies' stock prices that are given an arbitrary weighting. Goldman Sachs has a high weighting, so its strong earnings push the Dow up despite Boeing and GE not doing nearly as well (and the latter two have a bigger impact on the economy in terms of hiring and the like). Replace "the Dow is at an all-time high" with "Goldman Sachs share prices are at an all-time high" and it doesn't sound so flash, but that's more or less what's going on with that index. And the S&P's bigger on the likes of Amazon, Facebook and Alphabet - which have done well but governments are waking up to the fact that they need to tax said companies' most important asset (data) so that feels like a matter of when and how all that shakes out. Which will affect earnings and hurt the S&P despite being a good policy idea.
So as you can tell, I think presidents are kinda like NFL quarterbacks in that they get WAY too much credit and blame for how things are going. You judge Joe Flacco by his mechanics and the passes and decisions he makes, as opposed to by whether we make the playoffs. It wasn't Bush's fault the GFC happened and the level of economic growth is essentially following a trajectory that it was under the Obama administration anyway.