Using a database of the trading data in the Chinese stock market over January 2005 to June 2012, this paper studies the stock market crisis based on the perspective of behavioural finance. Investor sentiment is based on B‐W method, and the possibility of the Shanghai stock market crisis was predicted by the logit model. The empirical results show that investor sentiment, which is more significant than the macroeconomic variables, has a significant positive impact on stock market crisis after controlling for the economic variables. Moreover, our results offer an empirical explanation for the financial anomaly of mean reversion. Both in‐sample and out‐sample data tests show that the logit model with investor sentiment is able to predict stock crises.