NEW YORK (CNNMoney) -- U.S. stocks flip-flopped Friday but closed slightly higher as investors remained skittish about the health of the economy after the latest report on home sales signaled further trouble for housing.
Only the Nasdaq was able to eke out a gain of 0.5% for the week. Both the S&P 500 and Dow closed the week down 1.1% and 0.5% respectively
For Friday, the Dow Jones industrial average () added 37 points, or 0.3%. The S&P 500 ( ) gained 4 points, or 0.3%. The Nasdaq ( ) rose 5 points, or 0.2%.
"Investors are starting to think we're getting late into the rally," said Rick Bensignor, chief market strategist at Merlin Securities.
It's been quite a rally so far. Even after several days of losses this week, the Nasdaq is up nearly 18% in 2012. Both the S&P 500 and the Dow are up 11% and 7%.
Some analysts say those high spikes are starting to encounter some resistance.
"Investors have one eye on China and are scared to death of what could happen to the economy," said Paul Powers, head of US equity trading at Raymond James. "The other eye is watching the recovery in the US which seems to be hanging in there."
Commodities helped lift the overall stock market Friday. Traders focused on reports citing the likelihood that Iranian oil exports would drop by the end of March. The fear of a decrease in supply pushed up oil prices and, in turn, oil stocks.
Trading was choppy for most of Friday as had already taken a big step back this week, following other mixed housing reports and fears of slower growth in China and Europe.
The report on new home sales came in short of forecasts, which gave investors yet another reason to hit the pause button.
Homebuilders took a hit, too. KB Home ( ) reported a sharp loss and said the quarter included a big drop in new orders. Its shares fell considerably, as did those of other major homebuilders including PulteGroup ( , Fortune 500), Lennar ( ) and Toll Brothers ( ).
The latest data follow several mediocre reports released earlier in the week on existing home sales and new home construction. Bucking the trend, a report on building permits was the strongest in more than three years.
Still, traders say volumes have been abnormally low this week, indicating that investors don't have strong convictions about the direction of the market.
Companies: Shares of Apple ( , Fortune 500) were halted briefly in late morning trading after what appeared to be an erroneous trade that pushed the stock to $543 from $598. Trading quickly resumed, with shares trading back around $598. A Nasdaq spokesperson said the exchange canceled trades executed between 11:14 a.m. and 11:15 a.m ET.
Bank of America (Fortune 500) announced a pilot program that would allow delinquent homeowners to relinquish the deed to the property and transition to tenant status. Only 1,000 homeowners are eligible for the pilot.,
Darden Restaurants (Fortune 500), which operates chains like Red Lobster and Olive Garden, posted quarterly earnings of $1.25 a share on $2.16 billion in revenue, slightly better than analysts had expected.,
BATS Global Markets (withdrew its IPO.), an equities and options exchange operator, started trading Friday at $15.25, after pricing its initial public offering at $16, the low end of its estimated range. Trading has been halted since late morning as the exchange said it was investigating system issues. By day's end, BATS announced it
World markets: European stocks ended mixed. Britain's FTSE 100 ( ) dropped 0.8%, the DAX ( ) in Germany added 0.2% and France's CAC 40 ( ) gained 0.1%.
Asian markets ended lower. The Shanghai Composite (), Hang Seng ( ) in Hong Kong and Japan's Nikkei ( ) all lost about 1.1%.
Oil for May delivery rose $1.52 to $106.87 a barrel.
Gold futures for April delivery rose $19.90 to $1,662.40 an ounce.
Bonds: The price on the benchmark 10-year U.S. Treasury rose, pushing the yield down to 2.24% from 2.28% late Thursday.
|What we want Apple to unveil at WWDC|
|Millennials squeezed out of buying a home|
|7 traits the rich have in common|
|Big Data knows you're sick, tired and depressed|
|Your car is a giant computer - and it can be hacked|
|Overnight Avg Rate||Latest||Change||Last Week|
|30 yr fixed||3.97%||4.04%|
|15 yr fixed||3.16%||3.18%|
|30 yr refi||3.99%||4.08%|
|15 yr refi||3.24%||3.19%|
Today's featured rates: