The stock market is following a rare pattern that could signal double-digit gains next year