US stocks fall but end the year with big gains as traders look ahead to easier Fed policy in 2024