TORONTO -- Major North American stock markets rose before flatlining at the close, after a speech from the U.S. Federal Reserve offered little indication as to when the bank will hike interest rates.

Citing positive economic data, Fed chair Janet Yellen said the central banking system is moving in the direction of higher interest rates but offered no hint as to when that would happen.

Stock markets in Toronto and New York made gains in the morning following the speech, with the Toronto Stock Exchanges's S&P/TSX composite index soaring more than 100 points.

But at the close, the S&P/TSX composite index advanced 9.16 points at 14,639.88.

In New York, the Dow Jones industrial average fell 53.01 points at 18,395.40 and the broader S&P 500 composite index dropped 3.43 points to 2,169.04, while the Nasdaq composite increased by 6.72 points to 5,218.92.

"The speech from Janet Yellen ... was the biggest thing moving the market today," said Steve Belisle, a senior portfolio manager of equities at Manulife Asset Management.

Belisle said he was surprised to see that reaction as there was no dovish surprise from the speech. Later, it seemed investors adjusted and the markets gave up some of those gains, he added.

Stock markets and the loonie had barely moved Thursday in anticipation of Yellen's speech Friday at the central bank's annual summer symposium in Jackson Hole, Wyo.

A rate hike is possible at the Fed's next policy meetings in September, November and December. Belisle said the majority of investors expecting a raise in the rate before the end of the year.

But without a clear timeline, markets "will remain somewhat volatile," he added.

The Canadian dollar, meanwhile, was down 0.44 of a cent at 76.92 cents US.

Belisle said if the markets interpreted Yellen's comments as more hawkish, that benefited the U.S. dollar.

"Most global currencies are down against the U.S. dollar," he said.

"So (the) Canadian dollar is just caught in that wave today."

The October crude contract rose 31 cents at US$47.64 per barrel.

Elsewhere in commodities, the December gold contract advanced US$1.30 to US$1,325.90 an ounce, October natural gas went up 2.8 cents to US$2.91 per mmBTU and September copper contracts remained relatively unchanged.

With files from the Associated Press