Whale Optimization Algorithm for Multiconstraint Second-Order Stochastic Dominance Portfolio Optimization

In the field of asset allocation, how to balance the returns of an investment portfolio and its fluctuations is the core issue. Capital asset pricing model, arbitrage pricing theory, and Fama–French three-factor model were used to quantify the price of individual stocks and portfolios. Based on the second-order stochastic dominance rule, the higher moments of return series, the Shannon entropy, and some other actual investment constraints, we construct a multiconstraint portfolio optimization model, aiming at comprehensively weighting the returns and risk of portfolios rather than blindly maximizing its returns. Furthermore, the whale optimization algorithm based on FTSE100 index data is used to optimize the above multiconstraint portfolio optimization model, which significantly improves the rate of return of the simple diversified buy-and-hold strategy or the FTSE100 index. Furthermore, extensive experiments validate the superiority of the whale optimization algorithm over the other four swarm intelligence optimization algorithms (gray wolf optimizer, fruit fly optimization algorithm, particle swarm optimization, and firefly algorithm) through various indicators of the results, especially under harsh constraints.


Introduction
In the field of finance, the portfolio optimization problem has drawn a lot of attention since the mean-variance (M-V) model was proposed by Markowitz [1]. Based on the probability theory, the M-V model takes the first two moments of the return rate distribution, including expected returns and variance, into account. However, subsequent research studies find that the M-V model is not suitable for the practical financial environment. For example, Chunhachinda et al. [2] pointed out that the returns to the major international stock market are not normally distributed, while the M-V model assumes that the expected returns of the portfolio have a symmetric normal distribution. Besides, the M-V model takes the variance as a risk measure, which counts both upward and downward deviations, which is contrary to the definition of the investment risk [3]. Hence, Markowitz [4] replaced the risk measure with the semivariance, which is more suitable in the case of asymmetric distribution. In addition, there are many other alternative risk measures, such as the mean absolute deviation (MAD), value at risk (VaR), and conditional value at risk (CVaR).
Other than the traditional M-V model, the portfolio optimization model based on the stochastic dominance (SD) relation is highly applied. To be specific, the relationship between the first-order stochastic dominance (FSD) and utility theory was first discussed by Quirk and Saposnik [5]. Hadar and Russell [6] extended the above relationship to the second-order stochastic dominance (SSD). ereinto, different-order SD relations relate to different kinds of utility functions. In the meantime, SD relation is of interest because it takes the risk appetite into consideration and is more suitable to investors in realistic financial environments. Specifically speaking, FSD reflects the behavior of rational investors, while SSD reflects the behavior of rational riskaverse investors. Dentcheva and Ruszczynski [7] first proposed the portfolio optimization model with SD constraints. en, Roman and Mitra [8] pointed out that the portfolio optimization model with the SSD rule improves the performance of the traditional M-V model. Besides, Leshno and Levy [9] established an almost stochastic dominance (ASD) relation, which reveals the preference for most investors rather than all of them. Moreover, Fabian et al. [10] proposed the SSD portfolio optimization model, which is called TSSD, using tail risk measures at different confidence levels. Recently, Javanmardi and Lawryshyn [11] proposed the SSD-DP model, which does not require a benchmark portfolio.
However, only considering the SSD constraint is not enough to get an effective portfolio in the complex investment environment. erefore, additional real-life constraints, such as transaction costs, higher moments, diversification, and boundary constraints, should be taken into consideration in portfolio optimization. In any financial market, investors are obliged to pay transaction costs when buying or selling the securities. As one of the key factors affecting the net return, transaction costs are of great importance to investors, and ignoring them will result in an ineffective portfolio [12,13]. Besides, higher moments of return distribution, including skewness and kurtosis, have drawn investors' attention, which takes the extreme value into account rather than focusing solely on the average [14]. Leung et al. [15] pointed out that neglecting skewness will lead to an inefficient portfolio. Yu and Lee [16] showed that the model with higher moments performs better. As for diversification, it is a strategy that integrates a wide variety of investments into the portfolio. Models considering diversity are propitious to eliminate the unsystematic risk in the portfolio and make asset allocation more feasible [17,18]. Normally, Shannon's entropy and Yager's entropy are used to measure the diversity of a portfolio. Furthermore, given that small proportions held in the portfolio have little impact on its performance and high proportions go against the flexibility, the boundary constraint, also known as the buy-in threshold constraint, is included in the portfolio optimization model to limit the upper and lower bounds of the investment ratio in individual assets [19,20].
After introducing several constraints into the model, the portfolio optimization problem converts to an NP-complete problem, which limits the computational efficiency as the problem size increases. Besides, SSD constraints require the comparison of any two investable assets. As the number of investable assets increases, the computational requirements become more demanding. erefore, heuristic algorithms are widely used to optimize the multiconstraint portfolio optimization problem, such as the particle swarm optimization (PSO) [21], firefly algorithm (FA) [22], biogeographybased optimization (BBO), and artificial bee colony (ABC) [23]. Recently, Babazadeh and Esfahanipour [24] developed a nondominated sorting genetic algorithm and applied it to a multiperiod mean-var portfolio optimization model under the cardinality, budget, floor, and ceiling constraints. Chen et al. [25] combined the FA and the genetic algorithm (GA) and then applied it to a mean-variance-skewness portfolio selection model under the transaction costs, bounds on holdings, cardinality, and transaction lots constraints.
Whale optimization algorithm (WOA) is a metaheuristic optimization algorithm introduced by Mirjalili and Lewis [26], which is inspired by the bubble-net hunting strategy of humpback whales. Besides, WOA was tested for 29 mathematical optimization problems and 6 structural design problems, and the results prove that WOA is very competitive with the existing metaheuristic algorithms as well as conventional methods. e most important is that WOA mainly mimics the hunting behavior of humpback whales in searching for and attacking preys called the bubble-net feeding behavior [27], which improved the performance of candidate solutions in each step. Because of its characteristics of simple theory, easier operation, less parameter setting, and no special requirements for optimized function, WOA is widely used in image segmentation [28], parameter estimation [29], sizing optimization [30], and global optimization [31]. Recently, Abdel-Basset et al. [32] integrated WOA with a local search strategy for solving the problem of permutation flow shop scheduling. Reddy et al. [33] applied WOA to profit-based unit commitment problems in competitive electricity markets with good performance.
However, in these papers, WOA has still not been applied to solving the multiconstraint SSD portfolio optimization model. e motivation for proposing WOA for the multiconstraint SSD portfolio optimization model in this research is twofold. First, based on the above literature review, there have been several successful applications based on WOA. Second, in the preliminary research work, we have achieved decent performance on the SSD portfolio optimization model by GWO. In this paper, a new improved multiconstraint SSD portfolio optimization model is proposed and optimized by WOA.
For the multiconstraint SSD portfolio optimization model, the area of the feasible region is very small, which makes it difficult to produce feasible solutions. At the same time, considering harsh constraints makes the traditional optimization methods tend to converge to the local optimum, which results in the loss of population diversity and poor optimization ability. Compared with the traditional evolutionary algorithm, such as GA, on the one hand, WOA has a stronger ability to jump out of the local optimum and explore the globally optimal solution; on the other hand, the bubble-net attack process ensures that WOA has higher accuracy than other swarm intelligence algorithms, such as the gray wolf optimizer (GWO) and the fruit fly optimization algorithm (FOA). erefore, WOA is used to optimize the above multiconstraint SSD portfolio optimization model. Furthermore, we perform numerical experiments based on FTSE100 index data and compare the performance of the optimal portfolio obtained by WOA with that obtained by GWO, FOA, PSO, and FA. e novel contributions of this paper are as follows. Firstly, the multiconstraint SSD portfolio optimization model is proposed. We incorporate several realistic constraints into the SSD portfolio optimization model, including the transaction cost, skewness, kurtosis, diversification, and boundary constraints. Secondly, WOA is successfully used to optimize the above multiconstraint SSD portfolio optimization model. Lastly, an optimal portfolio strategy obtained by WOA is found to be greater than that obtained by other four different algorithms. e rest of this paper is organized as follows. In Section 2, we discuss the portfolio optimization model with SSD and other real-life constraints. In Section 3, we discuss the WOA for solving the proposed model. In Section 4, we present a numerical experiment and analyse the performance of WOA. Finally, a brief conclusion is illustrated in Section 5.

