Stocks were setting up for a fitting end to a roaring year of trading after an uncharacteristic limp into the finish.