S&P 500 posts longest winning run since January