The Multiconstraint Portfolio Optimization Model
In this section, a detailed discussion of the SSD portfolio optimization model under several realistic or higher moment constraints is presented. Specifically speaking, it is well known that only considering returns and risk is not enough to get an effective portfolio that meets the complicated investment environment. Besides, in the real-world financial market, the return distribution of the portfolio is not a normal distribution, which means that higher moments of return distribution should not be neglected. erefore, several realistic or higher moment constraints, including the transaction cost, skewness, kurtosis, diversification, and boundary constraints, are included in the framework of SSD portfolio optimization.

e Returns, Net Return, and Excess Mean Return.
As one of the most basic elements of portfolio optimization problems, returns play an important part in indicating the performance of a portfolio. In the financial market, the returns of investment can be defined as the ratio of the net gain or loss to the initial cost of the investment, separately known as positive returns and negative returns, which can be formulated as follows: where p i,t and p i,t−1 are the price of asset i at period t and t − 1, respectively, and d i,t is the dividend of asset i and period t. Let n denote the number of assets, which are available for investment at the beginning of a fixed period and x � (x 1 , x 2 , . . . , x n ) denote the fraction of the initial capital invested in x i . en, we use X ∈ R n to denote a set of feasible portfolios, which is a bounded convex polyhedron clearly. Besides, let R i (ξ) denote the returns of asset i under discrete distribution, where a random vector is on the probability space (Ω, F, P). Assuming that the capital available for investment is fixed and E[|R j |] < ∞, the returns of portfolio x can be expressed as follows [3]: However, we always need to pay fees when trading assets, such as brokerage fees, bid-ask spreads, taxes, and fund load, which are known as transaction costs. Arnott and Wanger [12] pointed out that ignoring the transaction costs would lead to an ineffective portfolio. In this paper, we employ a V-shaped transaction cost function to express the transaction costs between the new portfolio x � (x 1 , x 2 , . . . , x n ) and the existing portfolio x 0 � (x 0 1 , x 0 2 , . . . x 0 n ). Let c(x) denote the total transaction costs of n assets, which can be formulated as follows: where c(i) is the unit transaction cost of asset i. It is set to 0.9%, among which the commission is 0.4% and the stamp duty is 0.5%. us, the net return of portfolio x can be displayed as follows [34]: Furthermore, the excess mean return (EMR) is always used to describe performance over the existing portfolio, which is an average of the difference between the returns of the new portfolio x � (x 1 , x 2 , . . . , x n ) and the existing portfolio x 0 � (x 0 1 , x 0 2 , . . . x 0 n ), and can be formulated as follows: where R j (x) and R j (x 0 ) denote the returns of the portfolio x and x 0 in the period j. In a word, all of the above three indicators can be used to evaluate the performance of a new portfolio. Specifically speaking, the returns of portfolio are used to calculate constraints, such as skewness. e net return of the portfolio is used as an objective function, and the EMR is only used as an evaluation indicator.
Fama and French [35] put forward a three-factor pricing model and recently put forward a five-factor pricing model [36]. It builds its portfolio at the end of June and holds it for a year, based on financial data from the previous year. In order to simplify the rebalancing problem, this paper only considers the construction of a single-period portfolio and assumes that the transaction cost required to construct each portfolio is fixed. erefore, the returns of portfolio are used as the objective function of the optimization model in this paper.

