Technical trading rules have a long history of being used by practitioners in financial markets. Their profitable ability and efficiency of technical trading rules are yet controversial. In this paper, we test the performance of more than seven thousands traditional technical trading rules on the Shanghai Securities Composite Index (SSCI) from May 21, 1992 through June 30, 2013 and Shanghai Shenzhen 300 Index (SHSZ 300) from April 8, 2005 through June 30, 2013 to check whether an effective trading strategy could be found by using the performance measurements based on the return and Sharpe ratio. To correct for the influence of the data-snooping effect, we adopt the Superior Predictive Ability test to evaluate if there exists a trading rule that can significantly outperform the benchmark. The result shows that for SSCI, technical trading rules offer significant profitability, while for SHSZ 300, this ability is lost. We further partition the SSCI into two sub-series and find that the efficiency of technical trading in sub-series, which have exactly the same spanning period as that of SHSZ 300, is severely weakened. By testing the trading rules on both indexes with a five-year moving window, we find that the financial bubble from 2005 to 2007 greatly improve the effectiveness of technical trading rules. This is consistent with the predictive ability of technical trading rules which appears when the market is less efficient.