* Yen and euro weakened by gains in stocks
* Yen rally vs dollar may be nearing end -analyst
* Oil dips after big gains on Tuesday (Updates prices, adds comment)
By Gertrude Chavez-Dreyfuss
NEW YORK, April 13 (Reuters) - The dollar climbed to a two-week peak against the euro and a one-week high against the yen on Wednesday, as gains in global stock markets and improved export numbers out of China drew investors into riskier bets than low-yielding currencies in Europe and Japan.
The euro and yen have gained strongly against the dollar in recent weeks as investors sought traditional safe havens given a darkening outlook for banks and economic growth, underlined again by downgraded forecasts from the International Monetary on Tuesday.
Softer-than-expected U.S. producer prices and retail sales numbers last month briefly pushed the dollar lower, but Wednesday's dollar uptrend remained intact. weak retail sales and PPI (producer price index) data had virtually no impact on the dollar, and it's probably because there are portfolio flows going into U.S. equities," said Sebastien Galy, currency strategist at Deutsche Bank (DE:DBKGn) in New York. "This is giving the dollar a bit of a bid."
Still the outlook for the dollar stayed weak. After gaining steadily for 1-1/2 years amid U.S. interest rate hike expectations, the dollar has hit a wall and many in the market believes the greenback's long-term rally is on its last legs.
Expectations of a deal to stabilize oil output, and what seems like a bottoming out of expectations for U.S. interest rate rises, have also helped the dollar.
The dollar index was up 0.8 percent at 94.730 .DXY , gaining for the first time in four days.
The euro fell 0.9 percent against the dollar to $1.1284 EUR= . It fell as low as $1.1234, a two-week low. Against the yen, the euro was down 0.3 percent at 123.26 yen EURJPY= .
The dollar, meanwhile, rose 0.6 percent to 109.21 yen JPY= , up from lows of 107.61 hit on Monday.
Valentin Marinov, head of G10 FX strategy at Credit Agricole (PA:CAGR) Corporate and Investment Bank in London believes that the latest yen rally may be running out of steam. He said that the Japanese currency's recent strength reflected concerns about excessive undervaluation.
"These concerns have abated considerably, with dollar/yen now trading closer to its 'fair value' implied by the purchasing power parity or the long-term valuation model." That long-term fair value for the dollar is 105 yen, he added.
On the day, oil was down 1.3 percent and the boost for commodity-reliant currencies such as the Norwegian crown NOK= and Australian dollar AUD= , from Tuesday's jump has faded.
Crude, however, remains well above $40 a barrel, which has allowed all commodity currencies to recover from long-term lows hit in January.