Risk Measures and Stochastic Dominance Constraint.
As another basic element of portfolio optimization problems, risk presents the uncertainty of returns. e risk measures have many forms, including variance, semivariance (SV), MAD, VaR, and CVaR. VaR is one of the most well-known downside risk measures, which measures the worst returns a portfolio may potentially suffer. With a fixed confidence level α, VaR α is defined as the α-quantile of the cumulative distribution function, which can be defined as follows: Computational Intelligence and Neuroscience where Y represents the returns of the portfolio in each period. Meanwhile, as a coherent risk measure, CVaR measures the conditional expectation of losses beyond VaR, which can be displayed as follows: Unlike the above risk measures, the SD constraint is not an indicator, which establishes relative risk advantages by comparison between the k-order distribution function of any two portfolios. Assuming that the utility function of all investors is monotonically increasing, the portfolio Y stochastically dominates the portfolio Y in the first order when all the investors prefer portfolio X to portfolio X or that there is no difference between a part of them [37]. Let x and x 0 be the decision vectors and ξ be a random variable; then where g(x, ξ) is the returns of the portfolio x ∈ R n , which is a concave continuous function both in x and ξ, and erefore, the strict dominance relation succ k is defined as follows: ere are several equivalent characterizations of the SSD constraint. Hadar and Russell [6] pointed out that for any nondecreasing and concave utility function where X and X 0 are the two random variables, which generally represent the returns of portfolios x and x 0 , and E(·) is the expected value with respect to the probability distribution of ξ [10]. Ogryczak and Ruszczyński [38] pointed out that X≻ (2) X 0 if and only if where E[(η − X) + ] � E(max η − X, 0 ). Ogryczak and Ruszczyński pointed [39] out that X≻ (2) X 0 is equivalent to the continuum of CVaR constraints for all confidence levels α ∈ [0, 1]: In this paper, we use the last equivalent SSD relation, VaR, and CVaR as evaluation indicators.

