US blue chip stocks ended higher on Friday, helped by gains in energy companies, although investors showed caution before next week's presidential election.
The latest data gave a mixed picture of the economy.
A rise in crude prices limited overall gains, but helped stocks of energy companies rebound from a drop on Thursday. ConocoPhillips, a member of the S&P 500, rose 1.6 percent to $84.31, while Dow component Exxon Mobil Corp gained 61 cents, or 1.3 percent, to $49.22.
The Dow Jones industrial average ended up 22.93 points, or 0.23 percent, at 10,027.47. The Standard & Poor's 500 Index rose 2.76 points, or 0.24 percent, to close at 1,130.20. But the technology-laced Nasdaq Composite Index slipped 0.75 of a point, or 0.04 percent, to 1,974.99.
Investors were unwilling to take large positions ahead of the November 2 presidential election, and the indexes hugged the unchanged line for most of the day.
But stocks managed a small rally in the closing minutes when investors put some cash into the market as the month drew to a close, traders said.
"We're in the calm before the storm - the storm being the election. We're looking at oil and we're following the polls." said Chip Dickson, chief US investment strategist at Lehman Brothers.
Stocks had a roller-coaster week. The Dow hit a year low on Monday, but stocks rallied sharply for two days following a dramatic drop in oil prices earlier in the week.
All the major indexes rose for the week, with the Dow gaining 2.76 percent, while the Nasdaq and the S&P 500 each rose 3.13 percent.
For October, the Dow fell 0.5 percent, while the Nasdaq rose 4.1 percent, and the S&P 500 gained 1.4 percent.
The Dow and the S&P 500's weekly percentage gains were the largest since August, breaking a three-week losing streak for both indexes.
October was the Dow's second losing month, but marked the Nasdaq's biggest monthly percentage gain for a year.
"The market has had a pretty good week," said Michael Murphy, managing director at Wachovia Securities.
"There's a lot of nervousness because of the election and until we get that out of the way, people don't want to make commitments."
Trading was active, with 1.5 billion shares changing hands on the New York Stock Exchange, just above the 1.4 billion daily average for last year. About 1.6 billion shares were traded on Nasdaq, just below the 1.69 billion daily average last year.
Advancers outnumbered decliners on the NYSE by a ratio of about 10 to 7, while they were roughly even on Nasdaq.
"The market's been so skittish. You've got oil, economic numbers and the election coming up and it's hard to get a direction from those three indicators," said Robert Drust, managing director of listed trading at regional investment bank Wedbush Morgan.
NYMEX crude futures ended nearly a dollar higher as traders and players covered their positions before the weekend and Tuesday's election. Crude oil for December delivery settled at $51.78 a barrel, up 86 cents.
Economic reports were mixed. The Commerce Department showed gross domestic product, the total output of goods and services within US borders, expanded at an annual rate of 3.7 percent in the third quarter - below expectations for a gain of 4.2 percent. The US economy, however, was still bolstered by healthy consumer spending.
But business activity in the US Midwest grew in October at a much faster rate than expected, The National Association of Purchasing Management-Chicago report showed.
Among advancing blue chip stocks, Caterpillar Inc rose $1.01, or 1.3 percent, to $80.54, and United Technologies Corp added 75 cents, or 0.8 percent, to $92.82.
On Nasdaq, American Power Conversion Corp, which makes power protection systems, climbed about 13 percent, or $2.20, to $19.28 a day after quarterly earnings that beat Wall Street estimates.
The day's declining stocks included Dow and S&P 500 component American International Group, which fell 50 cents, or 0.8 percent, to $60.71. Standard & Poor's on Friday revised the longer-term outlook for certain of the big US insurer's top credit ratings to "negative" from "stable."
Avon Products Inc weighed on the S&P 500 index, slipping 8.5 percent, or $3.66, to $39.55 after Deutsche Bank Securities lowered its rating on the direct seller of cosmetics to "hold" from "buy".
Aon Corp fell 4.5 percent, or 96 cents, to $20.41, a day after the world's second-biggest insurance broker said quarterly earnings fell because of "softening market conditions" that, along with the halt of contingent commissions, led it to withdraw its earnings-per-share outlook for the full year.
The insurance industry's use of commissions has come under scrutiny by the New York attorney general's office.