Stocks up as markets wind down to bumper year; gold and silver smash records