gold retreats from three-week highs, but remains on track for weekly gains