John Templeton, the late investing guru, once said bull markets in stocks “mature on optimism” before they eventually “die on euphoria.”

Chalk up 2017 as another year of maturity for the current bull market -- on a record scale.

Defying speculation 12 months ago that the years-long rally would be sorely tested during President Trump’s first year in office, the stock market has been riding a wave of continued optimism to repeatedly set fresh highs.

Analysts give Trump some credit for the gains, mainly for pushing the tax-overhaul plan passed by Congress last week and reducing regulations. But market trackers give most of the credit to several other factors, including global economic growth, stronger corporate profits, continued low inflation and rising consumer confidence.


(Los Angeles Times )

“Looking at the economy and financial markets, it really doesn’t get much better than where we are right now,” Brad McMillan, chief investment officer at investment firm Commonwealth Financial Network, said in a note to clients last week.

Or, as outgoing Federal Reserve Chairwoman Janet L. Yellen said this month about the economy: “There’s less to lose sleep about now than there’s been for quite some time.”

Threats nonetheless remain, including ongoing political and trade tensions overseas, a possible pickup in interest rates and inflation, and the midterm elections that could change the outlook for stock prices.


But most analysts see nothing on the horizon that would cause the optimism to substantially fade or, conversely, develop into such euphoria as to cause a market bubble that bursts. Many predict that the market -- as measured by the benchmark Standard & Poor’s 500 index -- should enjoy additional gains in 2018.

(Los Angeles Times )

“I expect double-digit returns for the S&P 500 again next year (including dividends) with continued corporate earnings improvement” even though “we may be in store for some turbulence along the way,” Chris Zaccarelli, chief investment officer at investment firm Independent Advisor Alliance, said in an email.

The market’s surge this year has provided a near weekly drumbeat of achievements:


The blue-chip Dow Jones industrial average has set record highs 70 times -- the most times that’s ever happened in a calendar year -- as it has gained nearly 5,000 points, or 25%, while closing in on 25,000. It ended the week at 24,754.06. The Dow’s top gainers this year have been Boeing Co. (up 90%), Caterpillar Inc. (up 68%) and Apple Inc. (up 51%).

The broader S&P 500 has set record highs 53 times, the most since 1995, as it climbed a hefty 20% to 2,683.34 with a week left in 2017. The index also is poised to be “higher every month this year on a total return basis, with dividends, and that’s never happened,” said Ryan Detrick, senior market strategist at the investment firm LPL Financial.

The tech-heavy Nasdaq composite index also has repeatedly set new highs, and has shot up 29% as it closes in on 7,000. The index closed Friday at 6,959.96.

The gains mean the current bull market -- now 8¾ years old, with a gain of nearly 300% -- is now the second-strongest bull rally since World War II, trailing only the 417% surge between October 1990 and March 2000, according to data compiled by LPL Financial and FactSet Research Systems Inc.

As the market continues setting fresh highs, Trump has kept touting the mileposts as evidence that his economic agenda is bearing fruit. Last Monday, for instance, Trump said on Twitter: “We have NEVER had 70 Dow Records in a one year period. Wow!”

(Los Angeles Times )

The tweet was no surprise to Jim Paulsen, chief investment strategist at Leuthold Group, who said that when markets are rising, “that’s the way every president handles the situation, and Trump is doing it no differently” even if Trump is using the more novel method of social media.


“As far as him taking credit, that’s what every president does,” Paulsen said.

Paulsen also said it was unlikely that the tax bill would generate significant added gains for stock prices because “it’s already baked into [investors’] expectations.” Anticipation of the bill, especially its cut in the corporate tax rate to 21% from 35%, “has been around for quite a while now and well-vetted by the market,” he said.

A variety of other factors has been driving equity prices higher this year.

Economies worldwide have shown growth and “this is the first year since 2010 that you had positive growth from the U.S., the emerging markets and the developed markets like Europe and Japan” all at once, Detrick said. “It suggests the overall global economy is on firm footing and expanding.”


That has been reflected in foreign stock markets as well, with major indexes in Hong Kong, India and Brazil showing even stronger gains than the S&P 500.

In the United States, corporate earnings — always a key factor in stock prices — have continued to swell and the gains have kept stocks from becoming wildly expensive, analysts said.

The S&P 500 is now trading between 18 and 19.5 times its companies’ average trailing earnings for the last 12 months, which is well above the historical average of 15.5 but not a bubble-type valuation.

Inflation and short-term interest rates have remained relatively low. The Federal Reserve Board has lifted its key short-term rate by a full percentage point during the year, but to a still-low target range of between 1.25% and 1.5%.


The yield on the 10-year Treasury note stands at 2.5%, about where it started the year.

“Increased earnings, restrained inflation and low interest rates” provide the “basis for U.S. stocks to still trend higher,” Terry Sandven, chief equity strategist at U.S. Bank Wealth Management, said in a recent note.

(Los Angeles Times )

Consumer confidence, meanwhile, has risen for five consecutive months and remains at a 17-year high, according to the Conference Board trade group. That bodes well for continued consumer spending.


Even so, investors will have plenty to fret about next year, analysts said.

There is uncertainty about the direction to be taken by new Fed Chairman Jerome Powell, who replaces Yellen in February. A decision to accelerate rate hikes in the face of rising inflation could chill Wall Street. Other possible show-stoppers include ongoing U.S. tension with North Korea and Iran; a Democratic wave in the midterm elections that might pull back some of Trump’s pro-business policies; potential trade disputes as the United States renegotiates the North American Free Trade Agreement, and fears that a sudden sell-off by rapid-fire, computerized program traders could snowball into a major correction of 20% or more in stock prices.

Nonetheless, “I remain optimistic for next year in the face of all of these challenges,” Zaccarelli said.

Alexandra Coupe, associate director for investment firm Pacific Alternative Asset Management Co., or PAAMCO, in Irvine, likewise said in an email “there appear to be ample tailwinds for equity prices heading into 2018” from the positive factors that propelled prices higher this year.


Still, she cautioned, “it is going to be difficult to replicate perfection.”

james.peltz@latimes.com

Twitter: @PeltzLATimes