Higher Moment Constraints.
e traditional M-V model formulated by Markowitz [1] only takes the first two moments of return distribution into account for portfolio optimization. Arditti and Levy [40] and Rubinstein [41] have argued that the higher moments of return distribution should not be neglected because the distribution of returns in the financial market is not a normal distribution. From the theoretical and empirical point of view, Arditti [42,43] proved that investors demand higher (lower) returns for investments with negative (positive) skewness of income distribution. Further, Scott and Horvath [44] extended this analysis to the higher-order moments of the return distribution and proved that the positive values of even (odd) order moments bring a positive (negative) risk premium, and vice versa. Referring to the recent studies by Chen and Yue et al. [25,45], the skewness and kurtosis constraints are incorporated into the optimization model in this paper.
Let ζ be an uncertain variable with a finite expected value e, and the skewness and kurtosis of ζ are, respectively, defined by

Diversification Constraint.
In the financial market, portfolio diversification is the process of allocating the capital in a way that reduces the exposure to any one particular asset or risk, which implies that the idiosyncratic risk of the portfolio can be reduced as the assets included in the investment increase. Considering the low diversity of the portfolio which may lead to losses, we include the diversification constraint into the portfolio optimization model. SE and Yager's entropy are widely used to measure the diversity of a portfolio [17,46]. Let x(i) denote the weight of assets i, and SE can be formulated as follows: and Yager's entropy can be calculated as follows: where z ≥ 1 is a constant, and in this paper, it is set to 2. Obviously, the higher the value of SE or Yager's entropy, the better the diversity of the portfolio. In particular, both SE and Yager's entropy get the maximum value when x(i) � (1/n).

Boundary
Constraint. e boundary constraint, also known as the buy-in threshold constraint, means that each asset should be invested in a specific range, while the lower bounds are used to reduce the brokerage costs and monitoring costs and upper bounds are used to increase the flexibility [19]. Let ε i denote the lower bounds and δ i denote the upper bounds; then the boundary constraint of the portfolio x can be described as follows: where x i is the weight of assets i and z i ∈ 0, 1 2.6. Budget Constraint. Budget constraint means that the amount of capital to be invested is fixed and all capital should be invested, which can be expressed as follows:

No Short Selling Constraint.
e short selling refers to the sale of securities borrowed by the seller, which is an act of speculation with high risk in the financial market. erefore, the short selling is not considered in this paper, and the no short selling constraint is represented by

Multiconstraint Second-Order Stochastic Dominance
Portfolio Optimization Model. Given all that, the multiconstraint SSD portfolio optimization model is provided below:

The Whale Optimization Algorithm (WOA) for Solving the Proposed Model
WOA is a swarm intelligence optimization algorithm proposed by Australian scholars Mirjalili and Lewis [26] in 2016. e algorithm simulates the process of humpback whales searching and capturing food by establishing mathematical models. WOA was inspired by the bubble-net attack strategy of humpback whales. Whales surround their prey by spiraling up and bubbling up as they dive about 12 meters below the surface. WOA has the advantages of a simple principle, few parameters, and strong searching ability. Since its inception, it has been widely used in engineering optimization, parameter extraction, feature selection, and other such aspects. Figure 1 shows the bubble-net feeding behavior of humpback whales.

