gold gains, set to record weekly gain; dollar also trade higher