The US looks all but certain to dodge a recession, American stock indexes are trading at record levels and even riskier investments like bitcoin are at their highest prices ever, but gold, arguably the world’s oldest investment—often viewed as a hedge against market losses elsewhere—keeps gaining value.