It’s been a strong month for U.S. stocks, with the S&P 500 up 8.8% in October as of Thursday’s close.

The stock benchmark SPX, -0.90% is now on track Friday for its biggest monthly percentage gain in four years. It has rallied after a summer swoon, edging back into the black for 2015 with a 1.5% year-to-date gain.