Image source: Getty Images.

After hitting new highs earlier this month, the S&P 500 is taking a little breather, and that could make this a good time to consider buying some exchange-traded funds on sale.

We asked some of our top contributors what index ETFs are ripe for the picking, and they came back with these three investment ideas: the SPDR S&P Metals & Mining Index ETF (XME -1.41%), the Vanguard Energy ETF (VDE 0.38%), and the Vanguard Mid-Cap Index Fund (VIMAX 0.78%). Read on to learn whether these ETFs are right for your portfolio.

A chance to dig up big gains

Todd Campbell: The SPDR S&P Metals & Mining Index ETF is one of this year's top-performing index ETFs. However, a recent drop in gold and silver prices and uncertainty over interest-rate policy have made this index ETF lose 4.4% of its value this month:

XME Chart

XME data by YCharts.

Although there's no telling what global central banks will do with rates in the coming year, the U.K.'s vote to leave the EU and a divisive U.S. Presidential election suggest there's no shortage of uncertainty that could fuel demand for metals, especially gold, a traditionally safe-haven investment.

If so, then there could be plenty of room for this ETF to head higher. Despite its 65% rally this year, the S&P Metals & Mining fund would still need to double to get back to its 5-year peak, or triple to get back to its 10-year high.

Undeniably, commodity stocks are very volatile, so this ETF won't be right for everyone. However, its recent drop could make this a perfect time for risk-tolerant investors to buy, and diversify their portfolios a bit more into this basket.

Room to run

Tyler Crowe: So far this year, the Vanguard Energy ETF has had a great run. Year to date, the ETF is up 15.8%, and is one of the best performers of Vanguard's sector-based ETFs. Even though these returns have been pretty good so far, it looks as though there is still a lot of room to run for this fund.

One of the things to consider with the Vanguard Energy ETF is that it is very heavily weighted toward the exploration and production of oil and gas. Pure exploration-and-production companies make up only 27% of the fund, but integrated oil and gas companies make up 39%. Even though integrated companies do have assets in other parts of the oil and gas value chain, the bulk of their earnings normally comes from the production side of the business -- at least when oil prices are reasonably high. That means two-thirds of the fund's holdings are positioned to react favorably to rising oil prices.

While there is no guarantee of a rebound in oil prices in the next six to 12 months, it is almost certain that we will see one. There are simply too many production companies losing money, and the gap between supply and demand is getting smaller every day. When this rebound does happen, most of the stocks in this fund will see big gains; that suggests the Vanguard Energy ETF has a bright future over the next few years.

Stocks that are sized just right

Dan Caplinger: Most of the attention in the market has gone to well-known large-cap companies, and the record highs in the S&P 500 and Dow Jones Industrial Average show how popular those stocks have been. Yet largely ignored in the hype about the biggest market benchmarks is the excellent performance of mid-cap stocks. The S&P MidCap 400 Index also hit new all-time record highs in July, and at 8.5%, the Vanguard Mid-Cap Index Fund has delivered year-to-date returns that are almost a full percentage point higher than the S&P 500.

Mid-cap stocks offer the best of both worlds to investors. They're large enough to have well-established businesses that make them more reliable than small-cap stocks. Yet they're also small enough to have plenty of future growth potential, and that can make them more attractive than more mature large-cap stocks.

By choosing a fund that specializes in mid-cap stocks, you can go a long way toward diversifying what, for most investors, ends up being a very large-cap-centric portfolio. With rock-bottom expenses and a representative set of holdings, the Vanguard Mid-Cap Index Fund will give you the mid-cap stock exposure you want to give your portfolio a little extra kick.