NEW YORK (Reuters) - Global stocks and oil prices surged in a relief rally on Friday after Chinese data eased fears of a potential hard landing for the world's No. 2 economy and a further blow to growth worldwide.
U.S. stocks broke a six-day losing streak, and the euro advanced against the dollar for the first time in four days as risk sentiment broadly improved and investors covered bets against the currency.
Wall Street surged in the last hour of the session in light trading, just pushing the Dow and S&P 500 into positive territory for the week. The Nasdaq also rose but remained in negative territory for the week.
"There was a little bit of short-covering going into the weekend, accelerating to the upside, but on very light volume," said Douglas DePietro, a managing director at Evercore Partners in New York. "I don't think there's a whole lot to make of it, maybe a little bit of buy program out there."
A 7.6 percent reading of gross domestic product growth in China was a hair above the government's expectations, bolstering sentiment across the board in commodities and buoying equities.
The euro rebounded from a fresh two-year low plumbed earlier in the day, as investors sought to cover bets against the currency and risk sentiment broadly improved.
"The data out of China suggested that things are not all that bad, and that's giving a relief rally," said Randy Frederick, managing director of trading and derivatives with the Schwab Center for Financial Research.
"But I think the rally today is a lot stronger than it should be, and I don't expect this to continue for very long."
JPMorgan Chase & Co (JPM.N) posted $4.4 billion of losses from its "London whale" trades and said it may incur $700 million to $1.7 billion in further losses.
But the bank's stock rose 6 percent to $36.07 as the trading losses cut second-quarter profit by only $471 million from a year earlier, to $4.96 billion.
JPMorgan's surge added the most points to the S&P 500, and lifted the banking sector .BKX by 3.26 percent.
Concerns about slowing growth have pressured risk assets in the recent past.
"The market was very oversold, so with China looking better than we previously thought, and JPMorgan looking like it has healed itself, things appear contained for the moment," said John Manley, chief equity strategist at Wells Fargo Funds Management in New York. "We're putting in a bottom, not a top."
Investors shrugged off a survey that showed U.S. consumer sentiment cooled again in early July to its lowest in seven months as Americans took a dim view of their finances and job prospects.
The Thomson Reuters/University of Michigan's preliminary reading on the overall index on consumer sentiment fell to 72.0 from 73.2 in June.
Separately, producer prices rose only slightly in June as energy costs dropped, suggesting inflation pressures remain muted. The Labor Department said seasonally adjusted producer prices rose 0.1 percent, a pace that leaves the door open for more efforts from the Federal Reserve to stimulate the economy.
The Dow Jones industrial average .DJI closed up 203.82 points, or 1.62 percent, at 12,777.09. The Standard & Poor's 500 Index .SPX added 22.02 points, or 1.65 percent, at 1,356.78. The Nasdaq Composite Index .IXIC climbed 42.28 points, or 1.48 percent, at 2,908.47.
For the week, the Dow gained 0.04 percent, the S&P rose 0.15 percent but Nasdaq fell 0.98 percent.
European shares extended gains, with traders citing speculation of a shift in asset allocation as the jump in U.S. stocks helped the euro to rebound from a two-year low against the U.S. dollar.
The euro last traded at $1.2242, up 0.4 percent, rebounding from a mid-2010 low of $1.2160 hit earlier in the session.
The FTSEurofirst 300 .FTEU3 rose 1.3 percent to close at 1,042.63.
"There is a major asset allocation switch out of Treasury long-end ETFs into European equities happening right now," said Justin Haque, a trader at Hobart Capital Markets.
The benchmark 10-year U.S. Treasury note was down 4/32 in price to yield 1.4893 percent.
The euro's rebound also changed sentiment on Italian government debt. Italian yields had jumped after a surprise ratings cut by Moody's highlighted the risk that the debt crisis could potentially engulf the euro zone's third-biggest economy.
Moody's warned it could further downgrade Italy's credit rating, now just two notches above junk status, if the country's access to debt markets dried up.
Commodities staged a mini relief rally as the Chinese GDP data was not as bad as some had feared.
Brent crude oil futures settled up $1.33 to $102.40 a barrel.
U.S. crude settled up $1.02 at $87.10 a barrel, and gained 3.1 percent for the week.
Gold rose, lifted by sharp rallies in equities and commodities, on the Chinese data.
U.S. gold futures for August delivery settled up $26.70 an ounce at $1,592. Spot gold prices rose 1.04 percent to $1,588.00.
The Reuters/Jefferies CRB Index .CRB of 19 commodities rose 1.27 percent to 293.96.
Additional reporting by Ingrid Melander in London; Editing by Dan Grebler and James Dalgleish