TORONTO - Weakness in the industrials and energy sectors pushed Canada's main stock index lower Wednesday despite gold futures hitting a new six-year high.

The precious metal pushed the key materials sector up 2.2 per cent. Its price surged $5 after the Federal Reserve reiterated that it wasn't seeing any increase in the U.S. economy, reinforcing expectations of an interest rate hike later this month.

“It was generally going positive but then the beige book came out and put a little extra boost underneath it,” said Michael Currie, vice-president and investment adviser at TD Wealth.

The August gold contract was up US$12.10 at US$1,423.30 an ounce and the September copper contract was up 1.6 cents at US$2.72 a pound.

Nonetheless, the S&P/TSX composite index closed down 18.21 points at 16,484.21 after hitting an intraday low of 16,469.02.

It was the second straight day of losses as Aimia Inc. fell 5.5 per cent amid internal and legal turmoil at the loyalty program company. Shares of Canadian National and CP Rail declined after U.S. rival CSX Corp. cut its revenue outlook for the year after reporting weak second-quarter financial results after markets closed Tuesday.

For Calgary-based CP, the decrease came a day after the railway hit an all-time high after it beat analyst expectations by posting record second-quarter revenues and net income jumped more than two-thirds to $724 million.

The key energy sector was down 1.3 per cent with Encana Corp. falling by almost four per cent after the price of crude oil decreased for a second day.

The August crude contract was down 84 cents at US$56.78 per barrel and the August natural gas contract was down 0.2 of a cent at US$2.30 per mmBTU.

Several factors contributed to the dip in crude prices.

A larger-than-expected decrease in U.S. crude stockpiles was more than offset by a large buildup in refined inventories such as gasoline, which attracts a little more focus during the summer driving season, Currie said in an interview.

Although Tropical Storm Barry was less severe than predicted, more than half of daily crude production in the Gulf of Mexico remained offline as of Tuesday.

And hope of a breakthrough in geopolitical issues in the Middle East was dashed by Iran denying it was willing to negotiate over its ballistic missile program.

“You've got the storm, you've got Iran and you've got the stockpiles, so a lot of things moving oil around today but a second day of a mini-slump,” added Currie.

Health care gained on a rebound of some cannabis producers, including Aurora Cannabis Inc..

In New York, the Dow Jones industrial average was down 115.78 points at 27,219.85. The S&P 500 index was down 19.62 points at 2,984.42, while the Nasdaq composite was down 37.59 points at 8,185.21.

The markets fell on mixed earnings results and comments from U.S. President Donald Trump again threatening to put another US$325 billion of tariffs on Chinese imports.

That pushed the U.S. dollar lower as the Canadian dollar traded for an average of 76.61 cents US compared with an average of 76.62 cents US on Tuesday.

In addition, Canadian inflation fell in June to two per cent from 2.4 per cent in May following a sharp drop in gasoline prices.

“That's still pretty healthy and doesn't seem to indicate any recessionary situations going on just yet.”