Just when you thought it was safe to go back in the stock market.

If you’re an investor who was lulled to sleep by the market’s calm, steady gains this summer, you’re wide awake by now. Stocks have swooned over the last three weeks as investors worried about a sea of troubles, including rising interest rates and the trade tensions between the U.S. and China. Both could impair profit growth for U.S. companies.

The S&P 500 index has plunged 9.4 percent in just three weeks, with two separate six-day losing streaks. It hadn’t had a streak of losses that long since November of 2016. With five trading days left in October the index is on track for its worst month in a decade.

Another loss Thursday will likely push the index into what Wall Street calls a “correction” — a drop of 10 percent or more from the latest high.

For market favorites like technology and consumer-focused companies it’s been even worse. As of Wednesday’s close, five of the six most valuable U.S. companies had suffered a correction: Amazon, Microsoft, Alphabet, Berkshire Hathaway and Facebook are all down sharply from their recent highs, although some of those declines began this summer.

The VIX, an index called Wall Street’s “fear gauge” because it measures how much volatility traders expect, is the highest it’s been since February.

The current skid for stocks is the third big swoon for the markets this year. The first was a dramatic downturn in late January and early February, when the S&P 500 lost 10 percent in just nine days as worries about a sharp slowdown in China’s economic growth rattled markets around the world. That was followed by a less severe stumble in March.

But more recently stocks had been placid. Between late June and early October, the market didn’t rise or fall as much as 1 percent in a single day. That was similar to the gains stocks made in 2017, when the market drifted higher gradually and finished up 19.4 percent.

Soaring corporate profits, fueled by sweeping corporate tax cuts, powered the market’s recovery this spring and summer. S&P 500 companies delivered second-quarter earnings growth of 25.2 percent, well ahead of forecasts. That helped send the S&P 500 to a new all-time high in September, erasing the losses from its “correction” in February.

But now doubts are emerging that a similar surge in earnings growth will rally markets out of their latest skid.

Companies began reporting their results for the third quarter last week. And while earnings growth for S&P 500 companies is expected to be around 22 percent, according to S&P Global Market Intelligence, some companies are painting a less-than-rosy outlook.

Several big companies, including AT&T and United Parcel Service, have reported earnings or revenue this week that fell short of expectations. And some company executives are warning of rising costs related to the U.S.-China tariffs and inflation.

The absence of a tax-cut boost and the likelihood of higher interest rates, which can raise borrowing costs for businesses, are also giving investors reasons to worry that company earnings growth will slow.

That likely means more volatility for stocks.

“The ability to repeat what we had this year is not going to happen,” said Terry DuFrene, global investment specialist at J.P. Morgan Private Bank. “We all agree about that.”

© The Associated Press. All rights reserved.