By Fergal Smith

TORONTO (Reuters) - The Canadian dollar strengthened to a near seven-week high against the greenback on Monday after a U.S.-China trade deal that could boost the global economy, but the currency gave up much of its gains as investor optimism was kept in check.

At 3:47 p.m. (2047 GMT), the Canadian dollar <CAD=D4> was trading 0.1% higher at 1.3160 to the greenback, or 75.99 U.S. cents. The currency, which rose 0.6% last week, touched its strongest intraday level since Oct. 30 at 1.3115.

"I think, this morning, loonie buyers bought the hype from over the weekend," said Erik Bregar, head of FX strategy at the Exchange Bank of Canada. "As the day goes on, you are starting to see a little bit of doubt re-enter the picture."

On Sunday, U.S. Trade Representative Robert Lighthizer said that a "phase one" trade deal between the United States and China reached on Friday was "totally done" despite the need for translation and would nearly double U.S. exports to China over the next two years.

While U.S. officials have touted the deal, Chinese officials have been more cautious, emphasizing that the trade dispute has not been completely settled.

Canada is a major exporter of commodities, including oil, so its economy could benefit from an improved outlook for global trade. U.S. crude oil futures <CLc1> settled 0.2% higher at $60.21 a barrel.

Canada's budget deficits will be larger than forecast for the next five years, Finance Minister Bill Morneau said in a fiscal update on Monday. That could give Ottawa less room to spend on new initiatives, which is economic stimulus that the Bank of Canada has been anticipating.

The central bank, which has resisted pressure this year to ease interest rates, has pointed to housing activity as a source of resilience in the Canadian economy. Data on Monday from the Canadian Real Estate Association showed that Canadian home sales rose in November for the ninth straight month, up 0.6% from October.

Separate data, from Statistics Canada, showed that foreign investors bought a net C$11.32 billion in Canadian securities in October, led by private corporate bonds.

Canadian government bond prices were lower across a steeper yield curve in sympathy with U.S. Treasuries. The two-year <CA2YT=RR> fell 6.5 Canadian cents to yield 1.694% and the 10-year <CA10YT=RR> was down 47 Canadian cents to yield 1.631%.

On Friday, the 10-year yield touched its highest intraday level in nearly seven months at 1.695%.

(Reporting by Fergal Smith; Editing by Nick Zieminski and Peter Cooney)