Stock Quotes in this Article: AZO, CA, EXPE, HPQ, MHP

BALTIMORE (Stockpickr) -- What if you could use a “magic formula” to pick stocks for you? According to hedge fund manager Joel Greenblatt, you can.

>>5 Stocks Warren Buffett Loves

Greenblatt's “Magic Formula Investing” is a way of ranking stocks quantitatively using fundamental data. In short, it hinges on identifying firms with the highest earnings yield and the highest return on capital, and buying them with both hands. Historically, Greenblatt's magic formula has lived up to its name, producing some magical returns -- according to his work in The Little Book that Beats the Market, the strategy has earned average gains of 30.8% over the last 17 years.

The magic formula approach to investing isn't without a few pitfalls, however. For starters, the screen's focus on the highest earnings yield and return on capital tends to attract overhyped momentum names that carry a whole lot more volatility than the rest of the market. That doesn't mean that you should throw out the magic formula approach wholesale, but it does show the value of adding some qualitative filters to this quantitative strategy.

>>5 Toxic Stocks to Dump Before 2013

So, that's what we're doing today with a look at five magic formula stocks to buy for 2013

McGraw-Hill Companies

First up is specialty publishing giant McGraw-Hill Companies (MHP). While many conventional publishers fell on hard times during the recession, McGraw-Hill skirted downside by sticking to niche businesses. MHP's focus is in providing higher-value content and research through subsidiaries like J.D. Power and Associates, Standard & Poor's, and its namesake educational publishing arm.

While that focus on trade publications and education means that higher costs go into creating products, it also means that the firm can demand higher prices and deeper profit margins for its trouble. While that niche exposure spared MHP from the worst of the recession, the firm's valuable S&P ratings unit suffered some serious brand damage from its failure to spot the problems in many of the debt ratings it made. Even so, the ratings business is heavily regulated and barriers to entry are high -- new competitors aren't likely to take business away from S&P, only add more another set of ratings to the mix.

Financially, MHP has been looking more attractive than ever lately, building up a net cash position for the first time in a while. And I've already said that I think that McGraw-Hill looks like a likely candidate for a dividend hike in the next quarter as well. With shares definitively in an uptrend, this magic formula stock looks well positioned to perform in 2013.

Expedia Inc.

It's been a stellar year for the world's largest online travel agent, Expedia Inc. (EXPE) -- shares of the $8 billion travel firm have more than doubled since the first trading day of January. But this firm could have a lot further to run according to Greenblatt's magic formula -- this stock scored above the 90th percentile for both return on capital and earnings yield.

Expedia provides bookings for everything from air travel and hotels to rental cars, cruises, and package tours. The firm also owns Hotels.com, Hotwire, and China's eLong.com, in addition to its popular, namesake site. Expedia's early claim to fame was cost; by offering the lowest possible prices on travel, the firm was one of the pioneers in the online travel industry. Today, though, travel fares have largely become commoditized, with “lowest fare guarantees” contractually obligated between carriers and travel bookers like Expedia. That means that the firm now has to rely more on added features on its website (like reviews and package deals) to court travel dollars.

But it's not just dollars that Expedia is courting. Today, international markets make up more than a third of EXPE's total bookings, a big enough chunk to materially reduce the firm's exposure to the cyclical U.S. travel business, but a small enough chunk that it hasn't been overly hurt by a strong dollar. Travel prices are much less commoditized in markets like China, where EXPE can get deeper margins and grow its top line materially over the next few years. That should keep those magic formula metrics growing going forward.

CA Technologies

Enterprise IT firm CA Technologies (CA) provides information technology management software to firms that are focused on securing that administering their networks. That's been a lucrative business in the last few years, as increasingly connected computer infrastructure and upticks in enterprise IT spending give CA a bigger pool of customers to draw from.

CA's expertise in mainframe computers gives it a big edge in providing services for huge IT departments. Because mainframes are extremely expensive, IT departments tend to be less sensitive to the costs of deploying software on them, giving CA some meaningful pricing power as IT administrators look to protect their massive investments. CA has also done a good job of positioning itself in line big trends in IT right now, namely cloud computing and virtualization. As those technologies continue to grow in popularity in corporate America, CA should continue to push its sales numbers higher, particularly with a customer list that already includes 99% of the Fortune 1000.

CA Technologies is in good financial shape, with a deep net cash position that accounts for nearly a tenth of CA's market capitalization. The firm also scored very well under the magic formula screen, generating the same score as the first two names on our list.

Hewlett-Packard

Another technology company that may seem surprising to find on the magic formula list is Hewlett-Packard (HPQ). H-P has seen its share price get halved over the course of 2012, as major missteps keep aggravating investors and giving sellers and opportunity to unload shares. The most recent mess-up comes from H-P's purchase of software firm Autonomy, which resulted in a multi-billion dollar write down of around 80% of the deal price. Poor acquisition choices are always a risk for firms with large cash positions -- H-P's $11.3 billion in cash would probably be better used paying down debt than buying its way into new businesses.

While H-P is synonymous with the computer business, PC-makers are realizing that building computers isn't the place to be anymore. With PC prices becoming increasingly commoditized, H-P is struggling to find service revenue to fill the profitability gap, and competition is coming from all sides. H-P's enterprise division has a big advantage through its relationships with corporate IT departments, but big rivals like Dell (DELL) boast similar customer Rolodexes.

I think it's premature to expect the cash bleed to stop right away for this firm -- especially with management conceding that more write-downs on Autonomy may be on the way. While H-P ranks high on the magic formula screen, it's the one name that I'd recommend avoiding for qualitative reasons.

AutoZone

Meanwhile, car parts retailer AutoZone (AZO) has a lot going for it. The firm is the biggest auto part retailer in North America, with a network of around 4,685 stores stateside and another 321 stores in Mexico. Right now, big macro tailwinds are providing a huge opportunity for AutoZone -- with the average car age in the U.S. higher than it's ever been before, drivers are looking to prolong the roadworthiness of their cars by repairs. That rising tide of car part spending should help lift all ships in the industry.

Even though the firm is best known for its retail stores, AutoZone also runs a lucrative commercial business that provides parts to repair shops and service stations. While the margins aren't as deep for the commercial part supply business, the volumes are, and they enable AZO to take advantage of repair trends that extend beyond the do-it-yourselfers who stroll into one of the firm's stores.

Mexico is a big growth market for AZO. Like the U.S., Mexico has a car culture that's reliant on personal vehicles for transportation. And with an aging fleet south of the border, AutoZone's stores should continue to generate impressive returns on invested capital. A manageable debt load and double-digit net profit margins should leave room for AZO to keep up its growth trajectory abroad…

To see the magic formula rankings for these five stocks, check out the Magic Formula Q4 2012 portfolio on Stockpickr.

RELATED LINKS:

>>5 Dividend Stocks to Fight Off the Fiscal Cliff

>>7 Under-$10 Stocks Rising on Explosive Volume

>>5 Stocks Insiders Are Snapping Up

Follow Stockpickr on Twitter and become a fan on Facebook.

At the time of publication, author had no positions in stocks mentioned.

Jonas Elmerraji, CMT, is a senior market analyst at Agora Financial in Baltimore and a contributor to TheStreet. Before that, he managed a portfolio of stocks for an investment advisory returned 15% in 2008. He has been featured in Forbes , Investor's Business Daily, and on CNBC.com. Jonas holds a degree in financial economics from UMBC and the Chartered Market Technician designation.