gold edges up as stocks retreat, oil struggles