Mathematical Model.
In WOA, the position of the ith whale (search agent) is described as where i is required to be given in advance, and the size of j is equal to dim (the dimension of the problem). e steps of the WOA are as follows.
First, initial search agents with positions [0, 0, . . . , 0] are generated. en, the position and the score of the optimal search agent with position P * � [0, 0, . . . , 0] are initialized. For solving the minimum problem, the bestscore (the initial score of the optimal search agent) is set to be +∞ instead of −∞.
e algorithm loop is entered. For each search agent, each variable X i,j (j � 1, 2, . . . , dim) is checked whether or not it is across the border. For a variable that is out of bounds, its value is returned to the boundary.
Real numbers r 1 → and r 2 → are randomly generated and p ∈ [0, 1] and are used to calculate A → and C → . e calculation formulas of A → and C → are as follows: where a → is a real number that goes linearly from 2 to 0 in the iteration.

Random Prey.
If p < 0.5 and | A → | > 1, the stage of random search for the prey is entered. In this process, the search agent is forced to move away from its current location and wander randomly through the space in search of the prey. e mathematical model and position transformation formula are as follows: where P rand ����→ is a randomly generated position vector within the boundary range, P t i → is the generation t of the ith search agent's position vector, and P t+1 i ���→ is the ith search agent's position vector generation t + 1.

Encircling Prey.
If p < 0.5 and | A → | ≤ 1, the stage of surrounding the prey is entered. In this process, the location of the prey is identified, and the prey is surrounded. e search Computational Intelligence and Neuroscience agent moves closer to the location of the optimal search agent. e mathematical expression of its position update is where −PP t * � �→ is the generation t of optimal search agent's position vector.

Bubble-Net
Attacking. If p ≥ 0.5, the stage of spiral contraction encircling and bubble-net attack is entered. Firstly, the distance between the search agent and the optimal search agent is calculated, and then a spiral mathematical model is established to update the search agent's position. e formula is as follows: where is the defined logarithmic helix shape constant, and t is a random real number in the range [−1, 1].

e WOA for Solving the Proposed Model.
When it comes to WOA for solving this model, we need to add judgment constraints into the WOA iteration process.
at is, the search agent that meets the constraint and has better fitness is allowed to be updated to the leading search agent. ere are several constraints in the model. In order to ensure the quality of the final solution, we added the initialization coefficient β � 1.5 in the initialization process, which makes the quality of the initial solution reach our desired effect. Figure 2 shows the procedure of the WOA algorithm. Meanwhile, the pseudocode of the main procedure of WOA is shown in Algorithm 1, and the pseudocode of WOA for solving the proposed model is shown in Algorithm 2.

Numerical Experiments
In this section, we carry out several numerical experiments based on FTSE100 index stock historical data. Specifically speaking, the historical return rate of FTSE 100 index assets prior to December 2018 is collected to construct the portfolio strategy. Besides, a series of indicators are introduced to evaluate the performance of portfolios by Goel and Sharma [47], such as EMR, downside deviation (DD), and Sharpe ratio. Moreover, the algorithms are coded in MATLAB 2016a, and all tests are performed on a PC with a Windows 10 operating system and 8 GB of RAM.

Performance Measures.
We mainly evaluate a portfolio from two aspects: absolute indicator and relative indicators, which are described briefly as follows.
As a measure of the downside risk, DD focuses on the returns below the minimum threshold or the minimum acceptable returns. Let R j (x) and R j (x 0 ) denote the returns of portfolios x and x 0 in the period j; then DD can be formulated as follows: where R j (x 0 ) is the FTSE100 index in this paper, and the lower value of DD means a better performance of portfolio x. Besides, DD is also used to calculate the Sortino ratio. Sortino ratio is a variation of the Sharpe ratio, which uses DD rather than the standard deviation as a risk measure. e Sortino ratio and the Sharpe ratio can be calculated as follows: where R(x) denotes the net return of portfolio x, R f denotes the risk-free rate, and σ(·) denotes the standard deviation.
Obviously, a higher value of the Sortino ratio or the Sharpe ratio is desirable. Moreover, the STARR ratio (STARR) and the information ratio (IR) are alternatives to the Sharpe ratio. STARR also considers the major drawback of the standard deviation as a risk measure and employs the CVaR for the performance adjustment, which is defined as where α is the confidence level. Considering that CVaR is usually negative, therefore, the lower value of STARR is preferable. Furthermore, IR is a measure of the returns on a portfolio beyond a benchmark, and the benchmark is typically an index, such as the FTSE100 index, which is given by Similarly, the higher value of IR is desirable. In this paper, the confidence level α is set to 5%, the risk-free rate R f is set to 4%, and the FTSE100 index is used as a benchmark.

