What could derail the stock-market rally?

The U.S. stock market feels as though it is made out of Teflon, with virtually nothing able to disrupt its climb to record levels.

The broad S&P 500 index , which on Friday closed at a record for the 49th time this year at 2,575.21, has sailed through 350 trading days without a 3% pullback, rising weeks and months on end to a 15% gain since the start of the year.

According to Bespoke Investment Group, "2017 is tied for the fifth most closing highs on record, dating back to 1929.

"Provided we don't see any major pullbacks, with two months left in the year, there's the potential for more," they said.

Maris Ogg, president at Tower Bridge Advisors, said given the favorable economic background globally, the market could continue to climb for another couple of years, let alone a couple of months.

"We are seeing strikingly positive news coming out of Europe but it's not yet an inflation-inducing growth, as there are still a lot of unemployed people," Ogg said. "We are not likely to see inflation until their labor market is tight, as there is still a lot of slack."

Certainly, markets can get spooked by geopolitical events, but recent history suggests it would take a major catastrophe to move prices meaningfully.

Another positive for the market is the lack of euphoria seen at final stages of the bull market. Despite records and elevated valuations, investor surveys show that high enthusiasm levels came down over the past few months.

Stock-market bubbles tend to form when euphoric investors bid up prices to unsustainable levels, as happened in late 1990s during the tech boom.

According to Yale Professor and Nobel Laureate Robert Shiller's weekly gauges of both retail and institutional investor sentiment turned decidedly less bullish after peaking in July, as seen from the chart below from Bespoke:

"We are getting more calls from our clients asking us whether they should sell their stocks rather than buy them, because they are scared. This is not what you normally see at market tops," Ogg said.

So, if the outlook for earnings growth is positive given the improving global economy, what risks are out there for stocks? Ogg suggests the danger lurks in a sudden drop in profit margins.

According to FactSet, third-quarter net profit margin so far has edged only slightly lower compared with profit margins in the third quarter last year. On absolute terms, however, a net profit margin at 9.5% is close to the record.

Historically, net profit margins tend to peak along with the stock market, as seen in the chart below. Profit margins remain stubbornly near their highs.

"We are seeing a modest uptick in hourly earnings, so wage pressure is building up. Businesses are now faced with either paying higher wages, replacing them with robots or outsourcing where labor is cheaper. And businesses will figure this one out," Ogg said.

Over the short term, analysts say a potential correction trigger could come in the event of disappointment in one of the so-called FANG stocks: Facebook, Inc.(FB), Amazon.com Inc.(AMZN), Netflix Inc.(NFLX) and Google parent Alphabet Inc. (GOOGL).

The coming week will be among the heaviest for earnings season, with 189 S&P 500 companies and 12 of 30 Dow components reporting quarterly results, according to FactSet. Both Amazon and Alphabet are set to report, Apple's earnings are due on Nov. 2.

Investors should be paying close attention to those highflying stocks, as outsize gains so far this year makes them vulnerable to disappointments.