NEW YORK — For an idea of how a presidential election will go, you could do a lot worse than look at the stock market.

It has a record of prescience that is hard to exaggerate. Since 1928, U.S. equities have correctly signaled who will win, incumbent or challenger, 19 out of 22 times, data compiled by Strategas Research Partners LLC and Bloomberg show. When stocks are higher in the months before a vote, the sitting party has won 86 percent of elections.

People can differ on why, but to most analysts it’s a matter of influence flowing from the economy to the market and into the minds of voters. With the S&P 500 Index at a record, that’s good news for Hillary Clinton – though a lot could still go wrong in the market before November. The rally is getting old, for one thing, and some analysts wonder if Federal Reserve stimulus has made stocks a less reliable signal of economic health than they were in the past.

“The market is somewhat a mirror of the economy and the incumbent is at an advantage when it’s relatively healthy,” said Crit Thomas, senior investment strategist at Touchstone Investments in Cincinnati, where the firm oversees $15 billion. “But there are always circumstances where the market could say one thing and not have the impact it suggested in the past, relative to the elections.”

To be sure, the reputation of markets in handicapping politics took a beating in June, when stocks around the world soared prior to the U.K. referendum only to fall the most in seven years when voters chose to secede. After climbing within points of a record on June 23, U.S. stocks lost 5 percent in the two days after.

Of course, that was quickly forgotten, and political handicappers are again faced with the S&P 500 at an all-time high with its enviable prescience in picking presidential winners. The signals proved accurate in the last eight elections, including 2008, when a five-quarter equity retreat preceded Barack Obama’s victory, and 2012, when stocks rose in four of the five months before he was sent back to the White House.

The stock market has proven nothing if not resilient heading into the election year. Over 10 months, it has dodged and weaved its way through two separate 10 percent corrections and the Fed’s first interest rate increase in almost a decade. Helping propel the advance have been government reports showing strength in the services sector and hiring. A gauge that measures how much U.S. economic data is exceeding forecasts increased to the highest level since 2014 last week.

Consistent with the historical precedent, Clinton’s prospects have mirrored fluctuations in the stock market for the last eight months, a period when the two lines moved with an 84 percent correlation, according to Bianco Research LLC. Using election odds compiled by the PredictIt option site and the level the S&P 500, both peaked in November and bottomed out in February,.

Republican challenger Donald Trump’s prospects have been less correlated, a fact that may be attributable to his longer odds in a multicandidate primary during most of that period. While the Republican’s chances have almost doubled to 33 percent since November, his correlation with the S&P 500 is only 10 percent.

“The chart is basically treating Clinton as an incumbent and arguing that the economy is strong enough for her to get elected,” said Daniel Clifton, head of policy research at New York-based Strategas. Still, “the stock market will become a much better barometer in the last three months of the elections than it is today.”

Using economic proxies to forecast politics might have worked in the past but it won’t this time, according to Goldman Sachs Group Inc. analysts led by U.S. political economist Alec Phillips. More important in 2016 is how primed the electorate is for change, something that can be divined from things like GDP, the sitting president’s approval rating and how long his term has lasted, they wrote.

Moreover, those hoping to use equities as a thermometer should be aware that the stock market has rarely been as divorced from the economy as in the last seven years. Helped along by near-zero interest rates, the S&P 500 has returned 3.7 percent a quarter on average since March 2009, compared with a 0.9 percent gain in gross domestic product. That gap is the widest since World War II.

“I’m not sure past correlation means much in this type of environment,” said Hank Smith, who helps manage $8 billion as chief investment officer at Haverford Trust Co. in Radnor, Pa. “Regardless of your age, no one living today has seen an election like this, like no one living today has seen monetary policy like we’ve had in the past handful of years.”

Even if you buy that the market is smiling on Clinton, much could still go wrong. While it’s good news for Democrats that equities shook off 13 months of torpor and set a fresh high last week, there’s still five months to go before Election Day. The bull market is aging – at nearly 2,700 days – it has outlasted all but one rally in U.S. history. Significant portions of the bear case on stocks rest on this fact alone.