Gold retreats from 6-1/2 month high as dollar firms