Gold settles lower, builds on a weekly loss