When the yield curve inverts, a recession is not far behind.
This is because of the nature of banks. The duration of how they borrow and lend. Typically, when the yield curve inverts a recession follows sometime in the next 2 years. Here is a close up before 2008:
The yield curves inverted in 2006. The market peaked in late 2007, but the real plunge didn’t start until mid 2008.
Similar events took place in 2001:
If you look at past inversions, the stock market tends to have the greatest returns (about 20%) between the point of inversion and the top of the market. I still believe there are further gains to be had in US stocks. I do not see any signs of stress at the moment.