Plot created using MATLAB.
Blue line shows the difference in yield between 10-year bonds and 2-year bonds. Basically, shows the return on long term versus short term bonds (Source: US Treasury Department, treasury.gov)
Orange line shows the price of an S&P500 index fund (Source: Fidelity Investments)
All market crashes since 1913 have been preceded by the yield curve attaining negative slope, shown here as when the blue line dips below zero. However, not every dip below zero has been proceeded by a market crash (only 9/14 have since 1913). This only shows data as far back as 1990, but both the Internet bubble of 2001 and the Housing crash of 2008 were preceded by a negative difference in the 10 year and 2 year bonds yields.
(Note: While I collected the data and made the graph, the origin of this idea is not my own. The relationship between the yield curve and the market is a well-known phenomenon)