The first quarter is on track to be the best in nearly 10 years, and the best start to the year for the S&P 500 since 1998. While it's not likely to repeat those gains, analysts say the second quarter could be good for stocks even with some bumps.

The 12.3 percent first quarter gain so far is the best for any quarter since the third quarter of 2009, right after the bull market began. According to analytics firm Kensho, the S&P has risen by more than 10 percent in the first quarter just four times since 1990, and in those years, the S&P traded higher for the rest of the year, averaging a gain of 10.3 percent over the remaining quarters.

The small cap Russell 2000, up 13.8 percent, was also in line for its best start of the year since 1991. The Dow's 10.2 percent gain was its best start for the year since 2013, and the Nasdaq was on track for its best first quarter since 2012.

This year's first quarter certainly benefited from an oversold bounce back, after the fourth quarter's dramatic, near 14 percent slump, so some analysts say the second quarter could be higher, but not by nearly as much.

Source: Bespoke

Hurdles for the market are the unresolved U.S.-China trade talks; earnings growth of zero or lower, and a slowing global economy, led by China. Global growth fears have been building over the first quarter amid spotty U.S. economic news, like February's anemic jobs gains of just 20,000, a tenth of what was expected.

Those fears are part of what has been driving sovereign debt yields lower, unsettling global equity markets. German bund yields returned to negative levels last week, and the U.S. yield curve inverted, a recession warning.

"I think choppiness is expected just because there will be volatility around the numbers and external developments, but that's not the same as not performing," said Luke Tilley, chief economist at Wilmington Trust. "If our base line view of improving economic data and also of some trade deal plays out, along with some better growth out of China, we do expect that to be a help to the equity markets in the second quarter but not at the rate of the first quarter."

Tilley expects the U.S. and China to reach a trade deal this year, and he blames trade for much of the market weakness in the fourth quarter. The two sides have been negotiating with some slight signs of progress. Many economists believe the second half of the year will see better growth, but the outcome of the trade situation is a key to both the economy's performance and the market's.

"Bad days in the trade situation were bad days for the market and the opposite was true, too. These are the world's two largest economies. If they are able to strike a deal, that takes away the threat, and that's a positive for markets," said Tilley. "It's more likely to happen in the second quarter, but as we've seen, the nitty gritty details are challenging."

Markets have been focusing on the theme of slowing global growth, and for the past week those concerns have been playing out in the bond market, with yields reaching the lows of the year. The U.S. Treasury yield curve also inverted, or short term rates, in this case the 3-month, fell below the 10-year rate, typically a reliable sign that a recession is coming.

At the same time, the markets have written off the Fed and believe after its last meeting it was signaling an even more dovish tone. In response, the futures markets are now pricing in rate cuts for this year and next, and the bond market underwent a massive readjustment with rates falling to more than one year lows. The move in the 2-year note yield, for instance, was the biggest such decline in six days since the financial crisis in 2009.

"All the work that we have ever done on this kind of [stock market] turnaround tells you that there's a very strong probability that stocks are going to go higher looking out towards year end," said Julian Emanuel, head of equities and derivatives at BTIG.

Emanuel said he expects to see 3,000 on the S&P 500 by year end, but he says there could still be a correction that could take the S&P as low as 2,600.

"For the time being, we're in a consolidation phase," said Emanuel. "German yields slipping below zero tells you the depressed psychology is more entrenched than what you might have been expecting at this point."

Emanuel said the U.K.'s struggle to find a Brexit plan to leave the European Union could come to a head in the next several weeks, and there's a chance it could be a negative for stocks if it does not go well. Europe's economic weakness "is literally one of the two or three largest risk markets to the U.S. market in much the same way that the China weakness flowed into U.S. equities in the fourth quarter of 2018. The European weakness is flowing into our bond market," he said.

Bespoke data shows that the second quarter historically has been the second worst performing, but in the past 10 years, it has lagged the others, gaining 1.4 percent.

Source: Bespoke

But Bespoke also notes that when the S&P has gained more than 5 percent in a quarter, followed a quarter with a sharp decline of 10 percent or more, like this year's first quarter, the subsequent quarter was then higher most of the time with an average gain of more than 9.6 percent.

There have been 10 such instances since 1970, and in all but two, the follow up quarter, which in this case would be the second quarter, were all positive.

Another case can be made for a positive second quarter performance when studying the performance of the market after a decline of 10 percent or more. According to Bespoke, before last year's fourth quarter, there were 19 such quarters since World War II, and a year after those quarters, the S&P was up an average 15.9 percent. The market was also mostly higher two quarters later, for an average gain of 11.3 percent.

Source: Bespoke

The S&P 500 has been testing both sides of 2,800 and ended Thursday at 2,815. Emanuel said the market is not out of the woods yet, after the S&P 500 recently peaked at 2,860.

"We're for the moment in one of those paradigms where low rates are looked at as a risk factor rather than a tailwind," he said.

Emanuel said both Brexit and China trade talks could result in a move either way in the market.

"Geopolitical issues, Brext and the trade deal with China, investors have become numb to the constant barrage of news on both fronts because there have not been any developments of substance. It's all just noisy back and forth," Emanuel said. "The minute investors see something out of either of those things that they perceive to be substantial developments, markets will react."

Source: Bespoke