Under-the-surface improvements in the S&P 500 signal big gains ahead, history shows