By Fergal Smith

The Canadian dollar strengthened against its U.S. counterpart on Wednesday as hopes for a global economic recovery boosted equity markets and investors shrugged off domestic data showing deflationary pressures.

At 3:07 p.m. (1907 GMT), the Canadian dollar was trading 0.4% higher at 1.3883 to the greenback, or 72.03 U.S. cents. The currency, which notched on Tuesday a near three-week high at 1.3865, traded in a range of 1.3869 to 1.3960.

"The Canadian dollar continues to benefit from a risk-on environment and investor optimism, as stocks and commodities have another solid day," said Michael Goshko, corporate risk manager at Western Union Business Solutions.

U.S. stock markets rose, with the S&P 500 reaching a more than two-month high, as signs of additional economic stimulus raised hopes of a swift recovery from the coronavirus-driven slump.

The price of oil, one of Canada's major exports, was supported by signs of improving demand and a drawdown in U.S. crude inventories. U.S. crude oil futures settled 4.8% higher at $33.49 a barrel.

Canada's annual inflation rate fell by 0.2% in April, the first time it has hit negative territory since 2009, as the coronavirus pandemic slashed energy prices, Statistics Canada said.

"Contractionary inflation pressures are a given when the economy comes to a complete standstill under lockdown measures," said Simon Harvey, FX market analyst for Monex Europe and Monex Canada.

The Bank of Canada thinks there is likely to be downward pressure on inflation once coronavirus-related shutdowns are lifted, Deputy Governor Timothy Lane said, a sign the bank is in no rush to raise near-record-low interest rates.

Since March, the central bank has slashed interest rates to near zero and begun for the first time a large-scale bond-buying program.

Separate domestic data showed that wholesale trade decreased by 2.2% in March from February, which was a smaller drop than analysts had expected.

Canadian government bond yields were mixed across a flatter curve, with the 10-year down 2.2 basis points at 0.570%.

(Reporting by Fergal Smith; Editing by Nick Zieminski and Leslie Adler)