* Dow, S&P 500 end at all-time highs on Bernanke, earnings
* Nikkei rises, yen pressured ahead of elections
* Bunds reach five-week high, tracking U.S. Treasuries
* U.S. crude advances, gold and copper edge higher
By Ryan Vlastelica
NEW YORK, July 18 (Reuters) - Stock markets worldwide extended their rally on Thursday, with major U.S. indexes hitting all-time highs as the Federal Reserve again reassured investors that it was flexible on the timing for ending its stimulus program.
Fed Chairman Ben Bernanke testified before Congress for a second day on Thursday and reiterated that the Fed would only start phasing out its stimulus once it is sure the economy is strong enough to stand on its own.
His comments lured investors to equities, pushing major indexes to all-time closing highs and gave the S&P 500 its tenth positive session out of the past 11. The euro fell and the dollar rose against a basket of currencies.
“Bernanke has made equities the only place for most people to go, and the rally has been entirely on him,” said Mark Grant, managing director at Southwest Securities in Fort Lauderdale.
The Dow Jones industrial average gained 78.02 points, or 0.50 percent, at 15,548.54. The Standard & Poor’s 500 Index was up 8.46 points, or 0.50 percent, at 1,689.37. The Nasdaq Composite Index was up 1.28 points, or 0.04 percent, at 3,611.28.
U.S. stocks were also supported by strong quarterly earnings reports from IBM and Morgan Stanley, though Intel Corp sank following its results. A jump in regional factory activity boosted sentiment as well.
After the market closed, Moody’s changed its outlook on the United States’ “AAA” sovereign rating to stable from negative, reflecting its view that federal government debt was on track with the rating agency’s criteria.
The MSCI International ACWI Price Index rose 0.5 percent.
European equities ended 0.9 percent higher, outperforming U.S. markets, as the broad STOXX Europe 600 broke above a resistance level.
The dollar rose 0.1 percent against a basket of currencies while the euro was down 0.1 percent. The U.S. benchmark 10-year Treasury note was down 15/32, the yield at 2.5472 percent.
Market participants awaited a meeting of Group of 20 finance ministers for signs of an orchestrated approach to the end of U.S. money-printing, which could help defuse volatility in global markets.
The G20, which meets in Moscow on Friday and Saturday, includes many of the emerging economies that have been at the sharp end of the dollar’s surge since Bernanke first signaled in May that the Fed would roll back its bond-buying program.
With no surprises from Bernanke during his congressional testimony, currency markets started to focus on Sunday’s Upper House elections in Japan, which are expected to strengthen Prime Minister Shinzo Abe and his radical stimulus strategy.
‘Abenomics,’ as Abe’s $1.4-trillion plan is known, has caused a 14 percent drop in the yen this year.
Ian Stannard, head of European FX strategy at Morgan Stanley in London, said he expected a further retreat once the Fed firms up a plan to withdraw its supportive measures.
“The market is of the view the Abe administration will come out of this very well, so post-election it will be an interesting time because we could see the rhetoric around the reform plans picking up,” Stannard said. “If this is the case, we will start to see the yen coming under pressure again.”
Japan’s Nikkei share index earlier surged 1.3 percent to an eight-week high while the U.S. dollar gained 0.9 percent against the yen to 100.46 yen.
In debt markets, benchmark German Bunds edged 0.1 percent higher, hovering around a five-week high.
An impending no-confidence vote against Portugal’s ruling coalition has turned the focus to peripheral euro zone debt.
The motion, proposed by a minor party, is seen as likely to fail. But markets will be on the lookout for any signals sent by the three main parties, which are holding talks on a broad deal to keep the country’s bailout program on track.
Spain and France both held smooth bond auctions on Thursday despite Spain’s prime minister fighting a corruption scandal and France having just lost its last triple-A sovereign credit rating from a major ratings agency.
Commodities, meanwhile, were mixed, with Brent oil flat but U.S. crude futures jumping 1.5 percent as U.S. stocks fell for a third straight week. Copper rose 0.3 percent and gold rose 0.6 percent.