Canada’s main stock index ended the week on a positive note with investors taking on a defensive posture out of concern about the possibility of a further selloff to come.

Consumer staples, real estate, utilities and telecommunications sectors were the winners Friday as all but two sectors on the Toronto Stock Exchange gained on the day.

The health-care sector fell the most at 3.46% as cannabis stocks lost ground for a third-straight day since legalization. It was followed by technology which lost 1.65%.

There was a defensive tilt to the trading on both sides of the border, said Ian Scott, an equity analyst at Manulife Asset Management.

“What kind of stands out for me is the breadth of the defensive,” he said in an interview.

More than 90% of Canadian staples, real estate and utilities stocks were up on the day.

The S&P/TSX composite index closed up 65.97 points to 15,470.10, after reaching a high of 15,579.83 with 245.8 million shares traded. The market gained 55.81 points on the week.

The market rose even though Canadian economic data on August retail sales and inflation missed expectations.

In New York, the Dow Jones industrial average was up 64.89 points to 25,444.34 while the Nasdaq composite lost 36.11 points to 7,449.03.

The S&P 500 index lost one point to end the week at 2,767.78, slightly below its 200-day moving average.

That portends a potentially weak start to trading next week, said Scott.

“It doesn’t guarantee it but it certainly raises the odds of it,” he said.

“I don’t think I’m alone in thinking that a close below the 200-day moving average to end the week likely decreases the likelihood that you have a market snap back next week.”

He said there’s a debate among investors about whether this is a healthy selloff or something more negative.

“I’m starting to think it’s greater than 50%,” Scott said of further declines.

Investors are assigning various reasons for the market weakness of late. Some are worried about rising interest rates while others point to trade uncertainty, geopolitical risks with Saudi Arabia, Chinese economic weakening, the Italian fiscal situation, emerging markets and the strengthening U.S. dollar.

Despite these concerns, about 84% of U.S. companies reporting so far this quarter have beaten forecasts.

“It’s going to be interesting to see if strong earnings out of the States and hopefully out of Canada as well can provide a boost to the market or if these other concerns continue to outweigh the strong results.”

The Canadian dollar traded at an average of US76.31¢ compared with an average of US76.59¢ on Thursday.

The December crude contract was up US57¢ at US$69.28 per barrel and the November natural gas contract was up US5.2¢ at US$3.25 per mmBTU.

The December gold contract was down US$1.40 at US$1,228.70 an ounce and the December copper contract was up US3.15¢ at US$2.78 a pound.