The bond market is edging closer to signaling a recession, but don't panic yet. Stocks could have a lot more room to run even if the feared "yield curve" inverts, history shows.

The spread between the 3-month Treasury bill and the 10-year note went into negative territory on Friday, the first time since 2007. The more widely watched part of the curve — the gap between yields on the 2-year and 10-year debt — is getting closer to inversion as well, falling to just 10 basis points, versus 60 basis points a year ago. The yield curve has been a reliable recession indicator in the past.

This occurred after the Federal Reserve this week downgraded the U.S. economic outlook and signaled no rate hikes this year, worrying bond traders that a possible recession is in the near future.

However, if history is any guide, equity investors shouldn't worry in the near term. In fact, stocks rose about 15 percent on average in the 18 months following inversions, according to a Credit Suisse analysis last year. The data show the stock market tends to turn sour about 24 months after the yield curve inverts. Three years after an inversion, the S&P 500 is up just 2 percent on average as stocks take a hit on recession fears.