**6. Conclusions**

Building stock portfolios with high returns and low risk is a common challenge for researchers in the financial area. Usually, the most common practice is to select the more promising stocks according to several factors, such as financial information, news of the market and technical analysis. Several approaches that use computational intelligence algorithms have been proposed in the literature to deal with the overwhelming complexity of building a stock portfolio. Usually, these approaches consider up to three activities to build a portfolio: return forecasting, stock selection and portfolio optimization. These activities decide which stocks should be supported, as well as the proportions of the investment to be allocated to them, by comparing the historical and forecasted performance of potential stock investments. However, to the best of our knowledge, these approaches do not comprehensively address the three activities when considering downtrends in stock prices.

In this paper, a comprehensive approach to stock portfolio managemen<sup>t</sup> is proposed; the approach includes stock price forecasting, stock selection and stock portfolio optimization while taking advantage of market downtrends.

Stock price forecasting is carried out through an artificial neural network (ANN) trained by the extreme learning machine (ELM) algorithm. Forecasting the price of a given stock allows the comprehensive approach to focus on uptrends or downtrends (i.e., going long or short, respectively) for that stock. Stock selection is modeled as an optimization problem that seeks to determine the most plausible stocks; thus, a differential evolution is exploited on the basis of the forecasted price and a set of factors of the so-called fundamental analysis. Finally, portfolio optimization is conducted through a genetic algorithm that uses confidence intervals of the portfolio returns to determine the best stock portfolio.

Using preliminary experimentation, we found that the ELM was better than other methods (ANN with back-propagation, random forest, support vector regression) at forecasting the trend of the stock price but not the best at forecasting stock returns. Therefore, more research should be conducted to discover better configurations of the ANN with ELM or to decide if the forecasting stage should be changed. However, further research on this, as well as on methods to increase the performance of the next stages of the comprehensive approach, is beyond the scope of this work, so the authors will address these issues in future works.

Regarding the assessment of the comprehensive approach, the obtained results show that stock selection and portfolio optimization stages make more profitable portfolios when negative trends of stocks are taken into account to take advantage of downtrends of the market (see Table 2 and Figures 3 and 4). Furthermore, the results show that not only a traditional benchmark, the Standard and Poor's 500 index, is outperformed by the proposed approach but also approaches that do not exploit negative market trends (e.g., [10,12]).

This research work could be improved by the following possible future directions:


**Author Contributions:** Conceptualization, E.S. and V.d.-L.-G.; methodology, E.S.; software, E.S., F.G.S. and V.d.-L.-G.; validation, F.G.S., E.S. and V.d.-L.-G.; formal analysis, F.G.S. and R.D.; investigation, R.D.; resources, R.D.; data curation, V.d.-L.-G. and F.G.S.; writing—original draft preparation, E.S.; writing—review and editing, F.G.S. and V.d.-L.-G.; visualization, R.D. and V.d.-L.-G.; supervision, R.D. and F.G.S.; funding acquisition, R.D. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by Instituto Tecnológico y de Estudios Superiores de Monterrey, and by the Mexican National Council of Science and Technology (CONACYT) gran<sup>t</sup> number 321028, and by SEP-PRODEP México gran<sup>t</sup> numbers UACOAH-PTC-545 and UACOAH-CA-479. The APC was funded by Instituto Tecnológico y de Estudios Superiores de Monterrey.

**Acknowledgments:** The work of Raymundo Díaz was supported by the vice president of Research of Tecnológico de Monterrey. Efrain Solares thanks the Mexican National Council of Science and Technology (CONACYT) for its support to project no. 321028 and SEP-PRODEP México for its support under gran<sup>t</sup> UACOAH-PTC-545. Francisco G. Salas and Víctor De-Leon-Gomez were supported by SEP-PRODEP México.

**Conflicts of Interest:** The authors declare no conflict of interest.
