Investors are buying metals from zinc to aluminum at the fastest pace since 2009, betting demand gains will tighten supply, just as Citigroup Inc. and Macquarie Group Ltd. predict this year’s rallies will end.

Exchange-traded funds in the U.S. backed by base metals took in new money this year equal to 18 percent of their market capitalization, more than any commodity group, data compiled by Bloomberg show.

Hedge funds are the most bullish on copper in at least eight years, after spending March and most of April betting prices would drop. The Bloomberg Industrial Metals Subindex is heading for its biggest annual gain since 2010.

Pickups in global manufacturing and auto sales, and gains in U.S. housing, improved prospects for metals used in everything from appliances to building materials. While Citigroup and Macquarie say rising output of some metals and weaker Chinese demand may undercut prices, the biggest gains among 22 raw materials tracked by the Bloomberg Commodity Index since March have been nickel, zinc and aluminum.

“Base metals seem to have caught investors’ attention once again,” Vivienne Lloyd, an analyst at Macquarie in London, said in a telephone interview. “Probably the most eye-catching story has to be nickel. It’s got people talking, and the appearance of deficit has been bounded around the concept of deficit in several markets.”

Metals Rally

Nickel jumped 20 percent and zinc advanced 19 percent since the end of March on the London Metal Exchange. Aluminum gained 15 percent, copper added 6.2 percent and lead rose 7.2 percent. The Bloomberg Commodity Index of 22 raw materials slid 4 percent over the same period, while MSCI All-Country World Index of equities rose 5 percent. The Bloomberg Treasury Bond Index gained 1.7 percent.

Gains for industrial metals were fueled by concern that supplies for some won’t be enough to meet demand. Indonesia, the biggest producer of mined nickel, banned exports of unprocessed ores in January. Nickel prices have surged more than any commodity except coffee this year.

By the end of the first quarter, demand for copper exceeded output by 84,000 metric tons, according to the International Copper Study Group. That’s equivalent to the amount of the metal that would be used in about 422,000 average single-family homes, or 3.7 million typical U.S. automobiles, based on data from the Copper Development Association.

Money managers held a net-long position of 48,994 futures and options contracts for New York copper as of July 15, the fourth straight weekly gain and the highest since the data began in 2006, U.S. Commodity Futures Trading Commission data show. As recently as June 17, the holdings showed bets that prices would fall, with a net-short position of 313 contracts.

Gains ‘Overdone’

The rallies may not last. Mining companies are boosting output and may swamp demand in many raw materials, Goldman Sachs Group Inc. analysts said in a July 15 report.

Copper will drop 6 percent to $6,600 a metric ton by the end of the year because of production surpluses and China’s weakening property market, the New York-based bank said. Goldman forecasts nickel will rise to $22,000 by the fourth quarter, or 17 percent above yesterday’s close, before dropping to $16,000 in 12 months.

Gains by aluminum and zinc are “overdone,” and prices may fall by at least 4 percent by the end of the fourth quarter, David Wilson, a Citigroup analyst in London, said in a telephone interview. Forecasts collected by Bloomberg show analysts expect a drop for all base metals except tin and lead by year-end.

In a report yesterday, Macquarie forecast lower prices in three to six months for copper, aluminum and zinc.

‘Tourist’ Investors

“We are of the view that prices are now running ahead of where the fundamentals would justify for a number of the metals Joseph Murphy, an analyst in London at Hermes Fund Managers Ltd., which oversees about $1.6 billion in commodities, said by e-mail July 15. ‘‘However, the recent large inflows from ‘tourist’ investors are the reason they are moving higher.’’

ETPs tracked by Bloomberg show an inflow of $75.7 million to funds linked to industrial metals this year, compared with a net outflow for all of 2013 of $51 million, or 9.3 percent of market capitalization.

Demand is showing signs of improving. The Bloomberg ECO Surprise Index for the U.S. rose to a 15-month high this month, and in June U.S. factory output capped the strongest quarter in almost four years. Manufacturing in China expanded at the fastest pace of 2014.

China’s Purchasing Managers’ Index was at 51 in June, the highest since December, the National Bureau of Statistics and China Federation of Logistics and Purchasing said July 1. The official subindex of new orders tied for the highest in more than two years, giving momentum that will help protect the government’s growth target of about 7.5 percent in 2014.

‘Positive Trend’

‘‘When industrial numbers turn positive, that means you have a positive trend,” Frank Holmes, chief investment officer at U.S. Global Investors, which oversees $1.1 billion. “If the PMI is positive, that means you have a very strong economy. Those are the two global economic indicators that have the highest correlation to base metals.”

The annualized pace of new-vehicle sales in the U.S. accelerated to 16.9 million in June, the highest since July 2006, according to data from Ward’s Automotive Group. In China, sales in the first six months of 2014 grew 8.4 percent to 11.7 million units, China Automotive Information Network data show. European car sales in June rose for the 10th straight month, the longest run of gains in four years, an industry group said.

New-home sales in the U.S. climbed 19 percent in May to the highest since 2008, while construction spending in the country advanced to this year’s high of $956.1 billion.

Mine Closures

Mine closures are compounding supply concerns. Several zinc operations including MMG Ltd.’s Century open pit in Australia will close next year. Demand will exceed output by 339,000 tons in 2014, widening to 438,000 tons, according to Credit Suisse Group AG. Stockpiles at warehouses monitored by the London Metal Exchange are down 30 percent this year and at the lowest since December 2010.

Aluminum production may not meet expanding use after some smelters in the world outside China curbed output. Alcoa Inc. has announced 1.1 million tons of output cuts. The most recent plant closure, Point Henry in Australia, is scheduled to be closed in August

Most stockpiles are being held in financing arrangements or are in locations with long wait times and not available for immediate use. Indonesia’s ban on exports of unprocessed ores, including bauxite, a raw material used in aluminum making, may limit stockpiles.

“We think there are some very specific fundamental stories within base metals and they are particularly well geared to this kind of slow grinding recovery and this industrial cycle,” Paul Horsnell, global head of commodities research at Standard Chartered in London, said in a telephone interview July 15. “So we think they should outperform.”