* Euro holds near 3-week high versus U.S. dollar
* U.S. debt prices slip in light volume
* Gold hits record on safe-haven demand (Updates with close of U.S. markets)
By Herbert Lash
NEW YORK, June 18 (Reuters) - World stocks gained for a ninth straight day on Friday on improved risk appetite after a Spanish bond auction eased fears about sovereign debt in Europe and helped the euro hold near three-week highs.
U.S. and European shares retraced all their losses for the year as banks in Europe gained even as questions arose over a pledge by European Union leaders to publish details of "stress tests" on the health of banks that have been under pressure from lingering worries about the sovereign debt they hold.For details see: [
]Some analysts said the tests to be published in July would boost investor confidence in European banks.
U.S. stocks ground higher in light trade, with major indexes posting a strong week even though housing and labor market data showed signs of a fragile recovery. But the S&P 500 closed above its 200-day moving average for a third straight session, which suggests resilience.
For the week, the Dow and the S&P 500 each gained 2.4 percent and the Nasdaq added 3 percent.
"A positive day, but there is still a lot of resistance on the top side," said Phil Roberts, technical analyst at Barclays Capital. "It has come a long way without a correction so next week the market may struggle.
"But in the bigger picture if it continues to consolidate above the 200-day moving average we could see further gains."
MSCI's all-country world index <.MIWD00000PUS> gained almost 0.3 percent. The index has rebounded around 7 percent since its June 7 close and gained about 3 percent this week.
The world index was helped by European shares, which rose for the eighth consecutive session. It was the longest winning streak in 11 months.
MSCI's emerging markets counterpart <.MSCIEF> outperformed and was up almost 0.7 percent.
The Dow Jones industrial average <
> closed up 16.47 points, or 0.16 percent, to 10,450.64. The Standard & Poor's 500 Index <.SPX> rose 1.47 points, or 0.13 percent, to 1,117.51. The Nasdaq Composite Index < > added 2.64 points, or 0.11 percent, to 2,309.80.Energy shares helped support the Dow and S&P, with some investors betting that stocks beaten down due to the Gulf of Mexico oil spill had run their course.
The euro rose 2.1 percent against the U.S. dollar this week, its best weekly performance since May 2009, as anxiety about the fiscal health of euro zone countries eased this week and Spain attracted buyers for an auction of its debt.
Speculators cut short euro positions sharply in the week to June 15, a period in which the euro rose 3 percent against the dollar.
After hitting a three-week high above $1.24 on Thursday, the euro retreated to $1.2373 <EUR=>, unchanged on the day.
The euro slid to a record low <EURCHF=> at 1.3718 Swiss francs, according to Reuters data, while the dollar hit a one-month low of 1.1081 francs <CHF=>.
The dollar index <.DXY> was flat at 85.737, after falling to a one-month low at 85.453.
U.S. Treasury prices drifted lower in light trading as the market cleaved tightly to a yield range established over the past week and a half with no economic data to influence investors. [
]The limited strength in equities tugged on Treasuries, as they continued the highly correlated inverse relationship to stocks prices seen in recent days.
The benchmark 10-year U.S. Treasury note <US10YT=RR> traded 9/23 lower in price to yield 3.23 percent.
U.S. crude oil prices finished higher after wavering with U.S. equities, while oil traders' concerns about the danger of slowing Chinese demand and longer-term deepwater supply risks weighed on Brent crude and products. [
]U.S. crude futures for July <CLc1> rose 39 cents to settle at $77.18 a barrel.
Front-month August ICE Brent futures <LCOc1> fell 46 cents to settle at $78.22 a barrel, having traded as low as $77.25 earlier.
U.S. gold futures settled at the highest close ever after racing to a record level as investors continued to buy precious metals as an alternative asset after weak U.S. data on Thursday renewed worries about the pace of recovery, traders said.
U.S. gold futures for August delivery <GCQ0> in New York climbed to record $1,263.70 an ounce, and settled up $9.60 at $1,258.30, its highest close.
"It is a case of gold's ability to compete with both credit and equity markets for investments. Competing with credit markets has been in play for a long time, because of low interest rates and low opportunity cost of holding gold," said Tom Pawlicki, precious metals analyst at MF GLOBAL in Chicago. (Reporting by Ed Krudy, Wanfeng Zhou, Chris Reese and Carole Vaporean in New York; Christopher Johnson, George Matlock in London; Writing by Herbert Lash; Editing by Leslie Adler)