It took Apple’s best week in almost five years, but the S&P 500 Index overcame the wildest five days since Brexit to eke out a gain amid swings that at times seemed sure to end in grief for bulls.

While the gauge hasn’t recovered from the 2.5 per cent rout last Friday, stocks did manage to hold above a closely watched technical level on charts, a victory some analysts say lays the foundation for more strength.

Volatility resurfaced in global markets as central banks signalled they are rethinking the approach to the monetary stimulus that bolstered stocks for the past half decade.

The Federal Reserve’s looming rate decision and a rout in oil kept investors on edge amid data that did little to clarify the economy’s strength. Rampant demand for Apple’s latest iPhone salvaged the week in a sign that consumers remain ready to spend paychecks that have started to get bigger.

“In front of important central bank meetings next week, the volatility isn’t surprising -- it just comes in such contrast to what we saw in July and August, where we were lulled into this low-volatility environment,” said Eric Wiegand, senior portfolio manager at the Private Client Reserve of US Bank in New York, which oversees US$128 billion.

“But overall, not a tremendous amount has changed. Expectations may be moderating a bit, but the backdrop hasn’t seen either a material deterioration or improvement.”

The S&P 500 rose 0.5 per cent to end the five days at 2,139.16. Along the way, the equity index notched three moves of at least 1 per cent after going 43 days through September 8 without one. The CBOE Volatility Index swung at least 10 per cent on three days, the most in any week since the Brexit vote.

Technical support for stocks also may have played a role in the S&P 500 closing positive on the week. In three separate instances of selling, the benchmark bounced higher after dipping below its average price for the last 100 days -- roughly 2,121.

The outcome would’ve been different without Apple. The S&P 500’s biggest component rallied 11 per cent in the five days, the most since October 2011, to add more than $63 billion in value amid a surge in demand for the new iPhone. Apple alone added 7 points to the benchmark gauge.

Befitting the world’s largest company, its rally spread to a raft of suppliers.

Chipmaker Skyworks Solutions Inc. jumped 14 per cent for the biggest advance in the S&P 500, while Qualcomm jumped 4 per cent. The technology group climbed 3 per cent in the week, most among the 10 major industries.

Energy shares weighed on the market. Oil and gas companies declined 2.9 per cent, the biggest weekly loss since May, as crude oil lost 6.2 per cent to $43.03 a barrel, hurt by a rally that took the dollar to its highest level since July. Just four of the 37 companies in the group advanced, with Range Resources Corp. and Marathon Oil Corp. sliding at least 9 per cent.

“Oil and commodity companies have been moving and that also is related to rate hike fears,” Anna Rathbun, director of research for CBIZ Inc.’s retirement-plan services unit in Cleveland, said by phone. “They’re intricately related to the value of the US dollar -- if the Fed raises rates, the dollar follows and commodity prices are poised to fall.”

Economic data from retail sales to jobless claims and consumer sentiment did little to change traders’ expectations for interest rates throughout the week. Chances of a hike at next week’s Fed meeting held near 20 per cent, according to Fed funds futures.

In corporate news, Wells Fargo & Co. slid 6.8 per cent amid controversy surrounding alleged fraud at the company. Intel Corp. surged 6.3 per cent to the highest since December 2014 after the chipmaker raised its revenue forecast.

“The US is the best house in a bombed-out neighbourhood,” David Kelly, chief global strategist at JPMorgan Asset Management, said in a phone interview. “The market corrects for no particular reason, people expect bad news to confirm it, and when there isn’t, they don’t want to miss buying the dip.”