ANOTHER week, another record. The repeated surge of share prices on Wall Street is getting monotonous. The Dow Jones Industrial Average has passed another milestone—24,000—and the more statistically robust S&P 500 index is up by 17% so far this year. Emerging markets have performed even better, as have European shares in dollar terms (see chart).

Political worries about trade disputes, the potential for war with North Korea and the repeated upheavals in President Donald Trump’s White House: all have caused only temporary setbacks to investors’ confidence. No wonder the latest quarterly report of the Bank for International Settlements asked whether markets are complacent, noting that “according to traditional valuation gauges that take a long-term view, some stockmarkets did look frothy”, and pointing out that “some froth was also present in corporate-credit markets”.

The authors of the BIS report are not the only ones to worry that markets look expensive. The most recent survey of fund managers by Bank of America Merrill Lynch found that a net 48% of them thought equities were overvalued, a record high. Despite that, a net 49% of managers had a higher than normal allocation to stockmarkets.

How do fund managers rationalise this apparent discrepancy? First, they are more optimistic than usual about the economy, with a record number believing in a “Goldilocks scenario” of above-average growth and below-average inflation. Second, investors are even more worried about bonds, the other main asset class; a net 81% think bonds are overvalued. In short, they are piling into shares because they see no alternative.

Improving economic data have driven the most recent spurt of enthusiasm. Alan Ruskin of Deutsche Bank points out that, in the manufacturing sector, South Africa is the only country where the purchasing managers’ index is below 50—the dividing line between expansion and contraction. Another boost is the expectation that America’s Congress will pass a bill that will cut taxes for corporations, allowing them to pass more cash to shareholders.

Confidence was also lifted by a decent third-quarter results season, which showed that companies in the S&P 500 managed annual earnings-per-share growth of 8.5%, according to Société Générale, a French bank. But long-term profits expectations are “ridiculously high”, says BCA Research, an advisory firm, with earnings forecast to grow at 14% a year in both America and Europe. That would imply an ever-greater share of GDP going to profits, and an ever-lower share for workers. If that were to happen, support for populist parties would go through the roof.

Analysts rarely tend to forecast falls in profits. But Andrew Smithers of Smithers & Co, a consultancy, points out that the earnings per share of quoted companies have become far more volatile since 1992, compared with the volatility of profits in the national accounts. One reason for this is the much greater importance of foreign profits in the figures reported by US-quoted companies; the overseas portion rose from 18% in 1982 to 38% in 2015.

Even allowing for this, reported profits are more volatile than they used to be. Mr Smithers argues that it is in the interests of managers to present higher profits when share prices rise and to understate profits in bear markets. In the former case, higher profits will allow executives to meet targets and exercise their lucrative share options. Conversely, in a bear market, it is worth managers taking a “kitchen-sink” approach—getting all the bad news out of the way so the next set of performance targets will start from a lower base.

Share buy-backs add another factor to the equation. Companies tend to be trend-followers rather than bargain-hunters when purchasing their own shares. Since early 2005, the only two quarters when corporations have not been net buyers were the second and third quarters of 2009. That was the period when valuations were cheapest.

All this suggests that there is a risk that when the market does at last turn down, the decline will be exaggerated. Share buy-backs will stop and profits will decline sharply.

But judging when that moment comes is another matter. While the economy is improving and interest rates are low, it is hard to foresee the next downturn. As one fund manager says, investors feel like Chuck Prince, a former head of Citigroup, who was asked why the bank was still lending in mid-2007, just before the financial crisis. “As long as the music is playing, you’ve got to get up and dance,” he said.