Stocks rallied on the final trading day of the year to help the FTSE 100 gain by 5.9%, or 440 points, over the course of 2024.