NEW YORK (TheStreet) -- The major U.S. equity indices closed higher Tuesday amid optimism about the likelihood of a pledge for additional stimulus arriving from the Federal Reserve later this week.

The market shrugged off a warning from Moody's about a potential downgrade of the U.S. government's credit rating if legislators are unable to hammer out a budget deal to avoid the so-called fiscal cliff.

Apple ( AAPL), however, was a headwind as the stock fell for a second consecutive session ahead of its big media event on Wednesday. The company is widely expected to unveil the iPhone 5, and the stock hit a new all-time high of $683.29 on Monday before steadily pulling back ahead of the news. Shares finished down 0.32% at $660.59.

The Dow Jones Industrial Average rose 69 points, or 0.52%, to close at 13,323, touching its highest levels since December 2007 at an intraday high of 13,354.34.

The blue-chip index, which began the day up more than 9% so far this year, has now risen in six of the past nine sessions.

Winners far outpaced losers within the Dow, 24 to 6. The biggest percentage gainers were Alcoa ( AA), Bank of America ( BAC), Caterpillar ( CAT), Hewlett-Packard ( HPQ), and JPMorgan Chase ( JPM).

JPMorgan CEO Jamie Dimon spoke at an investor conference in New York Tuesday afternoon and reportedly said he believes the bank could weather a worst-case scenario in Europe. The stock climbed 2.2% on Tuesday.

The most prominent Dow decliners were American Express ( AXP), Home Depot ( HD), and Kraft Foods ( KFT).

The S&P 500 tacked on 4 points, or 0.31%, to finish at 1434. The Nasdaq, which sustained a 1% loss on Monday, rose less than a point, or 0.02%, to settle at 3104.53.

Energy, financials and conglomerates were the strongest sectors in the broad market. Only utilities closed in the read

Volume was light again, totaling just 3.49 billion on the New York Stock Exchange and 1.58 billion in the Nasdaq.

The Fed kicks off a two-day policy meeting on Wednesday with the end result widely expected to be the announcement of another round of quantitative easing, or QE3. In addition to launching another asset-purchase program, the central bank may extend its promise to keep interest rates at current historic lows from late 2014 into 2015.

Aside from the hype ahead of the Fed meeting, the latest batch of economic data showed some promise. The National Federation of Independent Business said Tuesday that its Small Business Optimism Index rose to 92.9 in August from 91.2 in July, up for the first time in four months, driven by a big increase in the job creation sub-index.

"The bottom line: Despite last week's disappointing employment report, the latest ISM and NFIB data suggest momentum is more up than down," said Jim O'Sullivan, chief U.S. economist at High Frequency Economics . "Of course, slightly better does not mean good. The trend still looks weak enough to encourage the Fed to ease again this week."

Also, the Census Bureau reported the U.S. trade deficit increased to $42 billion in July from a downwardly revised $41.9 billion in June. Economists expected the trade deficit to widen to $44 billion.

"July's U.S. trade figures are not as good as they look and it won't be long before the deficit widens more significantly as the global slowdown takes a greater toll on U.S. exports," said Paul Dales, senior U.S. economist at Capital Economics.

Moody's, however, warned it would likely downgrade the U.S.'s government's debt rating to Aa1 from Aaa if budget negotiations during the 2013 congressional legislative session failed to produce specific policies that would produce a stabilization and then downward trend in the ratio of federal debt to GDP over the medium term.

The FTSE in London pared losses, slipping 0.12%, while the DAX in Germany added 1.09%. The Hong Kong Hang Seng index closed up 0.15% and the Nikkei in Japan finished down 0.7%.

Traders are also looking ahead to the German Constitutional Court's ruling on the legality of the permanent bailout fund Wednesday. The decision will then be followed by a meeting of European finance ministers in Cyprus on Friday for talks about banking supervision and possible extra aid for Spain and Greece.

The benchmark 10-year Treasury fell 12/32 Tuesday, raising the yield to 1.699%, while the greenback dove 0.64%, according to the dollar index.

October crude oil futures edged up 63 cents to settle at $97.17 and December gold futures settled up $3.10 at $1,734.90 an ounce.

In corporate news, United Natural Foods ( UNFI) shares fell 8.6% after the distributor of natural, organic and specialty foods provided weaker-than-expected fiscal 2013 earnings projections following a decline in fourth-quarter gross margin due to purchasing and logistics inefficiencies.

Sunesis Pharmaceuticals ( SNSS) shares surged 32.2% after the company announced a positive development for the late stage trial of its treatment for acute myeloid leukemia.

Five Below ( FIVE), the off-price retailer, on Monday forecast an adjusted profit of between $200,000 and $600,000, or breakeven on a per share basis or earnings of 1 cent a share, on sales ranging from $79 million to $81 million. Analysts are looking for breakeven results on revenue of $79.6 million in the October-ending quarter. Shares tumbled 3.6%.

McDonald's ( MCD) said global same-store sales gained 3.7% in August. The results missed expectations of an increase of 3.9% as the global economy continues to stall. Shares closed up 0.11%.

--Written by Andrea Tse and Joe Deaux in New York.

>To contact the writer of this article, click here: Andrea Tse.

More from Markets

Inside Carnival's Mind Blowing New Horizon Cruise Ship (Video)

Inside Carnival's Mind Blowing New Horizon Cruise Ship (Video)

Jim Cramer: The 10-Year Yield Could Go to 2.75%

Jim Cramer: The 10-Year Yield Could Go to 2.75%

Oil Slumps, Gas Spikes Ahead of Holiday Weekend; Assessing the Chipmakers--ICYMI

Oil Slumps, Gas Spikes Ahead of Holiday Weekend; Assessing the Chipmakers--ICYMI

Week Ahead: Wall Street Looks to Jobs Report as North Korea Meeting Less Certain

Week Ahead: Wall Street Looks to Jobs Report as North Korea Meeting Less Certain

Dow and S&P 500 Decline, Energy Shares Fall as U.S. Crude Oil Slides 4%

Dow and S&P 500 Decline, Energy Shares Fall as U.S. Crude Oil Slides 4%