NEW YORK (Reuters) - The greenback rose to its highest against the euro in more two-years on Wednesday, as investors ploughed more money into the U.S. stock market on growing optimism the economic impact of the coronavirus will be contained.

Slideshow ( 2 images )

China reported its lowest number of new coronavirus cases in two weeks, bolstering a forecast by Beijing’s senior medical adviser for the outbreak in the country to end by April. Still, fears of further international spread remained.

“The market is reasonably confident that China will be able to get control of the virus, although it may take some time,” said Steve Englander, head of global G10 FX research at Standard Chartered in New York.

“The fact that it just doesn’t seem to be as deadly outside of China is something that’s comforting markets,” he added.

All three major U.S. stock indexes notched record closing highs.

Investors also grew more comfortable with risk on the view that central banks are likely to provide increased accommodation if the coronavirus harms the global economy.

On Tuesday, Federal Reserve Chair Jerome Powell told Congress the U.S. economy was in a good place, even as he cited the coronavirus threat and some long-term concerns.

The dollar gained 0.26% against the Japanese yen JPY= to 110.06 yen. The euro EUR= dropped 0.41% against the greenback to bottom at $1.0863, the lowest level since May 2017. It last stood at $1.0873.

The greenback has strengthened against the euro as economic data shows a brighter economic outlook for the United States than the euro zone.

“The U.S. economic data is still superior to other economies’ and the growth gap with the rest of the world remains substantial,” said Ugo Lancioni, portfolio manager of the Neuberger Berman Macro Opportunities FX Fund.

Political uncertainty in Germany is an additional headwind for the single currency.

Annegret Kramp-Karrenbauer, leader of Chancellor Angela Merkel’s Christian Democrats, on Monday confirmed she would not run for chancellor in next year’s federal election, but said she would remain party chair until another candidate is found.

The New Zealand dollar NZD= jumped to a one-week high after the central bank removed the chance of a rate cut from its forward projections.