Big institutional investors ​are buying ​while retail investors are dumping stock funds and ETFs. That’s bullish for the market.

The stock market’s longer-term prospects are looking up, according to flow data for U.S. equity mutual funds and ETFs. That’s because institutional investors over the past 12 months have poured signif...