Stocks could pop nearly 20 percent in 2018 according to a contrarian indicator from Bank of America Merrill Lynch which predicted last year's surprising surge.

The investment bank's so-called Sell Side Indicator measures the average equity allocation recommended by its fellow Wall Street bank peers. The indicator shows Wall Street is still not very bullish on the market at all and until strategists recommend clients own even higher levels of stocks, the market will continue to gain.

"Historically, when our indicator has been this low or lower, total returns over the subsequent 12 months have been positive 93 percent of the time, with median 12-month returns of 19 percent," according to a BofA Merrill Lynch Global Research report.

In September 2016, the metric predicted a huge positive return over the next 12 months, a forecast that eventually came true and stood in contrast to the sentiment on Wall Street at the time. Now in early 2018, the model still remains upbeat.

2018 "could be the year of euphoria. Sentiment is now a more important driver of the S&P 500 than fundamentals, and sentiment suggests there is still room for stocks to move higher in the near term," wrote BofA Merrill Lynch strategists in the 2018 outlook press release in December.

To be sure, this indicator is only one input in Bank of America's bigger forecast model. Officially the bank predicts just a nearly 5 percent rise in the S&P 500 to 2,800 this year.

The strategist's target is just below the median 2,850 forecast of 13 other equity strategists surveyed by CNBC. That median projection is modest in comparison to the roughly 20 percent climb for the S&P 500 in 2017.

"We think euphoria is what's going to end this bull market and we're not there yet," Savita Subramanian, the bank's chief U.S. equity and quant strategist, told CNBC in December. "We're not at the point where the investment community is saturated in equities and there's nothing to do with stocks but sell."