This is a market driven by happy thoughts, as bears turn bullish and investors who've been betting against stocks turn positive.

What's the fuel that's been driving the December/January rally?

It can't be macroeconomics, that's for sure. The World Bank just cut its forecast for 2012 global economic growth to 2.5% from 3.6%. It sure can't be Europe, where Greece continues to slide toward default while the region as a whole slips into recession.

And it's hard to generate a torrent of optimism from fourth-quarter US earnings. Banks have struggled to beat radically lowered expectations, and more than 40% of the 44 S&P 500 companies that have reported fourth-quarter earnings have missed Wall Street estimates.

So what is fueling this rally?

I think the data make it very clear—it's the conversion of skeptics into, if not optimists, at least market neutrals. It's the changing of short sellers into short coverers, of stock mutual-fund sellers into mutual-fund buyers, and of bearish market gurus into bullish market gurus.

Which, of course, raises this question: What happens when there are no more skeptics? Does this market rally stall when rising share prices have converted too many bears to bulls, and thus removed the biggest source of fuel for this advance?

The Wall Stocks Need to Climb
With the S&P 500 closing at 1,308 on January 18, stocks are once again challenging their summer 2011 highs. Each time, though—on July 21 and earlier on July 6—stocks reached for the April 29 high at 1,364, but failed at 1,344 and 1,339, respectively.

To many investors, this market advance makes no sense. Greece and Portugal look poised for default. The Eurozone is sliding toward recession. Even Germany, the strongest economy in the region, is slowing. On January 18, the German government cut its estimate for 2012 growth to 0.7% from the October forecast of 1%.

China, Brazil, and most of the rest of the world's developing economies are slowing, too—so much so that the World Bank just cut its forecast for global growth.

US growth in the fourth quarter of 2011 looks solid, with something more than 3% possible, but everybody with a subscription to The Economist is predicting a drop in growth in the first quarter of 2012.

But don't look at the macro or micro fundamentals. Look at the change in sentiment. Frequently, and I think this is one of those times, a shift in sentiment from one extreme to the other can create momentum that—for a while—can by itself drive a market higher or drag it lower.

The Bulls Have It
Take the figures on bullish and bearish investment advisor sentiment compiled by Investors Intelligence, for example. Back in early October, when the S&P 500 had plunged to a low of 1,099, only 34% of the advisors surveyed were bullish—and a huge 46% were bearish.

(By the way, an Investors Intelligence subscription costs $199 a year, but you can sign up for a free monthly newsletter. You can find a similar contrary sentiment indicator that tracks the bullish/bearish sentiment of members of the American Association of Individual Investors in publications such as Barron's.)

By the second week in January, the bulls made up 51% of the advisors in the survey and the bearish sentiment had declined to 30%.

Think of the effects of that shift. In January, you've got a slim majority of advisors saying "buy stocks" and only 30% (down from 46%) saying "sell."

You can see the effect of this shift in sentiment in recent numbers on mutual fund flows. In the week ended January 11, US mutual funds attracted the most money in almost two years, according to the Investment Company Institute. Investors put $753 million into funds that buy US stocks. That's the first time since August that US equity funds had net inflows.

You can also see the way in which a move from very negative to not so negative drives individual stocks, if you look at the figures for short interest in specific stocks.

Up Next: Take the St. Joe Company (JOE)...

|pagebreak|

Take the St. Joe Company (JOE), a timber-company-turned-Florida-real-estate-developer. On November 2, the stock ended a long downward trend at $13.14 a share on a big reduction in the company's net loss in the third quarter to just $2 million, from a loss of $13 million in the second quarter.

The stock moved up steadily from there to $14.67 a share by January 9—a gain of 11.6% in a little more than two months. And then it hit the rockets, climbing to $16.81 for a gain of 14.6% in a little more than a week.

Not Safe to be Short
What happened? Well, rising optimism about the housing sector certainly helped. New-home starts climbed in November and December from their lows in the first months of 2011. On January 18, homebuilders reported more confidence in the prospects for their industry.

But I don't think you can ignore covering by short sellers as an essential fuel, especially in the period from January 9 through January 18.

When short sellers put on short positions, they borrow shares from owners and sell them at current prices. They hope to make a profit by replacing the borrowed shares at a lower price later, after the stock price falls. When short sellers cover, or close, a short position, they buy shares to replace the loaned shares right away in an effort to limit their losses if the price for those shares were to go up.

That buying by shorts can provide the critical fuel to move a stock up. If enough shorts buy and drive up the price fast enough, they can create a short squeeze by forcing other shorts to buy, too, in order to limit their losses.

On August 31, 2011, short interest—the number of shares sold short and not covered—in St. Joe stood at 21 million shares, or about 38 days of then-normal trading volume. By October 31, short interest was down to 18.7 million shares.

And it then proceeded to drop to 16.8 million by November 15 (remember, the stock's recent bottom occurred on November 2), to 16.4 million by November 30, to 16 million by December 15, and to just 15 million by December 30. That's a reduction in short positions—and an increase in short covering—of 5 million shares in four months. That's a huge shift for a stock that traded about 600,000 shares a day recently.

So How Far Does This Go?
This is all looking backward, of course. What investors would love to know now is how far sentiment, which has swung away from pessimism, can swing toward optimism before we need to worry about it swinging back.

For example, while it's certainly good news in the short term that US mutual fund flows have picked up, it worries me when I notice that last week marked the biggest inflow since April 2010. Look at a chart for the S&P 500 in 2010—April marked the market's top for that year.

Many of these sentiment indicators indeed switch from being positive indicators of a further advance to contrarian indicators at some point. Investors Intelligence has studied when that switch takes place for advisor sentiment. When the difference between bullish and bearish readings, for example, hits 30 percentage points, that study concludes, advisor sentiment is signaling danger. Sentiment then has become too bullish.

Where do we stand now? The difference between bullish and bearish sentiment has been hanging in around 20 to 21 in January. That's below the difference of 40 recorded at the market top in April 2011.

In other words, there's not unlimited fuel in the tank, but there is some. If you're hoping that this market has the legs to become a major rally, you'd better be wishing for some actual macroeconomic or sector-specific good news in the next few weeks to pick up the slack.

Full disclosure: I don’t own shares of any of the companies mentioned in this post in my personal portfolio. The mutual fund I manage, Jubak Global Equity Fund, may or may not now own positions in any stock mentioned in this post. The fund did own shares of St. Joe as of the end of September. For a full list of the stocks in the fund as of the end of September, see the fund’s portfolio here.