Rita Nazareth
Bloomberg News

Stocks declined in Tuesday trading, erasing earlier gains after benchmark indexes approached five-year highs, amid concern that global stimulus measures won’t be enough to boost growth at the world’s largest economy.

Apple Inc. dropped 2.5 percent, extending a two-day decline to 3.8 percent, the most since July.

Caterpillar Inc., the world’s biggest construction and mining equipment maker, slumped 4.3 percent after cutting its forecast for 2015 earnings. Staples Inc., the largest U.S. office supplies chain, decreased 4.5 percent after announcing plans to close stores. Red Hat Inc., the largest seller of the open-source Linux operating system, lost 4.3 percent amid disappointing earnings.

The Standard & Poor’s 500 Index retreated 1.1 percent to 1,441.59, the biggest decline since June 25. The index dropped a fourth day.

The Dow Jones industrial average decreased 101.37 points, or 0.8 percent, to 13,457.55.

“Things won’t get better as fast as people think they will,” said Malcolm Polley, who manages $1.1 billion as chief investment officer at Stewart Capital in Indiana, Pa. “The Fed’s actions are not going to lead to higher growth.”

Federal Reserve Bank of Philadelphia President Charles Plosser said new bond buying announced by the Fed this month probably won’t boost growth or hiring and may jeopardize the central bank’s credibility. Stocks gained early Tuesday as data showed confidence among American consumers rose in September to a seven-month high. Home prices climbed more than forecast in July from a year earlier.

Both the S&P 500 and the Dow average are near their all-time highs of October 2007 as investors bought equities amid optimism about better-than-estimated earnings and central bank stimulus measures. The Dow needs to rise 5.3 percent to reach its peak of 14,164.53, while the S&P 500 needs an increase of 8.6 percent to reach its record of 1,565.15.

“The economic numbers are decent,” said Burt White, who oversees about $350 billion as chief investment officer at LPL Financial Corp. in Boston. “The housing healing is here. The fact that you’re starting to see stabilization in housing is a real boost to confidence.”

All 10 groups in the S&P 500 retreated as technology, financial and commodity shares had the biggest declines.

Apple dropped 2.5 percent to $673.54 and trimmed this year’s gain to 66 percent. Jim Chanos, who oversees $6 billion as the founder and president at Kynikos Associates Ltd., said he’s skeptical on Apple after the shares surged this year. He prefers owning Microsoft Corp. to hedge wagers on declines in companies such as Hewlett-Packard Co.

“We’re getting afraid of heights,” Chanos said about Apple’s share price. “It has had an enormous run. Something about it is holding us back in that it’s had such a run.”

Caterpillar lost 4.3 percent to $87.01. The company said profit will be $12 to $18 a share, compared with a previous projection of $15 to $20.

Staples retreated 4.5 percent to $11.80. The company plans to shut 45 locations in Europe and accelerate the closing of 15 stores in the U.S. as part of a plan to save about $250 million a year. The closings, the impairment of goodwill in the European business and other actions will result in total pretax charges of as much as $1.12 billion in the fiscal year ending in January, Staples said in a statement.

Red Hat decreased 4.3 percent to $55.08. The company cited a slowdown in the services side of its business for the lower forecast. Demand for subscriptions to its software remains strong, Chief Executive Officer Jim Whitehurst said on the conference call.

Tesla Motors Inc. dropped 9.8 percent to $27.66. The electric-car maker led by Elon Musk cut its revenue outlook for the third quarter because of supplier shortcomings and other delays in accelerating production of its Model S sedan.