At the height of a market mania in 1967, author George Goodman captured the mood perfectly, comparing it to a surreal party that ends only when "black horsemen" burst through the doors and cut down all the revellers who remain.
"Those who leave early are saved, but the ball is so splendid no one wants to leave while there is still time. So everybody keeps asking - what time is it? But none of the clocks have hands."
Every decade since, the global markets have relived this party.
In the late 1960s, the mania was for the "nifty 50" American companies like Disney and McDonald's, which had been the "go-go" stocks of that decade.
In the late 1970s, it was for natural resources, from gold to oil. In the late 1980s, it was stocks in Japan, and in the late 1990s, it was the dot.com boom. Last decade, investors flocked to mortgage-backed securities and big emerging markets from Brazil to Russia. In every case, many partygoers were still in the market when the crash came.
Today, tech mania is resurgent. Investors are again glancing at a clock with no hands - and dismissing the risk. The profitless start-ups that were wiped out in the dot.com crash have consolidated into an oligopoly composed of leading survivors such as Google and Apple. These are giants with real earnings, yet signs of an irrational euphoria are growing.
One is pitchmen bundling investments with very different outlooks into a single package.
Last decade they bundled Brazil, Russia, India and China to sell as Bric. More recently they packaged Facebook, Amazon, Netflix and Google as Fang; then, as names and prospects shifted, subbed in Alphabet, Apple and Microsoft to make Faama. Others are hyping the hottest tech companies in China as BAT, for Baidu, Alibaba and Tencent. Whatever the mix, acronym mania is usually a sign of bubbly thinking.
Seven of the world's 10 most valuable companies are in the tech sector, matching the late 1999 peak. As the American stock market keeps marching to new highs - the Dow hit 22,000 last week - the gains are increasingly concentrated in the big tech stocks. The bulls say it is inevitable that Apple will become the first trillion-dollar company.
No matter how surreal the endgame, booms tend to begin with real innovation. In the past, manias have been triggered by excitement about canals, the telegraph and the automobile.
But not since the advent of railroads incited market booms in the 1830s and 1840s has the world seen back-to-back booms like the dot.com bubble of the 1990s and the one we are in now.
Market excitement about authentic technology innovations enters the manic phase when stock prices rise faster than justified by underlying economic growth.
The dot.com era saw the rise of big companies that were building the nuts and bolts of the Internet - including Dell, Microsoft, Cisco and Intel - and of start-ups that promised to tap its revolutionary potential. The current boom lacks a popular name because the innovations - from the Internet of Things to artificial intelligence and machine learning - are sprawling and hard to label.
If there is a single thread, it is the expanding capacity to harness data, which Alibaba founder Jack Ma calls the "electricity of the 21st century".
Market excitement about authentic technology innovations enters the manic phase when stock prices rise faster than justified by underlying economic growth. Since the crisis of 2008, the United States economy has been recovering at the rate of around 2 per cent, roughly half the rate seen for much of the past century. The areas of growth are limited in this environment. Oil's not very euphoric, with prices depressed, while regulators are forcing banks to keep the music down. In the most direct echo of 1999, technology is once again seen as the best party in town.
It is true that prices today are not quite as widely overvalued as in 1999. Large technology stocks are up 350 per cent this decade, the low end of the range for the hot stocks from earlier booms, which saw gains of 300 per cent to 1,900 per cent. Only a few select technology companies - mainly the Internet giants - are trading close to the valuations of the dot.com era, when the average price-to-earnings ratio for tech companies hit 50. The average ratio for that sector today is 18.
However, the scale of today's tech boom is not readily visible because much of the investment action has moved into the hands of big private players.
In 1999, nearly 550 start-ups went public, and after many ended in disaster, the government tightened regulation of public companies.
In part to avoid that red tape, this year, only 11 tech companies have gone public. Many are raising money instead from venture capitalists or private equity funds. Venture capitalists have poured more than US$60 billion (S$81.7 billion) into the technology sector every year for the past three years - the highest flows since the peak in 2000 - and private equity investors say there has never been a better time to raise money.
These new private funding channels are creating "unicorns", companies that haven't gone public but are valued at US$1 billion or more. Unicorns barely existed in 1999. Now there are more than 260 worldwide, with technology companies dominating the list. And if signs emerge that the privately owned unicorns are faltering, the value of publicly owned tech companies is not likely to hold up either.
We can never know when the end will come. Still, there are three critical signals to watch for.
The first is regulation. The tech giants are seen today as monopolising Internet search and commerce, and they are angling to take over industries such as publishing and automobiles, raising alarms at antitrust agencies in Europe and the US. Fear that new Internet technologies are doing more to waste time and brainpower than to increase productivity has already provoked a backlash in China, where officials recently criticised online gaming as "electronic heroin".
A regulatory crackdown on tech giants as either monopolies or productivity destroyers could pop the allure of tech stocks.
The other signals are more familiar. Going back to the "nifty 50" stocks of the 1960s, nearly every big market mania ended after central banks tightened monetary policy and many people who had borrowed to get in the game found themselves in trouble.
The dot.com bubble peaked in 2000, after the Federal Reserve had increased interest rates multiple times.
The current boom will likewise be at risk if an increase in inflation compels the Fed to raise interest rates beyond the modest rise the market currently expects.
Finally, watch for tech earnings to start falling short of analyst forecasts. The dot.com boom was driven in part by increasingly optimistic predictions of technology company earnings, and it imploded when earnings started to miss badly. Investors realised then that their expectations about profits from the Internet revolution had become unreal.
Of course, no two booms will unfold exactly the same way. We are now eight years into this bull market, making it the second longest in history, behind only the run-up of the late 1990s. No bull market lasts forever, and while it is clear that we are entering the late stages of this cycle, it is impossible to say whether this moment is like 1999, or 1998 - or earlier.
The clocks have no hands, and the black horsemen may appear at any time.
Ruchir Sharma, author of The Rise And Fall Of Nations: Forces Of Change In The Post-Crisis World, is chief global strategist at Morgan Stanley Investment Management.
A version of this article appeared in the print edition of The Straits Times on August 10, 2017, with the headline 'When will the tech bubble burst?'. Print Edition | Subscribe
We have been experiencing some problems with subscriber log-ins and apologise for the inconvenience caused. Until we resolve the issues, subscribers need not log in to access ST Digital articles. But a log-in is still required for our PDFs.