Recently, Warren Buffett has made headlines by selling all of his shares in Exxon Mobil (NYSE: XOM), the rest of his position in ConocoPhillips (NYSE:COP), and reducing his stake in National Oilwell Varco. This has people wondering if the glory days of oil investing are over.

Warren’s opinion of oil investments carries a lot of weight, because over a 32 year period, Warren Buffet’s Berkshire Hathaway portfolio has generated an average annual return of 24 percent. His most famous investments are Coke, American Express, and Gillette (which is now Proctor and Gamble). These investments have made him over 3 billion dollars each. This is why when Buffett buys or sells a stock, everyone takes notice.

The problem with this generally accepted assumption is that it hasn’t been proven that his equity investing success equates to success in the resource sector. In order to find out if this accepted assumption is correct, we first have to visit Warren’s history of investing in the resource sector.

His first foray into the resource sector began in 2002, when he took a $500 million dollar stake in Petro China (NYSE: PTR). In 2007, he sold it at a profit of $3.5 billion dollars. This investment was successful because he bought it when it was undervalued. He thought the business was worth $100 billion dollars, and it was trading at a value of $45 billion dollars. That is value investing 101; buy when it’s undervalued, and sell when it’s fairly valued. Related: Finally Some Good News For Oil Prices

His next venture into the resource sector began in 2008, when he purchased shares in ConocoPhillips. This investment was made because Buffett claimed that the energy sector provided him the product stability that he desired.

This investment ended up costing Berkshire Hathaway several billion dollars. The first reason this investment failed was he broke his own rule; and that is “if you can’t understand it, don’t do it.” Although a great investor he maybe, he clearly didn’t understand the resource sector. Look at this chart below.

As you can see from the chart above, the price of oil is anything but stable. In the middle of 2008, the price of oil was near its all-time high. The resource sector is the most cyclical sector in the equities market. Warren Buffet’s ConocoPhillips investment cost Berkshire Hathaway billions of dollars because he didn’t follow the cyclicality that’s involved when investing in the resource sector. This is also why his investment in Energy future holdings failed. He purchased their bonds when Natural Gas prices were near their high.

To achieve success in this sector, you have to buy oil and gas stocks when they are out of favor and the price of oil or gas is at a multi-year low. In 2009, the price of ConocoPhillips reached a low of $35 a share, and in 2014, it reached a high of $80 dollars a share. If Warren had purchased ConocoPhillips in 2009, and not 2008, it would have been one of his greatest investments ever. Related: US Oil Demand Is Alive And Well

Buffett’s most successful oil investment was his railroad company Burlington Northern Railroad. This is considered an oil investment, because this rail road company transported oil from the Bakken to its refiners. Since 2009, Berkshire has collected more than $15 billion dollars in dividends from Burlington Northern Railroad, while its annual revenues have increased by 57%, and its earnings have more than doubled.

The main reason his investment in Burlington Northern Railroad was successful, was due to the fact that he made this investment during the 2008 crisis, when prices were low. This Buffett quote explains the success of this investment perfectly, “Be greedy when others are fearful and fearful when others are greedy.” This company also fits the Buffett investing mantra of buying stable, boring, and predictable businesses, with steady cash flows.

Other notable oil investments include Suncor and Phillips 66, which he has recently added to his existing positions.

As you can see based on past history, Buffett’s success in the resource sector has been a mixed bag. To understand why his success has been a mixed bag, you have to first fully understand Buffet’s investing philosophy, and then fully understand the resource sector as well.

In order for Buffett to buy a stock, the company has to pass this set of criteria: high margins with a low amount of debt (it doesn’t take a genius to run them); strong franchises and freedom to price, with predictable earnings. This set of criteria sounds great when investing in a consumer goods business, but when investing in the resource sector, it’s almost impossible to achieve. Look at this chart below.

The energy industry has higher capital spending requirements than other industries. To be successful in the resource industry, you have to readjust your investing strategy so you’re able to succeed in a high capital spending environment. This also means you have to be comfortable with companies possessing higher amounts of debt and lower margins than what you are normally accustomed to. Related: Oil Prices To Fall Or Fly Depending On Iranian Nuclear Talks

Another Buffet criterion that won’t be fulfilled when investing in the resource sector is buying franchises that have the freedom to price. When it comes to oil and gas, this commodity is traded on exchanges all over the world. Exchanges, which speculate on world production and consumption, are the only things that influence the price of oil and gas.

Lastly, when trying to fulfill his criterion of “not needing to be a genius to run it”, this is impossible when trying to grow, or maintain oil production. Running an oil and gas company, requires numerous amounts of geoscientists, chemical engineers, mechanical engineers, and petroleum engineers to maintain or grow the business.

Buffet’s successes in the resource sector demonstrate that you should buy when prices are low, the sector is out of favor, company cash flows are still stable, and companies are selling for less than its book value.

By John Manfreda for Oilprice.com

More Top Reads From Oilprice.com: