Stocks should peak in the first half of next year but then turn volatile as the market begins to sniff out a recession, according to Morgan Stanley strategists.

But first, they expect more strong gains after 2017's "absurdly good" returns.

Morgan Stanley chief equity strategist Mike Wilson has expected the S&P 500 to reach 2,700 before selling off in a sharp correction, but now he expects the S&P to go higher to peak at 2,750. The S&P 500 was trading just around 2,600 Monday, a gain of 16.2 percent for 2017.

While they do not expect a recession next year, the Morgan Stanley strategists expect the stock market to begin discounting one that could come in 2019.

"On that note, credit markets may be topping now which tends to be a good 6-12 month leading indicator for stocks," the strategists wrote. Stock traders have recently been watching high yield debt, or junk bonds, which sold off earlier this month, sending a warning for other risk assets. But the market has since steadied.

They are not calling for the end of the cyclical bull market yet, but the odds of that happening are higher next year.

"We expect volatility to finally pick up in a more sustained manner as growth decelerates and financial conditions tighten," the strategists wrote. "We would be very surprised if we don't return to a more normal environment and witness at least one if not several 10 percent plus drawdowns next year." In 2017, they noted, there was just one 3 percent drawdown, tied with the smallest sell-offs in the past 38 years.

The Morgan Stanley strategists said the stock market has yet to see the "full-blown euphoria" they called for in the beginning of the year, and the final missing ingredient to bring the bull market to an end could be new flows from retail investors.

"We suspect that could happen in early 2018 with the signing of a tax bill," said the strategists. Separately, other analysts have said they see anecdotal signs of individual investors gaining confidence in stocks and making more investments.

"Our new year end 2018 base case price target for the S&P is 2,750 and we would not be surprised if we reach that target during 1H2018 and it marks the high for the year," they wrote.

The analysts said they believe the economy and stock market are in a late-cycle environment.

"Late cycle is not bearish for equities but it does eventually turn into a recession," they noted, adding when the stock market begins to expect one there would be narrower breadth and bigger sell-offs.

Morgan Stanley credit strategists, meanwhile, said they expect the yield curve to flatten all the way by the third quarter. Currently, the spread between the 2-year note yield and 10-year note yield is 58 basis points.

A flat curve is viewed as a precursor to an inverted curve, meaning the 2-year yield would rise above the 10-year yield. An inverted curve historically can foreshadow recession.

Morgan Stanley strategists point out that over the last 40 years, the yield curve between the 2-year notes and 10-year notes has fallen below 5 basis points six times. In five of those episodes, a recession followed 10 to 24 months later.

For now, Wilson and the stock strategists recommend overweighting pro-cyclical late-cycle sectors such as energy, technology, industrials and financials. They are underweight defensive names in staples, telecom and REITs, as well as consumer discretionary. They recommend exposure to both value and growth and prefer small- and mid-caps to large-cap stocks.