Dow snaps 4-week losing streak, S&P records highest gain in 6 weeks