Chinese stocks and gold are the best hedges against a boom in the artificial intelligence trade that has pushed valuations to elevated levels, according to Bank of America Corp. strategists.

The S&P 500 Index trades at 23 times forward earnings, well above its average of 16 over the past two decades. The so-called Magnificent Seven group of tech megacaps accounts for more than a third of the US benchmark’s weight. Valuations across this cohort are even higher, at 31 times forward earnings.