It's been a wild year of trading.

We have just a few days to go in 2012, and the S&P 500 is up a refreshingly robust 14% year to date. It may come as a surprise to see the numbers lining up to make this year a slightly better than average year for the markets.

Didn't we have a contentious presidential election? Isn't Europe still a mess? What about this fiscal cliff we keep hearing about?

Well, the market isn't the only surprising climber this year. Let's take a closer look at five well-known companies that are trading nicely higher in 2012.

Apple (AAPL -0.57%) : Up 30% in 2012
With the air rich in pessimism for the world's most valuable tech company, Apple shares have fallen 25% since hitting new highs a couple of months ago.

Some worrywarts see cascading margins as Apple combats the beast that open-source Android has become in smartphones and even tablets. It doesn't help that the historically market-thumping company has actually missed Wall Street's profit targets in three of the past five quarters.

However, Apple is still trading nicely higher after rallying earlier this year. Analysts still see growth at rates that suggest the stock should trade at healthier multiples.

Netflix (NFLX -0.51%) : Up 36% in 2012
The country's leading premium video service was a popular punch line last year. Qwikster was a joke. CEO Reed Hastings bubbled up to the top of most "worst CEO" lists of 2011, and rightfully so.

However, Hastings is one of the few maligned chieftains of last year to bounce back in 2012. In fact, of the five companies that made CNBC's Herb Greenberg's finalist cut for his "worst CEO" list of 2011, Netflix is the only stock trading higher in 2012.

What went right? Well, there was a disconnect last year between investors and subscribers. Video buffs were taken aback by Netflix's new pricing strategy last year, but after a quarterly dip, the company's streaming accounts bounced back. Investors were late to come around; the stock's year-to-date gain has come largely in the last few weeks.

Amazon.com (AMZN -1.14%) : Up 49% in 2012
Unlike Apple and Netflix, Amazon has been a steady performer this year. It's within a good trading day of hitting another all-time high.

Why is Amazon's nearly 50% ascent a surprise? Well, have you seen its income statements? The push to populate the planet with Kindles has forced the mother of all margin crunches. After posting a larger-than-expected loss in its third quarter, analysts now see a small loss for all of 2012. Net sales are still growing nicely, though that rate is decelerating.

I won't make the mistake of pointing out Amazon's lofty P/E ratio. Investors have been burned by ignoring the leading e-tailer's healthier valuation in terms of free cash flow. However, am I the only one concerned that Amazon continues to cut deals to collect state sales tax? In an online world where pricing is everything, that's something that matters.

Sears Holdings (SHLDQ) : Up 39% in 2012
Life isn't getting any easier for the parent company behind Kmart and Sears. Both chains continue to sputter, and there's little being done to reinvigorate the two once-powerful department store chains.

Analysts see another year of losses and declining sales in 2012, and they see the retailer's deficit widening next year on a 9% top-line plunge.

The clincher here is that the stock has actually shed nearly half of its value since peaking at $85.90 in March. How can this company still be soundly beating the market this year? Well, obviously it more than doubled during the first quarter. Investors were getting pumped about asset sales and Sears Holdings as a real estate play. That's not a very popular rallying cry these days, but the stock is still a big winner after falling in four of the past five years.

Microsoft (MSFT -1.84%) : Up 9% in 2012
When the year began, all of the hype was pinned on what was eventually October's updates to Microsoft's operating system platforms. The arrival of Windows 8 would inject new life in the meandering PC market. Well, that hasn't happened. But the arrival of Windows RT would make Mr. Softy a force in tablets. Well, that hasn't happened either, and now analysts are talking down their Surface tablet sales estimates. There's also the Windows Phone 8 upgrade that was supposed to dent the market share of Apple and Android. The jury's still out on that, but it doesn't seem as if that is happening, either.

Yes, Microsoft is still growing. However, analysts only see top- and bottom-line growth in the single digits in this fiscal year that ends next summer.

If Windows 8 isn't going to jump-start Microsoft's prospects, how long will we have to wait for the catalysts that will? Please don't tell me we're getting another costly acquisition. Microsoft has the financial fortitude to stick around for years and years, but its stock has no business moving higher after such a disappointing initial market reaction to Windows on all fronts.