I recently finished reading Moneyball, an excellent new book written by Michael Lewis. If you aren't familiar with Lewis, he made his name with Liar's Poker, a classic account of the rise and fall of the Salomon Brothers bond empire that he witnessed as a bond salesman for the firm. He followed that up with The New NewThing, an exploration of Silicon Valley culture that chronicled the exploits of Netscape founder Jim Clark.

Lewis' latest effort is different in that it doesn't directly address the financial markets. Moneyball offers a rare glimpse into the dynamics of a different market -- the market for professional baseball players as viewed through the lens of one of the game's better general managers, Billy Beane of the Oakland A's. Since Beane has been running the show, the A's have won more games with a smaller payroll than any team in baseball.

My hometown team, the Texas Rangers, offers the perfect contrast -- they pay more per win than just about any team in the majors. In 2002 the Oakland A's won 103 games with a payroll of $41.9 million. The same year, the Texas Rangers won 72 games, or 31 fewer, while spending $106.9 million, more than twice as much. In Moneyball, Lewis provides a behind-the-scenes look at how the Oakland A's managed to pull off this exceptional feat.

Even if you don't care for sports analogies or give a hoot about baseball, Moneyball is full of investing insights. I have always found striking similarities in the markets for baseball players and equities. I'm not surprised that a guy who made his name conveying the fads of Wall Street has written a book about the search for value among baseball players. As you might expect, Lewis makes liberal use of financial metaphors to describe the business of valuing baseball players. Here, he explains Billy Beane's seemingly uncanny ability to find undervalued relief pitchers:

Established closers were systematically overpriced, in large part because of the statistic by which closers were judged in the marketplace: "saves." But the situation typically described by the save -- the bases empty in the ninth inning with the team leading -- was clearly far less critical than a lot of other situations pitchers faced. The closer's statistic did not have the power of language; it was just a number. You could take a slightly above average pitcher, drop him in the closer's role, let him accumulate a gaudy number of saves, and then sell him off. You could, in essence, buy a stock, pump it up with false publicity, and sell it off for much more than you'd paid for it.

Lessons for investors
I myself learned a tremendous amount about investing from a baseball writer named Bill James, though I don't believe he ever wrote a word about the stock market. Yet, through his annual publication, Baseball Abstract, Bill James became sort of the Benjamin Graham of baseball, introducing logic and statistical analysis to evaluate ballplayers, much as Graham pioneered the use of rigorous analysis to identify value in the stock market.

By applying this same sort of rigorous analysis to baseball, James learned that certain skills and characteristics of baseball players are widely overvalued by professional baseball men. Because others skills are dramatically undervalued, players who possess those skills can become great investments for any baseball manager who grasps their importance. And, just as classic "Graham-and-Dodd" value-style investors tend to be stock-market winners over time, by identifying and acquiring undervalued players from those teams that don't recognize what they have, Billy Beane and other followers of Bill James have succeeded in beating their better-funded competitors.

Many of the lessons I learned from Bill James have nothing to do with baseball, but rather with applying logic and statistical evidence to informed value judgments. "Baseball is a soap opera that lends itself to probabilistic thinking," says one of the enlightened baseball analysts in Lewis' book. The same can be said about the stock market. Bill James discovered that, when subjected to the light of rigorous analysis, a great portion of conventional wisdom in baseball is, as he put it, "ridiculous hokum." The same can be said about much of what passes for conventional stock market wisdom.

Secrets of the game
Investing and baseball share another similarity in the vast quantity of statistics and data available to the layperson in today's Internet age. Enthusiasts have long used such classic ratios as batting average for hitters and earned run average for pitchers. You can even find what the backup shortstop on your favorite team hits with two outs in night games at home against lefty pitchers. The same is true for stocks -- the available statistical and analytical data boggles the mind. We're all familiar with the classic price-to-earnings and price-to-book ratios, but there is no end to the data that can be found online to evaluate stock investments. And in both baseball and stocks, too many get carried away with the analysis that can be done and don't spend enough time on the analysis that should be done.

In more than 20 years of searching for value on the baseball diamond, Bill James found two offensive statistics that were, as Lewis writes, "inextricably linked to baseball success." Those two statistics are on-base percentage and slugging percentage. Other statistics help in evaluating talent, of course, but everything else is far less important to winning baseball games. The reason that the Oakland A's are so good is quite simple.

They identify players who do the important things -- get on base, hit with power, and keep the opposing team from doing the same -- and then acquire them cheaply. The A's conscientiously avoid players who possess the classic "overvalued" baseball traits: guys who run fast, pitchers who throw 95 miles per hour but can't throw a strike, and others who just fill out a uniform well. Chronically bad baseball organizations are always over-populated with such players.

In much the same way, I know people who have portfolios chockfull of overvalued and speculative stocks that they heard about on CNBC, or whose CEO was on the cover of their favorite business magazine, or that they bought because the company is big in the latest hot technology fad.

Building a winning portfolio
The stock market has its own version of on-base percentage and slugging percentage, and I'm going tell you what they are. The most critical drivers of a company's value (and a stock) are its ability to produce cash and its ability to grow that cash flow over time. To win the unfair game of the stock market, you must simply learn to identify companies that can produce an ever-increasing stream of cash, and buy them cheaply. The more you focus on factors that don't or won't translate into cash flow, the more likely you are to overpay for your stocks. And as any Texas Rangers fan can tell you, overpaying is not a good thing.

Fools are talking baseball all the time on the Major League Baseball discussion board. Join the conversation. Zeke will be writing for the August issue of Tom Gardner's Motley Fool Hidden Gems.

Zeke Ashton has been a longtime contributor to The Motley Fool, and is the managing partner of Centaur Capital Partners, LP, a money management firm in Dallas, Texas. Please send your feedback to zashton@centaurcapital.com. The Motley Fool is investors writing for investors.