*5.4. Results*

The proposed approach uses components that exploit randomness to explore the search space. Here, we intend to discard the effects produced by such randomness by running our approach many times; particularly, each stochastic component runs twenty times for each of the thirty back-testing periods mentioned in Section 5.1. Doing it this way sheds light on the robustness of our approach and allows us to reach sound conclusions. By following the recommendations in [88], the performance of our approach is evaluated by using the quantiles *Q*10, *Q*20, *Q*50 (median), *Q*80 and *Q*90 (see Figure 1). As is noted in [88], distribution solutions of stochastic optimization algorithms are often asymmetrical; hence by using quantiles, we could obtain more insights into our approaches. However, Figure 1 shows that, in our case, *Q*50 and the mean are almost always overlapped. Furthermore, (*Q*10, *Q*20) and ( *Q*80, *Q*90) are symmetrical with respect to the mean. This behavior indicate that the performance of our approach is practically normally distributed.

Therefore, in this study, the average returns of our approach is used to be compared with several benchmarks, as shown in Table 1 and Figure 2. For simplicity, the results are discussed hereafter as if the returns were not averages. In order to validate our approach,

in this section, we have included several benchmarks to measure the effectiveness of our proposal. These benchmarks are: (a) the market index S&P500, (b) the approach of [10], (c) the approach of [12] and (d) our approach without including downtrends.

From Table 1 and Figure 2, we can see that, in terms of the expected value, the worst overall return was produced by investing according to the S&P500 index, while the best overall return was achieved by investing in a portfolio produced by the proposed approach that takes advantage of both positive and negative trends. Figure 2 shows that the portfolio that considers negative trends is almost always in the top two from all the approaches. Furthermore, the returns obtained using this approach show that this model is not affected by the downtrends in the market as the benchmarks, as seen in the fall of all approaches from Jan 2020 to Mar 2020. Remarkably, this behavior did not prevent the proposed approach from exploiting the clear overall uptrend produced from Apr. 2020 to Apr. 2021, as can be clearly seen in Table 1.

**Figure 1.** Monthly returns of our approach for the mean and several quantiles.

**Figure 2.** Monthly returns comparison.


**Table 1.** Returns produced per period. In the case of the algorithms, the return is averaged in twenty runs.

From Table 2, we can see that the proposed approach outperforms the benchmarks at the end of the thirty periods: the sum of returns is approximately 41% better than Yang et al. 2019 ([10]), 25% better than Solares et al. 2019 ([12]), 48% better than the one that only considers positive trends and more than 90% better than the market index. Moreover, the cumulative returns of our proposal is 63% better than Yang et al. 2019 ([10]), 35% better than Solares et al. 2019 ([12]), 75% better than the one that only considers positive trends and 141% better than the market index. This performance can be seen in Figures 3 and 4.

Both Figures 3 and 4 describe the evolution of the portfolio returns in an aggregate way throughout the whole time lapse (i.e., November 2018 to April 2021). However, Figure 3 shows this evolution from the perspective of the sums of the returns, while Figure 4 shows the cumulative returns. Both figures can be relevant to the practitioner. The former shows the overall performance of the approach without considering the exact period where the return was obtained, while Figure 4 allows one to ponder the impact of the period where such a return was obtained. Let us unfold the latter. Figure 4 shows the amount that the investor would obtain if he/she takes their investment in a given period. For instance, an investment of USD 1000 at the beginning of November 2018 using the proposed model would have become USD 992 (i.e., −0.80%) if the investor would have withdrawn the investment at the end of May 2019. However, if he/she continues until April 2021, the investment would have become USD 1952 (i.e., +95.28%). In this sense, it is clear that the proposed approach outperformed the benchmarks by creating a portfolio that includes long and short positions. This result shows the potential of our proposal, which could be improved in future approaches by including stocks from other indexes, more technical/fundamental variables, etc.

In both Figures, it can be seen that, for the first fourteen periods (November 2018 to December 2019), the market does not move significantly in any direction; however, for the remaining periods, the market starts both negative and positive trends. A higher final return achieved by our proposal indicates that it is taking advantage of these trends overall. These results also show that considering negative trends is crucial. The figures show that the final average return is better if negative trends are considered when building stock portfolios.

**Table 2.** Sum of returns and cumulative returns. In the case of the algorithms, the return is averaged over twenty runs.


**Figure 3.** Sum of returns comparison.

According to Figure 2 and Table 1, the worst return obtained by our approach was in Dec 2018. This is also shown in Figure 4, where the detriment is caused by the higher negative return produced in this period. In that moment, the system decided to open long positions and allocate high proportions of investments to some stocks with bad actual returns. This was due to the good historical performance of such actions that indicated a good statistical behavior. Several external issues affect the performance of a stock in the market, such as the case of Nvidia corporation as reported in the news [89]. Thus, a way of improving the proposed system in the future is by considering criteria coming from the so-called sentiment analysis [90] that takes into consideration such factors.

On the other hand, as a way of measuring the performance of our proposal and comparing the results with some benchmarks, the Sharpe ratio *rsharpe* and Sortino ratio *rsortino* are used. These ratios are defined as

$$r\_{sharpre} = \frac{R\_P - R\_f}{\sigma\_P}$$

and

$$r\_{sontino} = \frac{\mathcal{R}\_p - \mathcal{R}\_f}{\sigma\_{pl}}$$

where *Rp* is the average portfolio return, *Rf* is the best available risk-free security rate, *<sup>σ</sup>p* is the portfolio standard deviation and *<sup>σ</sup>p*,*<sup>d</sup>* is the portfolio standard deviation of the downside. These indexes measure the risk per return obtained in comparison with a riskfree asset. In particular, the Sharpe ratio describes how much return is received per unit of risk; meanwhile, the Sortino ratio describes how much return is received per unit of **bad** risk. Therefore, the higher these indexes are, the more convenient for investment the asset is. We have considered the Treasure Bond of USA a risk-free security, with a value of 3% of annual return. We also considered the Treasure Bond of USA as the minimal acceptance ratio (MAR) to compute the downside deviation. *Rp*, *<sup>σ</sup>p* and *<sup>σ</sup>p*,*<sup>d</sup>* are taken from Table 1. Table 3 shows the Sharpe and Sortino ratios for the all the benchmarks and our proposal. According to the results, our proposal has the best performance for both indexes; overall, it has higher returns by considering the risk.


**Table 3.** Comparison of benchmarks with the proposal by using the Sharpe and Sortino ratios.
