A new version of the Q test, based on generalized residual correlations (i.e. auto-correlations and cross-correlations), is developed in this paper. The Q test fixes two main shortcomings of the Mcleod and Li Q (MLQ) test often used in the literature: (i) the test is capable to capture some interesting non-linear models, for which the original MLQ test completely fails (e.g. a non-linear moving average model). Additionally, the Q test also significantly improves the power for some other non-linear models (e.g. a threshold moving average model), for which the original MLQ test does not work very well; (ii) the new Q test can be used for discrimination between simple and more complicated (non-linear/asymmetric) GARCH models as well