FORTUNE -- Financial markets can make you look really foolish, even if you thought your analysis was right, and still do. Today's humbling example: the best investment by far for the first half of this year has been the one that people like me have been warning against: long-term U.S. Treasury bonds.
I've also said (and said) that you have to protect yourself against a decline in the value of the dollar because our need to borrow huge amounts to cover trade and budget deficits is eroding the greenback's standing as the world's reserve currency.
But guess what? Even though it's been a crummy year for U.S. stocks, foreign stocks have performed considerably crummier.
Now, to the numbers, courtesy of Aronson + Johnson + Ortiz, a Philadelphia money management firm that tracks investment returns for 48 asset classes.
The only investment that showed a double-digit positive return for the first half of this year was ... long-term Treasury securities. Their total return -- price gains plus interest -- was 13.2%.
Meanwhile, non-U.S. stocks lost 12.2% (price declines and reinvested dividends) for the first half, while U.S. stocks lost 5.6%.
What's happening, of course, is that we're seeing a somewhat different version of the phenomenon in 2007-08, when scared investors sought refuge in the safe haven of U.S. Treasury securities because they feared a worldwide financial meltdown.
This year, it's the European problem -- Greece, Spain, Italy and much of the rest of the euro zone -- that's prompted investors to seek safety in Treasuries.
"When the world seems to be about to collapse and you want to stay liquid, the only viable trade is the U.S. dollar and Treasuries," says Brian Wenzinger, a principal at AJO.
What goes way up, must come down
All that money flooding into the Treasury market drove down the interest rate on long-term Treasury bonds. The rate on the index that AJO uses to measure Treasury performance fell to 3.68% as of June 30, the firm says, down from 4.45% at the end of 2009. That rate decline has driven up the bonds' prices, because a bond yielding 4.45% is worth more than face value when a new bond is yielding only 3.68%.
That difference -- $7.70 a year for each $1,000 of bonds for an extended period -- is worth a considerable amount of money. Hence, long-term Treasury bonds' strong performance for the first half of the year -- and our country's ability to finance its enormous deficits by selling Treasuries at very cheap rates.
When interest rates rise, however -- which they're sure to do, sooner or later -- the prices of existing bonds will decline. That's what happened last year, when the rate on bonds was up by almost 50%, to the aforementioned 4.45% from 2.97% at the end of 2008. Last year, long-term Treasuries had a total return of minus 12.9%, making them the biggest loser among the 48 AJO classes. The year before, in 2008, long Treasuries were among the best-performing asset classes.
How do I explain that my predictions have been so wrong for the past six months? Simply this. In the long run, markets are rational. In the short run, anything can happen. The tech stock and house price bubbles lasted far longer than rationalists expected them to, but they ultimately popped. So will the Treasury bond bubble.