The mad market swings keep coming. If you've seen your portfolio drop by tens or even hundreds of thousands of dollars, you're probably in no mood to look for a silver lining.

But as painful as it has been, you're going to come out of this a better investor. As easy as it is to read simple rules for mastering the markets, you just don't know what it takes to follow through on those bits of wisdom until you experience conditions like these for yourself. Consider these points:

Be greedy when others are fearful
Warren Buffett's advice sounds obvious in a normal up-and-down market. But when times are rosy and everyone's optimistic, it's tough to be the lone naysayer. Last year, Google (NASDAQ:GOOG) went over $700 per share, but the consensus was that the search expert was on its way to taking over the computer world. Also-ran Yahoo (NASDAQ:YHOO) had a niche for itself, but even the mighty Microsoft (NASDAQ:MSFT) couldn't hope to overtake Big G.

If you were fearful while everyone else dreamed of $1,000 Google shares last year, you saved yourself a bundle. Now, Google's value has been almost cut in half, and analysts are focusing more on the negatives of every earnings report the company issues. With scary economic forecasts and their potential to decimate corporate advertising budgets, Google's naysayers now sound prophetic. So are you convinced? Or are you bucking the trend and buying shares?

Use dollar-cost averaging
OK, so you have your inner greed figured out. The next question is harder, though: When there are tons of bargains out there, do you have a strategy for buying?

Stocks have been falling fairly steadily all year. Many thought stocks were attractive down 10%, a steal at 20% off, and crazy cheap after a 30% fall. Yet on Wednesday, the S&P 500 was off by more than 40% from its highs. Did you have any cash left to invest by then?

The only thing worse than not having the nerve to buy low is not having any money to buy stocks with at all. If you've been used to seeing share prices always go up, buying on even tiny dips seemed almost irresistible. After climbing to nearly $150, Research In Motion (NASDAQ:RIMM) at $100 seemed great -- but then it dropped another 50% from there. Those who used all of their bullets early are sitting on big losses and can't take advantage of that even better price.

That's why sticking with the discipline of dollar-cost averaging is smart. While shares are dropping, you may feel silly holding back on a bargain. But if shares keep falling, you won't miss out on better bargains by spending all of your investing cash too soon.

Know your stocks
This one also seems basic -- why would you put your hard-earned money into a stock you didn't understand? Unfortunately, the answer is simple: because it made you big profits when times were good.

Remember back in 1999, when people traded ticker symbols and didn't know what companies they owned? That worked fine -- until it stopped working, and plenty of investors were left holding the bag on shares of businesses with no profits and no prospects.

This time around, financials wowed investors with profits from incomprehensible structured assets, while energy companies rode the parabolic wave of skyrocketing oil prices. Shares of Citigroup (NYSE:C) rose almost fivefold from 1996 to 2006 and survived the tech bubble relatively unscathed. Energy plays from ConocoPhillips (NYSE:COP) to Petrobras (NYSE:PBR) emerged from years of below-$30 oil to see their profits multiply.

Yet relatively few had the foresight to predict trouble with the ever-rising housing market. Few had the tenacity to question oil's rise as it hit new records seemingly every day. In the end, though, both were just more examples of a phenomenon stock that investors have seen countless times before. And now, prices will probably overshoot on the downside as well -- yet few have even talked about getting back into energy or financials.

A valuable lesson
If you're like most investors, you've lost a lot of money in recent months. But by now, you've also learned a lot about who you are as an investor. Those lessons, expensive as they've been, will serve you well throughout the rest of your investing career -- and in all likelihood, they'll increase your profits and cut your losses in years to come.

For more on the panic of 2008:

Want to be a better investor? For 15 years, Fool co-founders Tom and David Gardner have helped people just like you learn to invest smarter. Now you can benefit from their experience every month in their Motley Fool Stock Advisor newsletter service. Specific stock recommendations, advice on the general economy, and much more are yours free with a 30-day trial.

Fool contributor Dan Caplinger thinks he might be a better investor than he was 20 years ago. He doesn't own shares of the companies mentioned in this article. Petroleo Brasileiro is a Motley Fool Income Investor selection. Microsoft is a Motley Fool Inside Value pick. Google is a Motley Fool Rule Breakers recommendation. Try any of our Foolish newsletter services free for 30 days. The Fool's disclosure policy won't panic on you.