Numerical Results.
In this section, we report the detailed experimental results. Specifically, the return rate of FTSE100 index stocks during 2018 is collected as historical data. Besides, in order to ensure the diversity of the portfolio, the upper bound δ of the portfolio is set to 5%, 7%, or 10%. 6 Computational Intelligence and Neuroscience Above all, we propose the following multiconstraint portfolio optimization model under SSD: To evaluate the performance of the WOA, we compare it with the standard GWO, FOA, PSO, and FA. In order to make the running time roughly equal, except for FA, the number of initial solutions for the other four algorithms is 3000 (in FA, it is set to 1500). And, the initialization coefficient β � 1.5. In WOA, GWO, and PSO, the number of Comparing with the FTSE100 index, we get the experiment results as shown in Tables 1-3 under δ � 0.05, 0.07, and 0.10, respectively, where the "Mean" column describes the average indicator value of optimal portfolios during repeated experiments, and the "Optimal" column describes the indicator value of optimal portfolios among repeated experiments. For the simplicity of data representation, the order of magnitude of EMR in the table is 10 −4 . e order of magnitude of DD is 10 −2 .
In Figures 3(a)-3(c), the histograms, respectively, show the specific asset structure of the optimal portfolio of 101 kinds of assets when the model upper bound � 0.05, 0.07, and 0.10 by the WOA algorithm. e histogram in Figure 3

��→
� the best search agent (4) while t < maximum number of iterations do (5) return the out-of-bounds search agent to the boundary (6) for each search agent do (7) Update a → , A → , C → , l, and p (8) if p < 0.5 and | A → | ≤ 1 then (9) Update the position of the current search agent by using (21) (10) else if p < 0.5 and | A → | > 1 then (11) Select a random search agent (X rand ) (12) Update the position of the current search agent by using (24)  (13) else if p ≥ 0.5 then (14) Update the position of the current search by using (26)  (1) Initialize the constrained population (2) Calculate the fitness of each search agent (3) X *

� �→
.score ⟵ −∞ (6) while t < maximum number of iterations do (7) for each search agent do (8) Update a → , A → , C → , l, and p (9) New position of the search agent ⟵ update (the current search agent) (10) Calculate the fitness of the current search agent (11) Determine whether the location of the search agent satisfies the constraint (12) if (Satisfy the constraint condition and the fitness of the current search agent > Bestscore) then (13) X * � �→ .positions ⟵ the positions of the current search agent (14) X * � �→ .score ⟵ the fitness of the current search agent (15) end if (16) end for (17) t++ (18) end while (19) return Bestscore ALGORITHM 2: e pseudocode of WOA for solving the proposed model. 8 Computational Intelligence and Neuroscience

