DNA strand © Getty Images

Some people become value investors. Some might be born that way.

Consider Benjamin Graham, Warren Buffett's mentor and the author of "Security Analysis" and "The Intelligent Investor."

Graham's widowed mother was a small-time speculator; she was wiped out during the Panic of 1907, when he was 13 years old.

Graham never forgot the "humiliating" moment in his childhood when his mother sent him to cash a check and the bank teller asked the manager if Mrs. Graham was "good for five dollars."

Graham grew up to favor companies so universally despised by investors that the stocks were, as he liked to say, "worth more dead than alive." He resoundingly beat the market over his multidecade investing career.

Or take the late Sir John Templeton, who grew up the son of a country lawyer in Winchester, Tenn. Templeton's father also was a speculator, trading cotton futures. He arrived home one day and told his young sons, "Boys, we've lost it all; we're ruined." Templeton worked odd jobs to scrounge his way through college and graduate school.

In 1939, at age 27, Templeton told his broker to buy him $100 worth of every listed U.S. stock trading for $1 a share or less; he quadrupled his money in four years.

"People are always asking me where the (investing) outlook is good, but that's the wrong question," Templeton once said. "The right question is: Where is the outlook most miserable?"

Their experiences might have shaped Graham and Templeton to favor cheap "value" stocks over fast-moving "growth" stocks. But that preference might also have been encoded in their genes.

In a speech at Babson College in 2010, the renowned value investor Seth Klarman remarked that research on fruit flies showed that most of them will swarm toward a light -- but that a small minority appear to be genetically programmed to stay away from it.

Klarman, president of the Boston-based Baupost Group, which manages $26 billion in hedge-fund assets, jokingly called these flies "tiny contrarians," the insect equivalents of "deep value investors."

He went on to speculate that most people might possess "a dominant gene" for chasing hot performance and overhyped assets, while only a minority have "the recessive value gene" that confers a patient preference for whatever is battered and unpopular.

Klarman told me recently that he still holds the same view.

A new study finds that many investors may in fact have a genetic predisposition to hunt for bargains in the stock market -- although the environment you grew up in also powerfully shapes the kind of investor you become.

In the study, three economists -- Henrik Cronqvist and Frank Yu of China Europe International Business School in Shanghai and Stephan Siegel of the University of Washington -- examined the genetic makeup and investment portfolios of 35,000 twins in Sweden.

Identical twins share 100 percent of their DNA, while fraternal twins share about the same amount as brothers and sisters. The researchers compared the similarity of the portfolios held by identical twins and by fraternal twins. That enabled the economists to estimate the extent to which the same combinations of genes were associated with similar portfolios.

The analysis shows that the average stock held by these investors traded at a price/earnings ratio of 23 times. Only a 10th of the investors -- call them "deep-value hunters" -- held stocks with an average price-to-earnings ratio (P/E) of 11.6 or lower.

One quarter of all the investors -- hard-core growth seekers -- held stocks trading at an average of 28.6 times earnings or higher.

The study's findings are relatively precise because its sample of investors is large and because Swedish tax law required complete disclosure of individual investors' holdings until recently.

According to the study, up to 24 percent of the differences in the degree to which investors favor value or growth stocks can be explained by variations in their genetic code.

It appears that favoring cheap value stocks or fast-moving growth stocks isn't just a preference; "it is at least partly an innate tendency," Siegel says.

Environmental influences also help explain the "tilt" toward value or growth investing, the researchers found. For example, if the economy was in a severe recession when an investor was between the ages of 18 and 25, or the investor's parents were relatively poor, he is more likely to prefer investing in cheap stocks.

Genoeconomists, who study such stuff, haven't yet identified the specific variations that might work as "value genes."

But the new findings suggest that you should ask financial advisers and investment managers: What adversity have you had to overcome in your life? And what does being poor mean to you?

After all, a financial adviser or investment manager who has never overcome a serious obstacle might not have what it takes to hold on to cheap stocks when they get a lot cheaper in a hurry. A value investor who can't withstand pain isn't a value investor at all.

Click here to become a fan of MSN Money on Facebook

More from The Wall Street Journal