gold's gains prompt higher q3 close for metals stocks