If you bought any one of these stocks six months ago, you may hate yourself today:

Company

Six-Month Return

Petrobras (NYSE:PBR)

(26%)

Canadian Natural Resources (NYSE:CNQ)

(29%)

Hess (NYSE:HES)

(31%)

Valero (NYSE:VLO)

(37%)

Ultra Petroleum (NYSE:UPL)

(33%)

Sure, the energy sector may have looked like a good idea at the time. Demand and prices have both been rising (and likely will continue to do so eventually), and the valuations still looked reasonable despite some recent heady outperformance. But none of these ideas has made money, and even Warren Buffett admitted in his recent letter to shareholders that he lost money on ConocoPhillips.

So was it a mistake to buy these stocks? Or are these still good ideas that just haven't worked out yet?

What's behind door No. 3
According to money manager Wally Weitz, it's either one or the other. And since not many stocks go up -- and keep going up -- from the day that you buy them, the key to investing successfully is to separate the mistakes from the good ideas.

Because if you have a great idea that is now 10% or even 20% cheaper than it was, you can make a lot of money by buying it again.

How now brown cow
The way to separate good ideas from investing mistakes, for Weitz, is to track his investing thesis against the progress of the business he's invested in -- not the stock price. He says, "What we really look at is to see that our businesses are performing the way they're supposed to -- and that the business value is going up even if the stock price isn't."

To really maximize profits, he told shareholders in a recent call, "We really can't wait for the 'all-clear signal' " from the market to buy a company like Lowe's -- whose near-term fortunes will wax and wane with housing and consumer data.

But if your long-term outlook for energy is a bullish one (as mine is), then these near-term wanes can be your best friend.

Buy low? No, buy lower.
Weitz isn't the only smart investor who thinks that way. Former Motley Fool Hidden Gems advisor Bill Mann confessed during a recent presentation that "I've made most of my gains on my second or third purchase of the same equity. That means the price was lower but the business quality was the same or better."

The key to doing this successfully, though, is to keep close tabs on a company's operations to know when operational reality and stock price performance diverge. If the stock drops and the business quality remains the same, then buy. If the stock remains the same and the quality of the business improves, then buy some more. But if the stock drops and the business deteriorates, you may want to hold or even sell.

That guiding principle is at work in our Hidden Gems portfolio today, where our aim is to identify the best small companies for our investors, using fundamental, bottom-up business analysis. Yet we don't always get the best companies, and we're not always spot-on with our timing.

To see what we're recommending, click here to join Hidden Gems free for 30 days.

This article was first published May 2, 2008. It has been updated.

Already a subscriber? Click here to log in.

Tim Hanson does not own shares of any company mentioned. Petrobras is a Motley Fool Income Investor recommendation. When it comes to politics, the Fool's disclosure policy is pro-kitten.