Energy and commodity shares buoyed Wall Street on Monday after Chinese trade data suggested strong demand for basic materials, but the lowest volume so far this year indicated the equities rally may be near a top.

The S&P 500 edged up, trading near its highest since June 2008 but stuck in the 1,325-1,333 area that includes the 50 percent extension of last year's slide from April to July, and also the 100 percent advance from the cycle low hit in March 2009.

The coincidence of the levels makes the technical resistance stronger.

With about an hour of trading left, fewer than 5 billion shares had traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq, the lowest volume so far this year.

You're always looking for divergences that suggest momentum might be waning, said Shawn Hackett, president at Hackett Advisors in Boynton Beach, Florida, referring to the index highs and volume lows.

Everything I see suggests the driver now is a last bit of greed and momentum before the market runs out of buyers.

Three-month copper hit a new record high after the robust Chinese import figures, lifting shares of miners. Freeport McMoRan Copper & Gold jumped 4 percent to $55.67 and the PHLX Gold/Silver index <.XAU> rose 1.9 percent.

The Dow Jones industrial average <.DJI> fell 1.55 points, or 0.01 percent, at 12,271.71. The Standard & Poor's 500 Index <.SPX> rose 2.72 points, or 0.20 percent, at 1,331.87. The Nasdaq Composite Index <.IXIC> gained 6.63 points, or 0.24 percent, at 2,816.07.

U.S. President Barack Obama proposed a federal budget that he said would cut the U.S. deficit by $1.1 trillion over the next 10 years. Congress must approve the plan, and Republicans, who are in the majority in the House, said it did not curb spending enough.

Obama's budget could boost clean energy shares as it provides $8 billion for investment in the sector, but big drugmakers could take a hit from generic competition under two proposals put forth in the plan.

Among alternative energy companies, Trina Solar gained 5.4 percent to $28.86 while GT Solar International climbed 2.8 percent to $11.51. Pharmaceutical maker Merck & Co , a Dow component, slid 0.6 percent to $32.88.

The S&P 500 has gained nearly 27 percent since the start of September. Still, some see residual strength in the market and are willing to buy on any declines in prices.

We wouldn't be surprised to see a pullback, but longer term we think the market has room to grow, said Mitch Rubin, chief investment officer at RiverPark Advisors in New York. Because of that, we would use any pullback to add to our positions.

Wal-Mart Stores Inc was one of the worst performers on the Dow after JPMorgan downgraded the stock. Shares fell 1.5 percent to $54.88.

New deals continued a string of recent merger and acquisition activity. EchoStar Corp agreed to buy Hughes Communications Inc for about $1.33 billion, while private equity firm Clayton, Dubilier & Rice agreed to take Emergency Medical Services Corp private for about $3 billion.

Shares of Hughes fell 3.8 percent to $59.44 while EchoStar rose 2.8 percent to $30.73. Emergency Medical fell almost 11 percent to $62.92.

General Electric Co plans to buy the well support division of British energy services firm John Wood Group Plc for about $2.8 billion in the latest move to boost its presence in oil services. GE rose 1.1 percent to $21.56.

(Reporting by Rodrigo Campos, additional reporting by Ryan Vlastelica; Editing by Kenneth Barry)