stocks eke out gain, while oil, gold decline