TEN years ago this month investors were pretty confident. True, there were signs that problems in the American housing market would mean trouble for mortgage lenders. But most people agreed with Ben Bernanke, the Federal Reserve chairman, that “the impact on the broader economy…seems likely to be contained.” The IMF had just reported that “overall risks to the outlook seem less threatening than six months ago.”

That was reflected in market valuations. In May 2007 the cyclically-adjusted price-earnings ratio (CAPE), a measure that averages profits over ten years, was 27.6 for American equities (see chart). That ratio turned out to be the peak for the cycle. As the problems at Bear Stearns, Lehman Brothers and others emerged, and as the world was gripped by recession, share prices plunged. By March 2009 the CAPE had fallen by more than half.

Central banks then kicked into action, slashing interest rates and buying assets via quantitative easing (QE). The stockmarkets recovered rapidly and the S&P 500 is now more than 50% higher than it was ten years ago. And the American stockmarket’s CAPE, at 29.2, is also higher than it was back then.

Investors might worry about equity valuations but what are their alternatives? A decade ago, the ten-year Treasury-bond yield was around 4.8%; now it is 2.3%. The Fed may have started to raise rates but the return on cash is still pitiful in nominal terms and negative in real (ie, after inflation) terms.

But at least the return on cash and bonds (held to maturity) is fixed in nominal terms. Investors have already suffered two big bear markets in equities this millennium. On each occasion, their losses in percentage terms were in the double digits. What might trigger another collapse?

There is no law that says the CAPE has to return to its long-run average of 16.7; indeed, the ratio’s mean over the past 30 years has been 24.5. Even in the depths of the 2008-09 crisis, the ratio only fell below the long-run average for ten months.

When investors accept a high CAPE for shares, they are confident about the ability of companies to maintain, and increase, their profits. One reason why the American market has powered ahead since the election of Donald Trump is that investors expect cuts to the tax rate on corporate profits, allowing more of those profits to be passed on to shareholders.

As Jeremy Grantham of GMO, a fund-management group, points out, there does seem to have been a step change in the level of American profits, as a proportion of both sales and GDP, since 1996. The corollary has been a lower share of GDP for labour, one factor behind voter discontent.

Mr Grantham suggests two forces behind the higher profits: enhanced monopoly power for American companies; and low real interest rates, which have allowed firms to operate with more debt. Both suggest there is something wrong about the way capitalism is currently working. If profit margins are high, then more capital ought to be ploughed into businesses until investment-led competition drives margins back down; that has not happened. And low real interest rates reflect, in part, the extraordinary measures taken by central banks to revive developed economies after the financial crisis.

The conventional threats to the equity market are twofold: a sharp rise in interest rates, which would hit indebted individuals and companies; or a decline into recession, which would dent profits. Neither looks imminent at the moment, which helps explain why Wall Street keeps hitting record highs.

But there are other ways that profit margins could be hit. Protectionist policies could disrupt the free flow of goods, services and people across borders. A credit crisis could emerge elsewhere in the world—in China, for example, where debt has been growing rapidly. Flashpoints in the Middle East or on the Korean peninsula could spark war.

Investors are not as complacent as they seemed a decade ago. In a poll conducted by Bank of America Merrill Lynch, a net 32% of global fund managers think shares are overvalued. Despite that, however, a net 40% have higher-than-normal holdings in shares.

In other words, investors are managing to be simultaneously bullish and skittish. By a large majority, fund managers expect global growth and corporate profits to be strong over the next 12 months; but they also know such expectations are already fully reflected in share prices. All will be well provided there are no shocks. But history suggests shocks have a nasty habit of occurring.

Economist.com/blogs/buttonwood