It's official: We are enjoying the longest bull market in stocks in history.

The last time stock prices declined significantly, and stayed down for very long, was in the depths of the global financial crisis nearly a decade ago.

Since the bull began its current run, the value of all publicly traded stocks has soared more than threefold to a record near $30 trillion. To put this wealth into context, consider that the economy's annual GDP — the value of everything we produce — is about $20 trillion.

Stock prices are up because the profits of U.S. companies are up, powered by the growing global economy. The current economic expansion is as impressive as the bull market. It, too, is on track to set longevity records.

Very low interest rates have also been a big plus for stocks. Since the crisis hit, the Federal Reserve has taken unprecedented actions to support the economy, including pushing short-term interest rates to zero for several years. Global investors who earned little to no interest on their deposits and bonds have looked to stocks for a meaningful return.

Massive corporate tax cuts at the start of this year have also been a windfall to companies and their shareholders. Taxpayers cut businesses a huge check, and businesses have used much of their newfound cash to buy back shares and to pay bigger dividends, both of which support stock prices.

Some stock investors may also be cheered by the Trump administration's anti-regulation stance. Less environmental regulation has buoyed the stocks of fossil-fuel companies, while the pullback on regulation of the financial system has supported bank stocks.

You may be thinking my historical analysis of the bull market is all well and good, but what now? When will the bull market end? Is this still a good time to invest in stocks?

For those of you who have yet to celebrate your 50th birthday, these questions are mostly irrelevant. You should save as much as you can, invest a significant amount in stocks, and don't touch that investment for at least a decade. Stock prices will go up, down, and all around, but if you stick it out, you will make out.

For baby boomers — those in their 50s and 60s — these are critical questions, particularly if you are retired or plan to retire any time in the next few years. And, in my humble opinion, this would be a good time to become more cautious investing in stocks.

Boomers appear to be holding on to their stock investments for much longer than their parents or grandparents did at the same age. This may be because many boomers haven't saved enough for retirement, and they've gambled that the stock market will bail them out. This seemed the best bet as returns on other investments fell well short. Even their homes looked like a shaky investment not long ago.

I don't know when this bull market will end, but I'm confident its best days are behind it. Indeed, I suspect stock prices several years from now will be roughly where they are today, with big price swings in between.

The market is richly valued. That is, investors, very optimistic that companies making lots of money will soon be making lots more, have been willing to pay up for stocks. This is especially true with regard to a handful of high-flying technology firms. But achieving investors' euphoric forecasts for these companies will be a stretch.

The most immediate threat to the bull market is President Trump's trade war. Higher tariffs are very bad for business, particularly for the large multinational corporations that are the darlings of stock investors. Investors have so far looked past the escalating trade tensions, but that won't last much longer if Trump follows through on his threats.

An arguably even more mortal threat is the prospect of an overheated economy. With fiscal stimulus — the deficit-financed tax cuts and increases in government spending — juicing up growth, businesses are scrambling to fill a record number of open job positions. Labor costs are set to pick up, cutting into businesses' profit margins.

The Fed, nervous that businesses' will raise prices for their wares too quickly, has articulated a clear script for increasing interest rates through at least next year. By raising rates, the Fed has put a dagger into the heart of most past bull markets. It is likely to do the same to this one. This seems most likely to occur once the stimulus fades, which under current policy will happen early in the next decade.

Bull markets typically unravel into bear markets several months before economic recessions hit. Investors anticipate the negative consequences of the downturn on corporate profits, and they dump their stocks.

If this bull market's demise is coming into view, so, too, is the next recession.