Hedge funds won when they gambled on oil’s demise last month, but their luck started to run out when it came to copper.

Money managers cut their crude net-long positions every week in July, and they were rewarded each time with a slide in prices. In all, the speculators slashed wagers by more than half over the month, U.S. government data show. Oil futures in New York tumbled 21 percent, the steepest loss since 2008.

Copper investors, meanwhile, got it right three out of five weeks in July, according to data from the U.S. Commodity Futures Trading Commission data. While they stayed net-short all month, keeping wagers on price declines, they twice trimmed those bets. Prices fell every week.

The speculators had a similar track record when it came to looking at commodities as an asset class. A measure of positions across 18 raw materials showed that investors were able to move with prices correctly 60 percent of the time.

The oil bets were well-timed, with crude futures in New York diving in July to the lowest end-of-the-month close since 2009.

No run of good investment calls is perfect, though. Speculators wagered that oil prices had reached a bottom last week -- a bet that was a bit premature as oil ended the period to Aug. 7 with a 6.9 percent drop.