Numerical Analysis.
We perform the numerical experiments of the multiconstraint portfolio optimization model under SSD by WOA, GWO, FOA, PSO, and FA. In this part, the performance of the portfolio obtained by each algorithm is evaluated through returns, diversity, risk, relative risk value, and other indicators.
First of all, it can be seen from Table 1 that the mean net return of portfolios obtained by WOA is 0.06737, while the portfolios obtained by GWO, FOA, PSO, and FA are 0.05907, 0.04590, 0.05327, and 0.05043, respectively, under δ � 0.05. Besides, the mean net return and EMR of portfolios obtained by WOA under different upper bounds are also higher than portfolios obtained by the other four algorithms. If only considering the optimization results, it is obvious that WOA has a better optimization capability than the other four algorithms under strong constraints. Although the     Computational Intelligence and Neuroscience 13 mean SE of the portfolio obtained by WOA is slightly lower than the value obtained by FOA, the mean Sharpe ratio of FOA is much lower than the performance obtained by WOA. For investors, they tend to choose the portfolio with a higher Sharpe ratio when there is a little difference in SE respect. Meanwhile, the primary goal of investors is to obtain the maximum returns, while the returns of the portfolio obtained by FOA are far lower than that obtained by WOA. Taken together, FOA's results are unsatisfactory in that they give us a slight advantage in diversity at the expense of returns.
In Table 2, when δ � 0.07, the mean and optimal net returns of the portfolio obtained by WOA are higher than those obtained by the other four algorithms. In Table 3, the performance obtained by WOA is superior to that obtained by the other four algorithms under δ � 0.10. e numerical analysis results in Table 2 and Table 3 are similar to those in Table 1.
Secondly, it can be seen from Figures 3(a)-3(c) the 101 asset structure of the optimal portfolio obtained by the WOA algorithm under δ � 0.05, 0.07, and 0.10. Figure 3 optimized by WOA has a more even distribution of assets, and its upper bound is lower than the upper bound of FTSE100, which proves that its diversity is better.
In Figures 4-21, the horizontal axis represents 253 trading days and the vertical axis represents the return rate. ese figures show the daily rate of return of the optimal portfolio of WOA, GWO, FOA, PSO, and FA when δ � 0.05, 0.07, and 0.10 and compare it with the daily rate of return of FTSE100. It can be seen that the return rate of the portfolio optimized by these five different algorithms is mostly higher than the return rate of FTSE100 under different values of δ. From Figures 4-9, it is seen that when δ � 0.05, the return rate of the portfolio obtained by the five different algorithms is mostly better than the return rate of FTSE100 in 253 trading days. From Figures 10-15, it is seen that the portfolio return rate obtained by the five different algorithms is mostly better than the return rate of FTSE100 under δ � 0.07. From Figures 16-21, it is seen that the optimized portfolio return rate is mostly better than the return rate of FTSE100 under δ � 0.10. From Figures 4, 10, and 16, for approximately 80% of the trading days, the return rate line of the portfolio obtained by WOA (red line) is higher than the FTSE100's return rate line (blue dotted line). Compared with the return rate line of the portfolio obtained by other four kinds of algorithm, it can be proved that the returns of the portfolio optimized by WOA are higher than that of the other four algorithms.
Further, from Figures 22-24, we can see the box plots of net return, Shannon's entropy, and skewness of the portfolios optimized by the five different algorithms. It can be seen that when δ � 0.05, 0.07, and 0.10, respectively, the mean returns of the portfolio optimized by WOA are higher than that of the other four algorithms. For investors, they tend to choose the portfolio with a higher net return, so the portfolio optimized by WOA is a useful guideline to investors.
Although the mean Shannon's entropy of the portfolio obtained by WOA is slightly lower than the value obtained by the other four algorithms, the mean net return of WOA is the highest of these algorithms. It means that in order to achieve a higher net return, a part of the diversity needs to be sacrificed.
When δ � 0.05, the mean skewness of the portfolio optimized by WOA is only 0.0124 lower than the maximum of that obtained by the other four algorithms. When δ � 0.07 and 0.10, the portfolios optimized by WOA have a greater skewness than the other algorithms. At the same time, the mean net return of WOA is the highest of these algorithms. For investors, they prefer the portfolio with larger skewness and higher returns. erefore, the portfolio obtained by WOA is more suitable for investors to choose.
In addition, besides using FTSE100 as the comparison criterion, equally weighted indicators are also used as the comparison object. When investors build portfolios, more reference schemes are provided. e indicators of FTSE100 and equal weight are also given in Table 4.
From Table 4, it can be seen that the net return under FTSE100 and equal weight is −0.1038 and −0.1057, which is lower than that optimized by these algorithms. Meantime, their skewness is all lower than that optimized by these algorithms. eir kurtosis is greater than 3, indicating that the solutions present a spike pulse. eir kurtosis is all higher than that optimized by these algorithms. By comparing with the performance indicators in the case of FTSE100 and equal weight, it indicates that the performance of the optimized portfolio by WOA has a greater reference value for investors. e specific index weight data of the FTSE100 index are shown in Table 5. In this paper, we use the Sortino ratio, STARR ratio, Sharpe ratio, and IR to measure the relative risk value, which is used to quantify the net return or the excess mean return from taking on the unit risk. When the upper bound is set to 0.05, it can be seen from Table 1 that the mean Sortino ratio of portfolios obtained by WOA is 0.3004, while the portfolios obtained by GWO, FOA, PSO, and FA are 0.2930, 0.2732, 0.2817, and 0.2746, respectively. Besides, the mean STARR ratio, Sharpe ratio, and IR of portfolios obtained by WOA are also better than the other four algorithms, which means that the portfolio obtained by WOA has a better relative risk value. Above all, under several constraints, WOA has an efficient search ability to find the optimal portfolio that meets the constraints. In addition, in terms of the algorithm structure, WOA also has the advantages of a simple structure and few parameter settings. From the upper bound of results, the upper bound of WOA is higher than other algorithms, which indicates that WOA has a good convergence effect and strong local search ability.
Furthermore, the SSD optimization model proposed in this paper has a strong constraint on the solution. In other words, the existence of constraints will lead to infeasible regions in the search space of decision variables. In fact, in the field of finance, realistic constraints are pretty important. e existence of constraints will lead to infeasible regions in the search space of decision variables. e algorithm needs to balance constraints and optimization. Under strong constraints, the area of the feasible region is very small, and a large number of solutions are considered to be infeasible because they do not meet the constraints, which makes it a very difficult problem to produce feasible solutions. At the same time, the existence of constraints may also make the original problem produce many new local optima [48]. In this case, the optimization algorithm is easy to converge too quickly, resulting in the loss of population diversity in the early stage, and the global optimal solution cannot be found. erefore, the strong constraint optimization problem has a high demand on the ability of the algorithm to jump out of the local optimum and the ability of global search [49]. According to the experimental results in this section, under different upper bounds, the value of the objective function obtained by WOA is better in both the optimal conditions [50,51]. is shows that the performance of WOA is better than that of the other four algorithms in strongly constrained optimization problems, which has an excellent application prospect.

