Stocks hovered near all-time highs as traders weighed risks ranging from tariffs to inflation and the geopolitical scenario.