Gold ends at a nearly 2-week low as U.S. stock indexes trade in record territory