A theory of Efficient Market Hypothesis (EMH) has been introduced by Fama to analyse financial markets. In particular the EMH theory has been proven in real cases under different conditions, including financial crises and frauds. The EMH assumes to examine the prediction accuracy of models designed on retrospective data. Such prediction models could be designed in different ways that motivated us to explore Machine Learning (ML) methods known for building models providing a high prediction performance. In this study we propose a ``deep'' learning method for building high-performance prediction models. The proposed method is based on the Group Method of Data Handling (GMDH) that is the deep learning paradigm capable of building multilayer neural-network models of a near-optimal complexity on given data. We show that the developed GMDH-type neural network has outperformed the models built by the conventional ML methods on the Warsaw Stock Exchange data. It is important that the complexity of the designed GMDH-type neural-networks is defined by the number of layers and connections between neurons. The performances of models were compared in terms of the prediction errors. We report a significantly smaller prediction error of the proposed method than that of the conventional autoregressive and "shallow’’ neural-network models. This finally allows us to conclude that traders will be advantaged by the proposed method.