1. Introduction
In finance, applying the diversification of assets that make up an investment portfolio aims to maximize profits and minimize risk. The mean-variance portfolio integration model developed by Harry Markowitz in 1952 has been a widely accepted tool for asset portfolio integration [
1]. Markowitz’s portfolio theory states that the investor should analyze the portfolio as a whole, studying the characteristics of risk and global return. The participation of each asset is chosen based on its expected return. In other words, volatility is treated as a risk factor, and the portfolio is integrated, considering the risks and seeking the maximum level of profitability available [
2]. Some investigations have expanded the work of the Markowitz model, such as the mean semi-variance model [
3], mean objective model [
4], and portfolio optimization models with fuzzy logic [
5]. Different metaheuristics algorithms have been applied to solve difficult problems, and recently important overviews have been published regarding these types of problems [
6,
7,
8]. The reason for employing these algorithms is that they obtain suitable solutions within reasonable execution times [
9]. For instance, a two-stage multi-attribute portfolio analysis framework using genetic algorithms (GA) to solve a multi-attribute portfolio selection problem was proposed [
10]. Moreover, Genetic Algorithms have been used for selecting and evaluating investment portfolios [
11]. As seen in [
12], the mean-variance approach was used as a reference to propose a new model which included different constraints, using GA as an optimization method. Chen et al., applied machine learning algorithms to predict asset values of the Shanghai stock market; they used a GA to solve a multi-objective optimization problem [
13]. Pekar et al., used differential evolution (DE) to solve the portfolio selection problem [
14]; where they employed the Omega function and Sortino ratio to measure the portfolio’s risk based on the Sharpe Ratio. Presently, DE algorithms have been applied in several portfolio applications: Dow Jones [
14], S&P, BOFA, Frank Russell, MSCI [
15], and National Stock Exchange [
16]. The use of DE combined with other methods has increased the quality of results [
15,
17]. Notably, in a previous study [
15], the following algorithms were evaluated: NSGA-II, Differential Evolution (GDE3), SMPSO, and SPEA2; where SPEA and Differential Evolution were reported as the best algorithms. A modified Particle Swarm Optimization (PSO) method is used in different indexes such as S&P 100, Hang Seng, DAX 100, FTSE 100, and Nikkei [
18]; the mathematical model includes bounding and cardinality constraints. A Firefly Algorithm (FA) and an Imperialist Competitive Algorithm (ICA) are used to select the best set of assets using the mean semi-variance approach as the objective function [
19]. In [
20] a hybrid algorithm was proposed that combines Ant Colony Optimization (ACO), Artificial Bee Colony (ABC) optimization, and GA for solving the cardinality constrained portfolio optimization problem.
Different classical and hybrid methods or techniques for portfolio integration have been applied, such as Threshold Accepting (TA) and Simulated Annealing (SA). TA was used to select sets of assets that minimized portfolio risks [
21,
22] and optimized tracking errors [
23]. Chang et al., [
24] attempted to find the efficient frontier by using GA, TA, and SA over several stock markets (DAX, FTSE, S&P, and Nikkei). Fogarasi and Levendovszky [
25] explored a solution to sparse mean reverting portfolio selection using a Greedy method and an SA algorithm. In [
26], the following algorithms were used: GA, Genetic network programming (GNP), SA, and PSO. In [
27], the quality of SA and GA in rectifying this problem was performed by adding an aversion risk coefficient to the Markowitz model. The results were similar; however, SA obtained shorter runtimes. Wang et al., used a modified Generalized Simulated Annealing GSA and the Sharpe Ratio to construct optimal portfolios; they used stocks from S&P 500 [
28]. A High-Speed Hill-Climbing algorithm, called HC-S-R, was proposed for the DAX stock exchange in [
29]; where they applied a similar acceptance criterion to TA and reported better results than the classical algorithm. In [
30], the Archive Multi-objective Simulated Annealing (AMOSA) was used to solve the two objectives of the mean-variance model with eight stock indexes that included NASDAQ, S&P 500, FTSE 100, and Hang Seng. In [
31], a hybrid FA–SA algorithm was proposed; the experimental results showed this algorithm performed better than FA, SA, GA, and PSO when the transaction costs were considered. Kumar et al., applied a modified SA combined with ABC, Radial Basis Function Network (RBFN), and an Artificial Neural Network (ANN); where they integrated portfolios with stocks from NSE [
32]. SA, GA, and Quantum Annealing was applied in [
33], with stocks from S&P 500, Nasdaq, Russel 2000, and Wilshire 5000.
The algorithms GENPO, SAIPO, and TAIPO proposed in this work are based on the Genetic Algorithm (GA), Simulated Annealing (SA), and Threshold Accepting (TA). These proposed algorithms use the closing prices of the assets to calculate the indicators to obtain the Sharpe Ratio (SR) [
34] value of the portfolio, which is used as an evaluation function in the search process of the algorithms. The algorithms used are focused on portfolio integration and aimed at both diversification of assets and minimization of portfolio risks; this was achieved through the model proposed by Sharpe [
35] and is standard in using the correlation between candidate assets [
36,
37]. In addition, a constraint was used that allowed for the consideration of only the assets that had an expected return equal to or greater than the Minimum Acceptable Rate of Return (MARR). To test the proposed algorithms, assets from the Mexican Stock Exchange were used, then results were compared with the hybrid algorithms developed by the mathematical models of related works.
The rest of this paper is organized as follows. In
Section 2, we review the related models, including the Markowitz model. Moreover, we describe the classical Simulated Annealing, Threshold Accepting, and Genetic Algorithms. In
Section 3, the algorithms proposed in this work are described. In
Section 4, we present the experiments and results. Finally, in
Section 5, the conclusions of this work are presented.
3. Proposed Algorithms
The three algorithms proposed in this work, GENPO [
49], SAIPO, and TAIPO, are described in this section. These algorithms use optimization heuristics for obtaining the stocks and then integrating the portfolio that is modeled as an optimization problem. GENPO uses a Genetic Algorithm, SAIPO uses a Simulated Annealing Algorithm, and TAIPO uses a Threshold Accepting Algorithm.
3.1. Mathematical Model for the Evaluation Function
The Sharpe Ratio (
SR) is a financial metric proposed by W. Sharpe [
34]. This financial ratio indicates how suitable an investment is concerning its risk. This ratio can be used to determine which investment obtains the greatest return with the same risk. In other words, it determines the additional return achieved by investing in riskier financial assets.
SR is calculated with Equation (23).
where
is the portfolio’s expected return,
is the
MARR (Minimum Acceptable Rate of Return), and
represents the portfolio’s risk. The
MARR parameter means that any stock (or investment) should not be part of the portfolio if it does not surpass it.
Sharpe Ratio (SR) is based on the Markowitz model, and it is assumed that there are adequate statistics for determining: (a) the expected value of the shares and (b) the standard deviation (the risk measure) of the asset value over a given period. On the other hand, the problem of selecting the best stocks from a specific market can be formulated as those that maximize the expected return and, at the same time, minimize the risk value of the portfolio; a practical alternative centers on finding stocks which maximize the Sharpe ratio. This strategy allows the discovery of portfolios with assets from different financial areas selected when the SR is maximized.
The proposed model represented by Equation (24) seeks to maximize the Sharpe Ratio, subject to the expected value of the portfolio being greater or equal to the MARR ratio.
where
is the expected return of the portfolio,
is the expected return of asset
, and
is the weight of the asset
in the portfolio. This model includes a constraint shown in Equation (25), that allows only assets with an expected return equal to or greater than the MARR to be included in the portfolio. The MARR parameter is represented here by
γ. As mentioned before [
49], maximizing the value of the Sharpe Ratio allows solving the problem of two objectives in one. However, it is an NP-hard problem; thus, finding the optimal solution is not an easy task. We used Equation (26) to estimate the risk of the portfolio, while the average correlation of the portfolio was obtained with a simple process [
37]. This correlation is provided in Equation (27), and we used it to check that the correlation of the entire portfolio had a low value. In [
50], the correlation between assets and bonds was analyzed. Similarly, a previous study [
37] used a strategy to evaluate portfolios and risks from different portfolios.
The interpretation of Equation (27) is as follows: if the portfolio has little diversification; on the other hand, if the portfolio is highly diversified.
The portfolio solution found with the model implemented in this paper, contained the weighted values of the assets ; the expected value portfolio’s and its risk , in addition to the Sharpe Ratio and average correlation of the portfolio . This model and the implemented algorithms aim to find a balance between the expected value and the portfolio’s risk. Moreover, the implemented algorithms seek to find an equilibrium between the Sharpe metric and the managing portfolio risk.
3.2. Genetic Portfolio Optimization Algorithm (GENPO)
Algorithm 4 shows the structure of the GENPO algorithm. This is a Genetic Algorithm where the initial population is conformed randomly by a set of weights in the range (0,1); additionally, the summation of these weights should be one. The fitness function was previously shown in Equation (24), and is applied for each population generated by the algorithm. Then, the subsequent generations are generated, choosing one or two solutions, depending on the genetic operator used: crossover or mutation, respectively.
Algorithm 4. GENPO |
1: | Begin /* GENPO */ |
2: | Set first gen |
3: | Generate initial population (portfolio) |
4: | Compute Sharpe Ratio (SR) evaluation initial for each individual SR(i) |
5: | While Converge = False or i < MaxGen do |
6: | Begin /* Produce new generation */ |
7: | Begin /* Reproductive cycle */ |
8: | Select two individuals (portfolios), X1 y X2 of P(i), |
9: | Crossing point random selection. |
10: | Cross X1 y X2 getting two offspring Xh1, Xh2. |
11: | Insertion Xh1 y Xh2 in P(i) |
12: | Mutation random τ elements of P(i); |
13: | Compute fitness function (i) of τ elements, |
14: | Order individuals best evaluated in P(i). |
15: | Limit the population to its original size. |
16: | End |
17: | Save best individual of the population P(i) |
18: | If SR(i + 1) < SR(i) + tolerance then //* if SR doesn’t grow enough *// |
19: | gamma = gamma + 1 //* gamma counter grow *// |
20: | If gamma >= conv then //*conv=generations number without improv SR *// |
21 | Convergence=TRUE |
22: |
End |
23: |
End while |
24: | i = i + 1 |
25: | If i > MaxGen then |
26: | Converge: = TRUE |
27: | End |
From lines 1 to 5, a population is generated using a random number in the range (0,1).
The fitness Sharpe Ratio (SR) is the fitness function based on Sharpe Ratio described in Equation (24). Moreover, it establishes the population size and the generations.
Lines 6 to 16 integrate the selection step. Two individuals from the population are evaluated by the fitness function and two individuals from the binary tournament, evaluating from the higher expected value.
In the Crossover step, the values (the portion of assets) are randomly selected to generate offspring from the selected individuals in the previous step. These offspring could be part of the population depending on their SR. They are sorted from highest to lowest. The last two individuals are discarded from the population to retain the population size. From line 17 to the end, lays up the best individual from each generation to store their variables and performance.
The best individual from generation i is compared with the previous individuals of generation i − 1. The process is repeated each time a new population is generated. This process is performed to determine if the number of generations achieves the maximum permitted number without enhancement, which is used as a stop criterion.
The result of the algorithm is a portfolio with the best assets and the investment proportion applied in each one. This combination of assets has the best profit–risk ratio and the lowest correlation, leading to the highest portfolio diversification.
3.3. Simulated Annealing for Investment Portfolio Optimization (SAIPO)
The SAIPO algorithm uses the negative value of the Sharpe Ratio, shown in Equation (24), as the objective function.
SAIPO (Algorithm 5) receives as initial parameters (line 1) an initial temperature (
), final temperature (
), a cooling rate
, an internal cycle length
, and an internal cycle increment coefficient
. In line 2, a random initial solution is generated, represented by
, defined as a portfolio with random weights. Then, in line 3, the negative value of the Sharpe Ratio is calculated. In line 4, the current temperature
takes the value of the initial temperature
. In line 5, the main cycle begins, which is executed until the current temperature is greater than or equal to the final temperature. In line 6, the Metropolis cycle begins. In line 7, a new solution is generated by applying a perturbation to the current solution. This new solution is compared with the existing solution, then calculating the difference between both solutions in line 8. When this difference is negative (line 9), the new solution is accepted in line 10; if this new solution is better than the best previously found, it is accepted as the best global solution in line 12. Alternatively, if the difference is greater or equal to zero, the new solution is accepted by applying the Boltzmann acceptance criterion in line 14. In line 19, the number of iterations of the Metropolis cycle (
) increases, multiplying its previous value by
. In line 20, the current temperature
is decreased by multiplying its value by the
value. Finally, in line 22, the Sharpe Ratio is calculated by multiplying its negative value by −1. Lastly, in line 23, the output of the algorithm is generated.
Algorithm 5. SAIPO |
1: | Parameters ( |
2: | Generate random initial solution |
3: |
|
4: | |
5: | while do |
6: | while do |
7: | ; |
8: |
|
9: | if then |
10: | ; |
11: | if then |
12: | ; |
13: |
end if |
14: | else if random (0,1) then |
15: | ; |
16: |
end if |
17: |
|
18: |
end while |
19: |
|
20: |
|
21: |
end while |
22: |
|
23: | return |
24: | end SAIPO |
Based on the neighborhood structure method presented in [
23], in this work, a perturbation is applied to generate a neighbor solution
close to the current solution
. This procedure is detailed in Algorithm 6.
Algorithm 6. Perturbation Procedure |
1: | Parameters () |
2: | Select two assets and randomly |
3: | If then |
4: |
|
5: | else if then |
6: |
|
7: |
|
8: |
end if |
9: |
|
10: |
|
In line 2, two assets and with weights and are randomly selected. Then, a quantity is subtracted from asset in line 4, and the same quantity is added to asset in line 9. Therefore, the weight of asset in the portfolio, when the neighbor solution is generated, will be , and the weight of asset will be . This quantity is obtained by experimentation.
3.4. Threshold Accepting for Investment Portfolio Optimization (TAIPO)
Algorithm 7 shows the TAIPO algorithm that shares the same structure as SAIPO. These two algorithms have a temperature cycle and a Metropolis cycle. TAIPO has an additional parameter in line 1: a decreasing tolerance rate
. As in SAIPO, in the TAIPO algorithm, a perturbation is applied to the current solution to generate a new solution in line 7. However, in this algorithm, if the new solution is worse, the current solution is replaced if the difference does not exceed a certain tolerance (
Tol) or threshold (line 9), which decreases by multiplying its previous value by
in line 17. In the beginning,
Tol has a value equal to
(line 4), which implies that at high temperatures, the new solution will be generally accepted as the current solution. That is, during the processing of 90% of temperatures,
Tol has the same value of
; in this case,
is equal to 1. For the remaining temperatures,
takes the value of 0.96, obtained by experimentation, making the process more restrictive in the last iterations [
46].
Algorithm 7. TAIPO |
1: | Parameters ( |
2: | Generate random initial solution |
3: | |
4: | |
5: | while do |
6: | while do |
7: | |
8: | |
9: | if then |
10: | ; |
11: | if then |
12: | ; |
13: |
end if |
14: |
end if |
15: |
|
16: |
end while |
17: |
|
18: |
|
19: |
|
20: | end while |
21: | SR = − |
22: | return SR, |
23: | end TAIPO |
In this work, we used the classic TA algorithm and compared its performance with the algorithms proposed. As described in Algorithm 3, TA used a threshold sequence. The procedure shown in Algorithm 8, which is based on the method proposed in [
23], was used to generate this sequence.
Algorithm 8. Generation of Threshold Sequence |
1: | Initialize |
2: | for i = 1 to do |
3: | |
4: | // Generate neighbor solution |
5: | |
6: | end for |
7: | Sort and use as Threshold Sequence |
In line 1, the size of the sequence is declared, which will be equal to the number of iterations of the TA classic algorithm. In line 3, a random solution is generated, then in line 4, a neighbor solution is generated, applying the perturbation described in Algorithm 6. In line 5, the difference between the new solution and the current solution is calculated. This process is repeated until the given number of iterations is generated. Finally, these differences are ordered from highest to lowest in line 7.
3.5. Proposed Algorithms Hybridized with Related Models
The Sharpe Ratio (Equation (24)) is regularly used as the objective function of GENPO, SAIPO, and TAIPO. To compare the performance of the algorithms proposed in this work with the related works described previously, we developed three hybrid algorithms using the last algorithm but replaced the objective function with that used by the reference models of Gilli, Yu, and Masese. These three hybrid algorithms are named: GENPO-X, SAIPO-X, and TAIPO-X, where X is the name of a reference model.
Hybrid Pseudocodes
The SAIPO Hybrid Algorithm shown in Algorithm 9 has a similar structure to the single SAIPO of Algorithm 5. In the beginning, the initial parameters are specified in line 1. Then, the objective function is defined in line 2. There are three alternatives or different models. Used in line 3 is the model presented in [
10], the Yu model, shown in Equation (17). On the other hand, to use the Gilli model [
21] calculated with Equation (18), it is necessary to compute the penalty
, established with Equation (19). This process is shown in lines 4–8. Finally, the function of the Masese model [
22], calculated with Equation (20), is presented in line 10.
After selecting the model, a random feasible solution is generated in line 11. Then, the temperature cycle begins in line 13, and the Metropolis cycle begins in line 14. The Sharpe ratio is calculated at the end of the algorithm (lines 29–30). The rest of the process and parameters are similar to SAIPO.
Algorithm 9. SAIPO Hybrid Algorithm |
1: | Parameters ( |
2: | Define objective function |
3: | if then end if //Objective function for Yu model |
4: | else if then |
5: | |
6: | if then end if |
7: | else |
8: | //Objective function for Gilli model |
9: | end if |
10: | else if then end if //Objective function for Masese model |
11: | Generate a random feasible solution |
12: | ; . |
13: | while do |
14: | while do |
15: | ; |
16: | ; r = random (0,1) |
17: | if . then |
18: | ; |
19: | if then ; end if |
20: | else if then |
21: | ; |
22: |
end if |
23: |
|
24: | end while |
25: | ; |
26: | |
27: | end while |
28: | ; |
29: | |
30: | return , , SR |
31: | end SAIPO Hybrid Algorithm |
Algorithm 10, TAIPO Hybrid Algorithm, is similar to the SAIPO Hybrid Algorithm, changing the new solutions acceptance criterion, as shown in line 16.
Algorithm 10. TAIPO Hybrid Algorithm |
1: | Parameters ( |
2: | Define objective function |
3: | if then end if //Objective function for Yu model |
4: | else if then |
5: | |
6: | if then end if |
7: | else |
8: | //Objective function for Gilli model |
9: | end if |
10: | else if then end if //Objective function for Masese model |
11: | Generate a random feasible solution |
12: | ; |
13: | while do |
14: | while do |
15: | ; |
16: | if then ; |
17: | if then ; end if |
18: | end if |
19: | |
20: | end while |
21: | |
22: | |
23: | |
24: | end while |
25: | ; |
26: | |
27: | return , , SR |
28: | end TAIPO Hybrid Algorithm |
Algorithm 11 illustrates the procedure of the GENPO Hybrid Algorithm. As with TAIPO and SAIPO hybrid algorithms, the fitness function is defined in line 4. In line 6, the
Yu model is used as presented in [
10], computed with Equation (17). On the other hand, the process behind the
Gilli model [
21] shown in Equations (18) and (19) is described in lines 9–14. Finally, the function of the
Masese model [
22], shown in Equation (20), is presented in lines 15–17. The remainder of the process is the same as in the GENPO algorithm.
Algorithm 11. GENPO Hybrid Algorithm |
1: | Begin /* GenPO */ |
2: | Set first gen |
3: | Generate initial population (portfolio) |
4: | Define objective function |
5: | if then |
6: |
|
7: | end if //Objective function for Yu model |
8: | else if then |
9: | |
10: | if then |
11: | end if |
12: | else |
13: | //Objective function for Gilli model |
14: | end if //Objective function for Gilli model. |
15: | else if then |
16: | |
17: | end if //Objective function for Masese model |
18: | While Converge = False or i<MaxGen do |
19: | Begin /* Produce new generation */ |
20: | Begin /* Reproductive cycle */ |
21 | Select two individuals (portfolios), X1 y X2 of P(i), |
22: | Crossing point random selection. |
23: | Cross X1 y X2 getting two offspring Xh1, Xh2. |
24: | Insertion Xh1 y Xh2 in P(i) |
25: | Mutation random τ elements of P(i); |
26: | Compute fitness function (i) of τ elements, |
27: | Order individuals best evaluated in P(i). |
28: | Limit the population to its original size. |
29: | End |
30: | Save best individual of the population P(i) |
31: | If (i + 1) < (i) + tolerance then //* if SR doesn´t grow enough *// |
32: | gamma = gamma + 1 //* gamma counter grow *// |
33: | If gamma >= conv then //* conv = generations number without improv SR *// |
34: | Convergence = TRUE |
35: | End |
36: | End while |
37: | i = i + 1 |
38: | If i>MaxGen then |
39: | Converge: = TRUE |
40: | End |
4. Results
The experiments performed with the algorithms presented in this paper, and the comparison with the hybrid algorithms described previously are shown in this section. To perform analytical tuning for SAIPO and TAIPO algorithms, some previous executions were required. Moreover, we showed the parameters used for those executions in
Table 2.
4.1. Experiments
To test all algorithms, we used a dataset with 47 stocks taken from the Mexican Stock Exchange. The period evaluated was from 1 January 2017 to 30 June 2018.
In this paper, the performance of the proposed algorithms was compared with the Hybrid Algorithms described in
Section 3.5. The MARR or risk-free rate used was 8%. The main metric that we used was the Sharpe Ratio, which allowed measurement of the relationship between expected return and risk. The performance of the algorithms was also measured with other metrics: expected return, risk, average portfolio correlation, and runtime. GENPO algorithm used an initial population of 50 individuals through 100 generations, and used 2 parents with a random selection cross point to generate 2 offspring, then applied an 8% mutation for the entire population. Finally, a stop criterion was implemented in the algorithm after 20 repetitions without improvement. Based on the evaluation, the individuals were ordered from best to worst and the least qualified individuals were eliminated from the population, leaving the population at its original size.
We compared the performance of the algorithms in two circumstances: first by applying the MARR constraint shown in Equation (25), which allowed only assets with an expected return equal to or greater than the MARR to be included in the portfolio; and then without this constraint. The average values of 30 runs are shown in
Table 3 and
Table 4.
Note in
Table 3, we obtained the best result of the Sharpe Ratio using the algorithms TAIPO, SAIPO, and TA, while the second-best result was achieved by GENPO. When the asset constraint was not applied, the TA-Yu algorithm selected a portfolio with negative SR. This negative value is a consequence of the expected lower return than the MARR (eight percent), which is the acceptable minimum value for accepting a portfolio.
In the risk metric, we obtained the best results with the hybrid algorithms SAIPO-Gilli, TAIPO-Gilli, TA-Gilli, and GENPO-Gilli. In terms of expected return, the portfolios obtained with TAIPO, SAIPO, TA, and GENPO, had higher values than the other algorithms. As shown in
Table 3 and
Table 4, TAIPO, SAIPO, and TA algorithms achieved equivalent results in Sharpe Ratio with and without a constraint. However, the SR placed higher than the rest of the algorithms when the MARR constraint was applied.
In
Table 4, we observe that the average correlation is higher when the MARR constraint is implemented than when it does not (as in
Table 3). However, this difference is lower in TAIPO, SAIPO, and TA. We obtain the best average correlation value with the GENPO algorithm.
When the MARR constraint satisfies the assets, they can conform to the portfolio, and the algorithms may select them. In addition, portfolios with the lowest number of stocks are collected with TAIPO, SAIPO, and TA, which can be advantageous for these algorithms. We can observe that when the MARR is implemented, the runtime is reduced among all algorithms. Although the TA algorithm attains similar results to TAIPO and SAIPO in the Sharpe Ratio, the runtime is higher. Thus, the new TAIPO algorithm proposed in this paper represents a better alternative than the classical Threshold Accepting algorithm. However, SAIPO and TAIPO algorithms require a lower runtime than Genetic algorithms.
Table 5 shows the relationship between the result reached in the Sharpe Ratio and the runtime (seconds), that is
, of each algorithm; a higher value represents a better result. When the constraint was applied, the best results were obtained with TAIPO-Gilli and SAIPO-Gilli.
When the constraint was not implemented, we obtained the largest , with the algorithm TA-Gilli. This metric can be used when seeking faster solutions, although faster solutions do not necessarily obtain the best quality results.
4.2. Statistical Test
To compare the results, a Friedman test [
51] was applied, considering 30 observations, where each algorithm represented a treatment.
Table 6 and
Table 7 show the results applied to the TA, TAIPO, and SAIPO algorithms and their hybrid versions. With a significance value of 5% and a
p-value equal to zero, we can conclude that there are significant differences in at least one algorithm. In addition, those that reached the best results were the TAIPO, SAIPO, and TA algorithms, with the higher sum of ranks.
In both cases, whether a constraint is applied or not, the TAIPO, SAIPO, and TA algorithms secured the best results in the Sharpe Ratio.
For the algorithms GENPO–Sharpe and its hybrid variants, considering a significance value of 5%, and with a
p-value equal to zero, there were significant differences between them.
Table 8 shows results for instances without constraint.
In the same way, a Friedman test was applied for the instance with constraint, obtaining a
p-value equal to zero, showing a statistically significant difference. Results are displayed in
Table 9.
Table 10 shows the comparison of the best algorithms when the constraint was not applied. With a
p-value of zero, the null hypothesis can be rejected, thus if there are differences between the groups, the TAIPO, SAIPO, and TA algorithms show better performance.
Table 11 shows the results of the Friedman test undertaken to compare the performance of the best algorithms in each group when the MARR constraint was applied.
With a p-value of 0.964 and a significance value of 0.05, we can conclude that there are no significant differences.
5. Conclusions
This paper presents three algorithms for portfolio optimization: GENPO based on Genetic Algorithms, SAIPO based on Simulated Annealing, and TAIPO, which improves upon the classical Threshold Accepting algorithm (TA). We compared them with state-of-the-art algorithms, namely: Gilli, Yu, and Masese models. This comparison was undertaken by replacing the Sharpe ratio with the objective functions used in these models. The proposed algorithms maximize the Sharpe Ratio (SR) and apply the Minimum Acceptable Rate of Return (MARR) as an essential constraint. Therefore, we present three families of algorithms for portfolio optimization in this paper. For instance, the GA family constituents are GENPO, GENPO-Yu, GENPO-Gilli, and GENPO-Masese.
The proposed algorithms were designed to select the best combination of assets from any stock exchange such as S&P 500 and any other stock market. However, they were only tested with datasets from the Mexican stock exchange (BMV). The optimal result of these algorithms was defined as the proportion of each asset that maximized the objective function.
The experimental results revealed that the proposed algorithms, GENPO, SAIPO, and TAIPO, obtained the highest quality portfolio within each family. Upon application of the MARR constraint, the portfolio with the highest quality was obtained. Moreover, for the same algorithm, when this constraint was included, the execution time was significantly shorter. Regarding the GA family, the proposed GENPO algorithm showed the highest quality in both cases, with and without application of the MARR constraint. Moreover, GENPO did not require excessive tuning time to obtain high-quality portfolios. Similarly, the algorithms SAIPO, TAIPO, and TA showed superior performance with or without the MARR constraint. In addition, they had the lowest average correlation than that of their respective family.
Finally, in the statistical test, where the performance of the proposed algorithms was compared, no significant differences were found when the MARR constraint was applied. However, when the MARR constraint was not applied, SAIPO, TAIPO, and TA obtained a significant difference in quality compared with the GENPO algorithm. The difference was that the TAIPO and SAIPO algorithms converge faster than GENPO and TA algorithms. Therefore, TAIPO and SAIPO represent excellent alternatives for the portfolio integration problem.
The SAIPO and TAIPO algorithms contained more parameters than GENPO; their tuning process was longer and involved a series of previous executions; for this reason, the tuning of these algorithms was more complex than that of GENPO. However, once the appropriate parameters were obtained, the execution time of SAIPO and TAIPO was shorter than the time used by GENPO. However, with TAIPO, unlike SAIPO, for the acceptance criterion of new solutions, the calculation of probabilities was not required, which rendered the execution time of TAIPO slightly lower than SAIPO.
For future research, we propose an application of these algorithms to larger stock markets, including other objective functions and metrics. Finally, we propose the application and extension of these algorithms with other heuristics for design portfolios among several markets. Moreover, the applicability of these algorithms regarding derivatives and other stocks remains a problem that should be studied.