TORONTO — Canadian stocks headed for the worst annual loss in four years mired in a three-day losing streak, as the resource-rich nation’s benchmark equity index sank amid a global retreat in commodities from crude to gold.

Energy and materials producers plunged more than 22 percent in the year, dragging the Standard & Poor’s/TSX Composite Index to an 11 percent slump, third-worst among developed-nation markets tracked by Bloomberg. Valeant Pharmaceuticals International Inc. erased 60 percent of its value in the final five months of the year. Bombardier Inc. plunged 69 percent as the struggling aircraft manufacturer changed chief executives and accepted a bailout from the Quebec government.

There were precious few places to hide this year for Canadian investors. A combination of slowing growth in China and Europe, a glut in crude supplies and a plunge in the nation’s currency amid rising interest rates in America sent energy and raw-materials producers tumbling. The two industries account for about 28 percent of the benchmark gauge. The rout in commodities damped profits at industrial companies that supply the industries, while financial services firms faltered amid poor equity returns.

“The perfect word to describe Canada this year was vomitous,” said Barry Schwartz, chief investment officer at Baskin Wealth Management in Toronto, in a Dec. 29 interview. His firm manages about C$840 million ($605 million). “Investors threw up and threw out everything to do with Canada. It was toxic. A yearlong virus that nobody wanted to be attached to. Join the club if you had a negative year because pretty much everybody did in Canada.”

The S&P/TSX suffered through an eight-day selloff that was the longest since June 2002. Its return was better than only Singapore and Greece among developed markets.

Of the 240 members in the index only about a third posted gains for the year. Top-performing stocks included recent entrants Kinaxis Inc. and Uni-Select Inc., which were added to the index as late as December.

Canada’s economy is closely linked to Maine’s. More than 40 businesses in Maine have Canadian parents including some of the state’s biggest players such as Irving, one of Maine’s largest landowners with more than 1 million acres. It also operates a sawmill in Ashland, a paper mill in Fort Kent and a string of gas stations throughout the state. Other major Canadian companies with significant holdings and investment in Maine are Cooke Aquaculture, which holds most of Maine’s aquaculture licenses; Catalyst Paper Corp., which operates a paper mill in Rumford; SunLife Financial, which just opened a processing center in Scarborough; and McCain Foods, which harvests, processes and distributes potato products.

Additionally, Maine exported nearly $1.5 billion to Canada in 2014, making it by far the state’s largest trading partner.

REBOUND IN 2016?

The breadth of the decline and a drop in equity valuations have Canadian equity strategists predicting a rebound for the gauge in 2016. The price-to-earnings ratio for stocks in the S&P/TSX has declined 11 percent to about 20.2 from a 2015 high of 22.7 in April, according to data compiled by Bloomberg.

“Canada is down, but not out,” said Brian Belski, chief investment strategist at BMO Capital Markets. He forecasts the index to reach 15,300 next year, implying a gain of about 15 percent from current levels. “In 2016 Canada will surprise by outperforming the U.S. for the first time in six years,” Belski said in a note to clients on Dec. 15.

Vincent Delisle, portfolio strategist at Scotia Capital, predicts a more modest rally for the S&P/TSX, to 14,200, as resource and cyclical stocks in Canada and emerging markets recover at the same time U.S. equities underperform.

Many top performers this year benefited from the U.S. market as the Canadian dollar weakened. Consumer stocks such as beverage maker Cott Corp. and gas-station-chain operator Alimentation Couche-Tard Inc. were among the few bright spots, with gains of more than 27 percent. Technology companies Constellation Software Inc. and Descartes Systems Group Inc. added at least 66 percent.

Stefane Marion, chief economist and strategist at National Bank Financial Inc., estimates the index will climb to 15,000 by the end of next year as earnings growth in non-resource sectors and job creation in central Canada and British Columbia help offset weakness in the oil patch.