The S&P 500  index has been in a protracted uptrend in recent months but recently has been consolidating (moving sideways) after a nice run higher. U.S. stock markets continue to rise on optimism about the new Trump presidency, but indices must clear recent all-time highs in order to continue pushing higher.

The S&P 500 is facing resistance at the all-time high area around 2277.00, and the index must clear that area to continue the uptrend. Prices consolidated last week for the third straight week, but as long as the S&P 500 remains above key support at 2227.00 and 2170.00, the bulls will remain strongly in control and the multiyear uptrend will continue.

Investors might want to wait for the index to make a breakout above those all-time highs and close higher before looking for another long entry point. They could also wait for a more substantial pullback into the 2227.00 support handle and look to get long there. Either way, this market is strongly biased to the upside and buying the dips remains the strategy of choice.

The Dow Jones Industrial Average index is in a similar situation as the S&P 500: A multimonth uptrend has given way to recent consolidation/sideways movement at levels just below the all-time highs. We will wait to see what develops for now, but our strategy of choice is looking to be a buyer on a price action signal.

Follow Nial Fuller on Twitter.

This article is commentary by an independent contributor, separate from TheStreet's regular news coverage.

More from Stocks

Flashback Friday: Amazon, Chip Stocks, Memorial Day

Flashback Friday: Amazon, Chip Stocks, Memorial Day

Week Ahead: Wall Street Looks to Jobs Report as North Korea Meeting Less Certain

Week Ahead: Wall Street Looks to Jobs Report as North Korea Meeting Less Certain

Dow and S&P 500 Decline, Energy Shares Fall as U.S. Crude Oil Slides 4%

Dow and S&P 500 Decline, Energy Shares Fall as U.S. Crude Oil Slides 4%

Replay: Jim Cramer on the Markets, 10-Year Yield, Oil Prices and Foot Locker

Replay: Jim Cramer on the Markets, 10-Year Yield, Oil Prices and Foot Locker

UAW Officially Files Complaint on Tesla Thanks to CEO Elon Musk

UAW Officially Files Complaint on Tesla Thanks to CEO Elon Musk