Republican wins give the stock market a short-term boost. Stocks tend to do better right after a Republican is elected President than after a Democratic victory. This makes sense, because most investors expect--rightly or wrongly--that Republicans will be better for the market and so bid up stocks in anticipation. Wharton School finance professor Jeremy Siegel finds that since 1888 the market has risen an average of 0.7% the day after a Republican win and dropped an average of 0.5% after a Democratic win.
Longer term, stocks do better under Democrats. While stocks get a short-term boost from Republicans, over the course of an entire presidency they tend to do better under Democrats. That's especially true for small caps. Part of the reason is that small caps respond more sharply than large caps to economic ups and downs, and Republicans have presided over many more downs. Since 1929, 30% of the months under Republicans have been spent in recession, compared with just 10% under Democrats.