The stock market is partying like it’s 1999, and for exactly the opposite reason. Last week the S&P 500, Dow Jones Industrial Average and Nasdaq Com posite hit a synchronized high for the first time since the eve of the millennium. America’s most valuable company is a tech stock (Apple today, Microsoft back then). The tech sector is back above a fifth of S&P 500 market capitalization, and just as then bears worry that the market is overvalued, although not by anywhere near as much.

In 1999, wild optimism was elevating the market as investors piled into anything with “.com” after its name—leading to a rash of stock-price-boosting name changes. Investors punished dividend payers for not having enough ways to spend money on transformative tech. The number of clicks beat cash flow as an investment tool.

The contrary is true this year. Wild pessimism about the global economy has led investors to chase dividend payments, demand buybacks and punish companies that invest. Cash is king.

And yet, the market rises. “Nobody seems to be particularly optimistic about much of anything and yet the stock market in the U.S. seems to do nothing but go up,” said Ben Inker, co-head of asset allocation at Boston fund manager GMO.

The theoretical justification for higher prices now, as it was then, comes from the dividend discount model. This states that the value of a stock is the total of all future dividends, discounted back into today’s money. The bubble mentality of the dot-com era made earnings forecasts all but redundant, but the hope was for big profits one day, which eventually translate into dividends to justify the price.