Bloomberg -123RF

Stocks struggled for direction, with a brief dip-buying rally fading amid lingering caution at the end of a volatile week that brought this year’s artificial-intelligence-led rally to a halt.