It's been a remarkably calm year for the stock market. Did an alarm just go off?

Stocks have risen to records this year, buoyed by steady growth in the U.S. economy, improvement in formerly struggling international economies and a resurgence in corporate earnings.

But in August the market hit a speed bump: Stocks took two weeks of losses as investors worried about rising tensions between the U.S. and North Korea, terrorist attacks in Spain, mounting challenges to the Trump agenda of tax cuts and infrastructure spending, and poor results from some big-name U.S. retailers.

In historic terms, the market's losses over those two weeks weren't huge. Still, it was the worst period for the market this year, and the Chicago Board Options Exchange's volatility index, a measurement of how much volatility investors expect to see, reached its highest level in months.

"If we see further spikes in volatility that will not surprise us," said Joe Davis, chief global economist for Vanguard. "The headline or the catalyst may, but the ultimate result won't."

While stocks later recovered some of their losses, geopolitical tensions and the effects of Hurricane Harvey continued to weigh on the market after that. And the turbulence comes right before the worst month of the year for stocks: on average.

The current bull market is eight years old, and Wall Street has been debating how much longer it can last. There's little reason to expect another drop in corporate earnings or a recession, and analysts are fond of pointing out that bull markets don't simply die of old age.

"I think the next year or two is going to be a more challenging environment for investors than any time in the last eight or nine years," he said.

Davis is preaching caution because stock prices are at such high levels. He encourages investors to look away from U.S. stocks and put some of their money into other types of assets. He has a more positive view of stocks in non-U. S. markets, which in general are less expensive than U.S. equities. He also feels investors should diversify by adding government bonds and other low-risk assets to their portfolio.

These days, stocks and bonds practically move in opposite directions. That makes bonds a good way to diversify.

Like many market watchers, Davis thinks it's inevitable that this calm period is going to end. Whether that happens next week, when many traders return from summer vacation, or later on, Davis suggests investors prepare now.

Marley Jay writes for the Associated Press.