The most important rule of investing is Warren Buffett's maxim: "First, don't lose money. Second, don't forget rule No. 1."

Here's a strong runner-up to Buffett's rule: Nothing in the market moves in a straight line. This surprises many investors, because we are raised to believe in straight lines. Highway patrolmen all over the country expect a sober driver to walk a neat straight line on the side of the road. Sober, rational investors expect to earn a steady market return or better if they follow reasonable steps.

Stick a banana peel in a sober driver's way, and he or she will likely end up on the ground in a heap. Investors get sandbagged, too, by all kinds of irrational market behavior. Portfolio balances shoot up and down wildly for no apparent reason. Calm, rational investors are suddenly confronted by volatile situations far beyond their control, with their hard-earned money at stake.

What can you do to avoid the market's banana peels and sleep well every night? Not much. Even when you do the right, rational thing with your portfolio (like focusing on value), short-term market sentiment may run completely opposite, and run you over in the process.

The market action so far in 2007 illustrates that sudden kind of shock. On Dec. 29, the markets loved international stocks in emerging markets. The New Ireland Fund (NYSE:IRL) closed at $36.80. Today it's only $31.14. The IShares MSCI Canada ETF (AMEX:EWC) dropped from $25.32 to $24.13. South African media giant Naspers (NASDAQ:NPSN) peaked at $23.97 and dropped off to only $21.29 now.

Did the economic fundamentals in Ireland, Canada, or South Africa change dramatically after New Year's? Not really. Lower energy prices will affect some of the stocks in the Canada fund, but not enough to justify a 5% drop in a week. The impact of lower energy prices certainly affected South Africa's Sasol (NYSE:SSL), however; it's shed almost 20% since Jan. 3.

More likely, many investors with fat profits in those stocks in 2006 waited until Jan. 3 to sell, pushing back their tax obligation a full year. At the same time, a variety of unsettling international headlines in Venezuela, Russia, and Thailand caused a bad case of the jitters among investors worldwide. The idea that profits were safer in cash or U.S. index stocks instead of volatile shares looked pretty good at the time. Previously happy owners dumped the "risky" shares blindly. And once some began to sell, the rest of the herd followed.

Recent behavioral research proved that investors feel the pain of losing money more than the joy of making it. Fear outweighs pleasure. I have seen that phenomenon with my private clients; show them a good quarter, and you will get a slap on the back and a nice "well done" message. But if their portfolios drop a week later, the anguish of not having as much money in their investment account hits home very quickly, even when they have healthy net gains for the preceding year.

Successful long-term investors learn how to accept the market's occasional banana peels and concentrate on long-term returns for their portfolio. They focus on valuations and company performance, instead of this week's or next week's market sentiment.

Your portfolio will not move in a straight line. Neither will the markets. But that's not important when your goal is to build your wealth over time. You will slip and slide on the occasional banana peel when it comes your way, and maybe even take a nasty spill. Get up, dust yourself off, and keep your eyes on the prize: growing your portfolio. Do it right, and the annual growth in your account balance will be as close to a straight line as you ever need.

But even that will have a few curves.

Sasol is a Global Gains selection. To view some more compelling international stock ideas, try a free trial to Global Gains. Click here for more information.

Fool contributor Dale Baker, a private client portfolio manager and former US diplomat with extensive experience in Europe and Africa, owns shares in all the stocks mentioned here for himself and his clients. He doesn't believe in straight lines, but he welcomes your questions or comments. The Fool has a disclosure policy.