* Global shares head for fourth week of gains * U.S. stock investors take profits after rally, tech results * Japan upper house election on Sunday in focus, yen claws up * Bonds, oil see quiet end to week; gold rises By Ryan Vlastelica NEW YORK, July 19 (Reuters) - Stock markets around the world retreated on Friday as some disappointing corporate results pushed investors to take profits after a string of gains that took major U.S. indexes to record levels. Major currency and commodity markets were largely quiet, with both the dollar and euro moving slightly on the day, while gold and oil both rose. Equities remained on track for their fourth straight week of gains, lifted by reassurances that the U.S. Federal Reserve would be flexible about when it will end its monetary stimulus. The S&P 500 has risen for 10 of the past 12 sessions, advancing to repeated record highs. While Wall Street stocks have also been supported by some better-than-expected corporate profits, disappointing results from Microsoft Corp and Google Inc pressured shares on Friday. "It's the first time in this cycle that we've had some household names that have missed and I think that's important, especially on a day where we're starting to transition our entire focus over to earnings," said Art Hogan, managing director at Lazard Capital Markets in New York. On the upside, global bellwether General Electric advanced 4.7 percent to $24.73 after its earnings results topped forecasts. The Dow Jones industrial average was down 33.48 points, or 0.22 percent, at 15,515.06. The Standard & Poor's 500 Index was down 3.16 points, or 0.19 percent, at 1,686.21. The Nasdaq Composite Index was down 28.86 points, or 0.80 percent, at 3,582.42. Sentiment was also bolstered by long-awaited lending changes in China designed to bolster its flagging growth. The People's Bank of China said it was removing its floor on lending rates for commercial banks, meaning they will now be able to cut rates as much as they see fit to attract borrowers. The news from China helped Europe's FTSEurofirst 300 rebound off its early weakness, though it remained 0.2 percent lower on the day. The MSCI International ACWI Price Index fell 0.2 percent, but was on track for its first four-week run of uninterrupted gains since May. Economists have been optimistic about U.S. growth prospects for some time but some are now starting become increasingly upbeat on Europe too. "Our biggest overweight is still the U.S., that story is just getting better and better, but what has surprised many externally and internally is that we have just gone overweight on Europe," said UBS global macro strategist Ramin Nakisa. "The biggest acceleration of any region we look at is in Europe at the moment. Emerging markets are slowing down whereas Europe is picking up so you can't wait for the GDP figures because they are always backward looking." JAPAN ELECTIONS Asian trading had been choppy overnight with profit-taking on Japan's Nikkei matched by some cautious yen buying ahead of Upper House elections on Sunday. The elections are expected to strengthen the hand of Prime Minister Shinzo Abe and his radical stimulus strategy, with his ruling Liberal Democratic Party (LDP) and its New Komeito Party (NKP) coalition partner expected to win resoundingly. Some economists worry that if the LDP wins outright Abe could sideline economic reforms and prioritize more nationalist policies, though that was not the consensus. "If the LDP-NKP coalition wins control of the upper house and receives a decent mandate for reform, we would remain comfortable with our USD/JPY forecast profile of 103 in 3 months and 105 in 12 months," Barclays Capital analysts wrote in a report. The Nikkei fell 1.5 percent, erasing the previous session's steep rally. The dollar fell 0.2 percent against the yen. In the debt market, the benchmark 10-year U.S. Treasury note was up 10/32, with the yield at 2.497 percent. German Bund futures were flat after earlier touching a session low following the lending changes in China but remained in a holding pattern near the six-week high hit in the previous session. This week's reassurances from Fed Chairman Ben Bernanke have helped beat back lingering concerns about sharp near-term rises in bond yields and reduced volatility in both core and emerging financial markets. Euro zone periphery bonds added to gains on Thursday after the ECB loosened its lending rules, with Portugal's bonds rallying in thin trade after the centre-right government easily defeated a no-confidence vote. G20 Market participants were also eyeing a meeting of Group of 20 finance ministers as it got underway in Moscow for signs of an orchestrated approach to the end of U.S. monetary stimulus, which could help defuse volatility in global markets. The two-day gathering includes many of the emerging economies that have been at the sharp end of the dollar's surge since Bernanke first signalled in May that the Fed would roll back its bond-buying programme. After a steady week for commodities, gold rose 0.8 percent while Brent oil rose 0.2 percent, hovering near a three-month high.