Conclusion
Since Fama and French [35] put forward the three-factor pricing model, there has been a boom in searching for factors in academic circles recently. Factor model is essentially an asset pricing model and can predict the future returns on assets to a certain extent. However, no matter  how many factors there are, we should strive to achieve higher returns on the premise of minimizing portfolio risks, namely, asset allocation. With the development of machine learning, more and more advanced algorithms are used to explore the nonlinear relationship between factors and returns on assets. Similarly, machine learning can be applied to asset allocation. In this paper, we propose a portfolio optimization model under SSD and several realistic constraints, and it is optimized by WOA. As a matter of fact, the real financial environment is much more complex.
erefore, how to broaden the practicability of the intelligent algorithm in a complex financial environment is still a long way to go. Based on FTSE100 index stock data, the experimental results prove the outstanding performance of WOA during harsh constraints.
However, the proposed portfolio optimization model only considers a single-period problem. In fact, portfolio construction is a continuous process. In the future work, establishing a multiperiod portfolio model and verifying the performance of WOA or other intelligent algorithms are feasible. Moreover, WOA has a comparatively huge rise space in global searching, and we find that the WOA has the problem of premature convergence. We will pay attention to this topic in the future research.

Abbreviations
WOA: Whale optimization algorithm GWO: Gray wolf optimizer FOA: Fruit fly optimization algorithm PSO: Particle swarm optimization FA: Firefly algorithm EMR: Excess mean return DD: Downside deviation STARR: STARR ratio IR: Information ratio SE: Shannon's entropy YE: Yager's entropy VaR: Value at risk CVaR: Conditional value at risk SD: Stochastic dominance FSD: First-order stochastic dominance SSD: Second-order stochastic dominance ASD: Almost stochastic dominance M-V: Mean-variance.
Data Availability e composition of FESE100 is obtained from the London stock exchange (http://www.londonstockexchange.com). e daily closing price of the constituent shares and dividends is obtained from Google Finance (http://www.google. com/finance).

Conflicts of Interest
e authors declare no conflicts of interest.

Authors' Contributions
Qianhao Zhai and Tao Ye contributed equally to this work.