If someone had said at the start of this year that the markets would rally to new highs in the second half, they probably would have been met with disbelief or laughter. It was, after all, a time when crude oil hit multiyear lows, causing stock markets to record their worst start ever to a year.

Fast forward seven months and even after jittery developments like Britain's surprising decision to leave the European Union, the S&P 500 and Dow Jones Industrial Average have scaled new all-time highs.

Bolstering this rise are basic materials stocks, including the metals and mining and oil and gas sectors. They not long ago looked down and out in the face of slowing economic growth in China, which is the largest consumer of metals, and the supply glut of oil and natural gas.

Below are the best opportunities in these sectors.

We also unveil a proven investment strategy that makes money in good and bad markets.

Metals and Mining

If you want to get a sense of just how much metals and mining stocks have risen since the beginning of the year, look at S&P Metals and Mining Select Industry Index. It's up a startling 83.25% since the start of the year. Silver- and gold-related stocks have soared, boosted by higher prices of the precious metals. 

Silver is considered an industrial and precious metal and generally lags the price of precious metal gold.

As economic uncertainties mounted, investors flocked towards gold for its safe-haven and wealth-protection status. From under $1,100 an ounce at the start of 2016, gold is now worth $1,327 an ounce, a 20.6% jump.

Benefitting the most from this spike are the mining companies. Barrick Gold (ABX) and Newmont Mining (NEM) - Get Report  look particularly good as the higher price of gold improves their margins. Newmont mining has already risen close to 122% year-to-date while Barrick has climbed 172% in the same period.

Brexit uncertainty may have faded for now, but it hasn't died and can resurface anytime, leaving plenty of upside potential for these miners. Meanwhile China, known for its gargantuan appetite for gold, is expected to continue driving gold purchases as it strives to diversify its reserves.

Image placeholder title

Oil and Gas

This sector's rise may not be as spectacular as that of metals, but any kind of recovery in this space is an encouraging sign, considering the ongoing oil glut and sluggish Chinese market.

The S&P Oil & Gas Exploration & Production Select Industry Index has risen 16.15% with blue chips Exxon Mobil (XOM) - Get Reportand Chevron (CHEV) outperforming the index with gains of over 20% this year. Both Exxon and Chevron are good bets now.

The rise in the exploration and production index has been driven by a stabilization in crude oil prices at near $50 a barrel levels. In February, they were scraping lows of $26 a barrel

Other stocks that have seen a breakthrough this year are mining company Freeport-McMoRan , energy infrastructure firm Kinder Morgan and oil and gas giant BP. Freeport has seen its shares almost double this year after a dismal 2015, thanks to the rebound of copper and gold along with the energy sector. All three stocks are well-timed momentum buys.

A sustained recovery in crude oil prices is expected if the demand outlook by holds true.

According to OPEC's Monthly Oil Market Report, demand for OPEC crude in 2016 and 2017 is expected to be 31.9 million barrels per day (mb/d) and 33 mb/d, respectively, against 30 mb/d in 2015. Excess stock is also expected to be eliminated by 2017.

Image placeholder title

Chemicals

Another constituent of the basic materials industry, the chemicals space, had a reasonably good 2015 because of a strong automotive market and improvement in construction spending. The trend is set to continue in 2016. I. du Pont de Nemours and Company (DD) - Get Reportis among the larger names in the business and has staged a significant recovery from January lows. It should continue its winning ways in 2016.

Image placeholder title

However, smaller chemical players have gained as well. Koppers Holdings, which provides carbon compounds, wood treatment chemicals, and treated wood products and services, has gained over 70% this year and has the potential for more gains.

With the materials sector making unexpected gains and leading the new highs of the S&P 500 and DJIA, consider buying these stalwarts.

---

"I've Enjoyed 1,586 Days of Free Money..." If big, triple-digit winners get your adrenaline pumping, then stop reading right now. Because this isn't for you... Only traders who calmly enjoy raking in an extra $67,548 with no surprises or hiccups will appreciate this moneymaking strategy. In fact, for the past 1,586 days, I've been leisurely collecting giant payouts with this boring approach. I win 8 out of every 10 trades - GUARANTEED. Click here to join me.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.