Few investors understood why gold prices and the SPDR Gold Trust (GLD 0.61%)stopped rallying in 2011. It just didn't make much sense at the time as the Federal Reserve continued quantitative easing and the U.S. continued to report wide fiscal and trade deficits. But now with the benefit of hindsight, it is safe to say one major factor for gold's decline has been the U.S. shale revolution.

The U.S. shale revolution has had a positive effect on the economy. Because of the advances in horizontal drilling and hydraulic fracturing, domestic oil and gas production has soared. The increased production has in turn indirectly created half a million new jobs, increased government revenues, and reduced the trade deficit. 

Those positive effects have also arguably postponed gold's rally by capping two factors that determine gold prices: the severity of the budget and trade deficit and inflation expectations. The extra government revenue from shale drilling has reduced the federal budget deficit while lower oil imports have reduced the U.S. trade deficit. Given that energy and food expenditures account for 10% and 15% of the chained consumer price index, respectively, the stable oil price made possible by the shale boom has also put a lid on inflation. 

Although the shale revolution had started before 2011, when gold prices were still rallying, the effects were not significant enough to impact gold prices. Now, given that North Dakota alone produces more oil than OPEC member Qatar, it is safe to say that the extra shale and tight oil and gas production matters in a big way. And given that the U.S. Energy Information Administration expects domestic oil production to continue to increase until 2016, the shale revolution may continue to matter for several more years. 

That being said, while the shale revolution has had an effect on gold, the price of the yellow metal does depend on other factors. As unemployment falls and the economy heats up, the velocity of money will likely increase, causing inflation to rise despite the cooling effect of the shale revolution. Gold miners like Barrick Gold Corp (GOLD 0.50%) and Goldcorp (GG) can also do well even if gold remains range-bound as long as the companies cut costs and increase efficiency. Gold miners do not necessarily have to lose in order for domestic oil and gas independents to win. 

But it is fair to say that the strength of the shale revolution is a reverse leading indicator for gold prices. If the U.S. shale revolution continues full steam ahead, gold's rally may have to wait a couple more years before inflation and the twin deficits become a problem again. If the shale revolution weakens prematurely, however, look for the price of the yellow metal to rise.