If there's one thing that the majority of individual investors have in common, it's the unfortunate propensity to buy high and sell low.

The historical evidence is unequivocal. To cite only one example, this year's annual study of investor performance by DALBAR found that the average investor has underperformed the S&P 500 (SNPINDEX:^GSPC) on a multi-year time frame in 15 out of the past 15 years.

And to make matters worse, we continue to be enticed by the siren song of euphoria. As my colleague Morgan Housel pointed out two weeks ago, "As stocks hit all-time highs and bonds begin to fall, retail investors are buying stocks and selling bonds for the first time in years."

While most of us know Warren Buffett's infamous adage to "be fearful when others are greedy and greedy when others are fearful," far fewer of us have the emotional certitude to apply it when the situation presents itself.

One of the reasons is that most investors have a number of bad investment habits. We check our stocks too frequently, succumb to fear when the market is down and euphoria when it's up, and exhibit an irrational obsession over the short-run.

It's a vicious cycle.

But the good news is that it can be broken.

The most obvious remedy is to change your behavior. Stop watching CNBC. Stop checking your stocks all the time. Stop worrying about whether a specific stock in your portfolio is up or down by whatever percent today or even this month. And, most importantly, truly embrace the fact that your last remaining edge on Wall Street is time.

But because all of these require self-control, they are much easier said than done. "The evidence is persuasive," writes Daniel Kahneman in Thinking, Fast and Slow -- "the exertion of self-control is depleting and unpleasant."

So, is there an end-around that investors can apply to head the unpleasantness off at the pass?

It turns out that there is. According to Seth Klarman, the head of the hedge fund Baupost and a value investor extraordinaire, "One of our strategies for maintaining rational thinking at all times is to attempt to avoid the extreme stresses that lead to poor decision-making."

In a slightly different context, the Catholic Church exhorts its members not only to avoid sin itself, but also to avoid the occasion of sin -- the thought process being that when confronted with the occasion, most of us are unable to abstain from the prohibited act.

To bring it back to investing, Klarman suggests three things that are applicable to the average investor: "willingness to hold cash in the absence of compelling investment opportunity, a strong sell discipline ... and avoidance of recourse leverage" -- that is, margin.

As James Montier notes in his book The Little Book of Behavioral Investing, "Learn from [Klarman's] example and try to remove the drivers of forced decisions from your portfolio."