Introduction
Portfolio selection is a challenging area of research and optimization problem due to the nature of the financial markets in which various assets can be chosen to from a portfolio, including stocks, funds, and futures [12], [19], [23], [31]. In financial markets, because they are uncertain and are easily influenced by government policies and global economics, one of the main goals is to obtain a portfolio that can maximize profits and avoid risks [24]. The Mean-Variance (M-V) model, which is the most well-known model, was presented in 1952 by Markowitz for obtaining an efficient frontier that contains a set of portfolios [29]. In addition, in the past decades, based on the M-V model, various models have also been presented. Because finding the efficient frontier is an optimization problem, lots of approaches based on evolutionary algorithms have been published to obtain the weights of a portfolio from a set of assets [5], [27], [28], [33].
When a portfolio is suggested, the following issue is how to determine the trading times. In other words, when to buy and sell assets to form the portfolio is a problem that is always troublesome for investors. For deciding the trading times for a portfolio, trading strategies are a common way to address that. In general, technical or fundamental indicators are employed to generate trading strategies [10], [24]. For example, assume that the technical indicator, that is, the commodity channel index (CCI), is utilized to form a trading strategy. Then, the buy and sell signals could be generated as “When the CCI value of a stock crosses −100 from the bottom, then a buy signal is suggested” and “When the CCI value of a stock crosses 100 from the top, a sell signal is suggested”, respectively. To generate useful and actionable trading strategies is a complicated task. Lots of algorithms have also been designed to address that in different ways [3], [7], [15], [26].
However, when a trading strategy portfolio is provided, the suggested trading strategies may not satisfy traders for a variety of reasons. In this situation, traders can more conveniently adjust their trading plans if other trading strategies could be provided to replace them. To deal with this, a group trading strategy portfolio (GTSP) problem is firstly defined in this paper. Because obtaining a GTSP is a grouping problem, an optimization approach based on the grouping genetic algorithm (GGA) is designed for obtaining a GTSP in which Brown et al. indicated the GGA is an enhanced approach of the genetic algorithm (GA) for solving grouping problems [2].
To find a GTSP, according to the selected technical indicators, the candidate trading strategies are first generated in the proposed approach. Then, a subset of the candidate trading strategies is selected using the three given ranking functions. Based on the subset of the trading strategies, the population starts to be initialized. In the encoding scheme, the grouping, weighting and trading strategy parts are utilized to represent a possible GTSP. The evaluation function, which is composed of the group balance, weight balance, portfolio return factor and risk factor, is presented to assess the quality of a possible solution. The genetic operators of crossover, mutation, and inversion are applied on the population to generate and search the different solutions. The evolution is continued until it reaches the termination condition. The experiments on the sideway trend and downtrend datasets were conducted to show the advantages of the proposed approach. The contributions of this paper are stated as follows.
First, the group trading strategy portfolio optimization (GTSPO) problem is defined in order to provide more convenient ways for traders to establish trading plans.
Then, an approach is designed to solve the GTSPO in order to optimize a GTSP using the GGA.
Experiments on the sideways trend and downtrend datasets showed that the proposed approach could increase profits and reduce risks compared to the benchmark trading strategy, which is the buy and hold strategy (BHS).
In addition, when the stop-loss and take-profit points (SLTP) are taken into consideration, we also verify that the proposed approach can reach better returns than that without the SLTP.
Finally, the derived GTSP can be utilized to provide various trading strategy portfolios for traders to adjust more effective trading plans.
The remaining part of this paper is organized as follows. Literature reviews are described in Section 2. The problem definition and framework of the proposed approach are described in Section 3. The main elements of the proposed approach are stated in Section 4. The proposed algorithm and an example are given in Section 5. Extensive experiments are shown in Section 6. At last, conclusions and future work are provided in Section 7.
Literature Reviews
Related studies are described in this section. In this section, the trading strategy optimization and trading strategies for stock portfolios are reviewed in Sections II.A and II.B, respectively.
A. Trading Strategy Optimization
Fu et al. presented two GA-based approaches for finding the appropriate parameters for technical indicators and portfolio weighting [15]. For parameter optimization, seven technical indicators were employed to form trading strategies. Then, a two-dimensional array, which was the encoding scheme, was utilized to represent those parameters for the trading strategies. The fitness is evaluated by the return of the trading strategies in a chromosome. In addition, to deal with finding trading rules from numerical indicators, Chang-Chien et al. presented an algorithm for constructing an associative classifier using the GA [6]. For obtaining the relationship from numerical data in stock trading problems, three relations were considered to express the associated classification rules. At last, the phenotype encoding structure was designed to represent those rules. The algorithm, called the GA–ACR algorithm, was employed to find the rules for constructing the classifier with high accuracy. According to the event-based concept of directional changes, Kampouridis et al. proposed an approach to find trading strategies for foreign exchange markets using GA [25]. In their approach, the profitability was used to evaluate a chromosome. As a result, new and profitable trading strategies could be generated. Utilizing news sentiment, Feuerriegel et al. designed a supervised and reinforcement learning algorithm for deriving trading strategies to provide investors a more useful decision supports [16]. Besides, Wen et al. proposed a framework in accordance with the cointegration theory and complex network. In that paper, the static and dynamic features of pairs trading strategy were examined, and the results indicated investors should carefully chose pairs for trading because some trading pairs were unsteady [32]. To construct profitable currency portfolios, Chandrinos et al. focused on designing trading strategy using the Donchian Channel [4]. They first developed the modified renko bars. Subsequently, parameters of the trading strategy were tuned based on the given training datasets and compared with the three optimization algorithms.
B. Trading Strategies for Stock Portfolios
Chou et al. proposed an approach to construct a rule-based dynamic stock trading system [10]. In their approach, technical indicators were first employed to form trading strategies. Then, using the designed quantum-inspired Tabu search algorithm, an optimal combination of trading strategies could be found. At last, the algorithm adopted a sliding window to reduce over-fitting and to realize the dynamic system. Furthermore, using maximizing the profit gained and the rate of successful transactions as two objective functions, they also presented a multi-objective quantum-inspired Tabu search algorithm for identifying the optimal combination of trading rules [11]. Leu and Chiu [26] proposed an algorithm to obtain a stock portfolio trading strategy by utilizing the GA and fuzzy time series. First, it employed the GA to find a stock portfolio. The evaluation was designed in accordance with the fuzzy time series. In addition, to avoid huge risk, the periodic checking and stop-loss point checking were utilized to get the trading signals to sell or buy assets for a stock portfolio. Chang and M. Lee designed formulated investment strategies for stocks based on the Markov decision process and the GA [3]. The Markov decision process was utilized to obtain trading signals. Then, the GA was used to find the stock portfolio and capital allocation for assets. In addition, Berutich et al. proposed a genetic programming based approach to learn trading rules that can be used to manage a stock portfolio [1]. To overcome the over-fitting problem, in their approach, the new random sampling method was utilized for increasing the robustness of the strategies. Chen et al. designed a combination genetic algorithm to optimize an investment strategy portfolio [7]. It first generated security-rule pairs using the ten given technical indicators and ten stocks, where each indicator had sell and buy rules. Then, the selected security-rule pairs were utilized to form a possible investment strategy portfolio that was encoded into an individual. The fitness value of an investment strategy portfolio using chromosomes was evaluated by its return.
Problem Definition and Framework of the Proposed Approach
To state the problem to be solved in this paper, the definitions are described in this section as follows.
Definition 1 (A Trading Strategy (TS)):
A TS is composed of a buy signal and a sell signal, where each signal is formed according to technical indicators. For example, a trading strategy could be “If the CCI value of a stock crosses −100 from the bottom, then a buy signal is suggested. If the CCI value of a stock crosses 100 from the top, a sell signal is suggested”.
Definition 2 (A Trading Strategy Portfolio (TSP)):
A TSP has
Definition 3 (Trading Strategy Group (TSG)):
A TSG contains a set of trading strategies
Definition 4 (Grouping Problem):
The purpose of the grouping problem is to divide
Definition 5 (Group Trading Strategy Portfolio (GTSP)):
A GTSP consists of K TSGs and is represented as
Definition 6 (Group Trading Strategy Portfolio Optimization (GTSPO)) Problem:
The main goal of the GTSPO problem is to optimize a GTSP in accordance with objective and subjective criteria given by users using evolutionary algorithms. For instance, the criteria could be minimizing the risk while maximizing the profit based on the allocated capitals of groups. Based on Definitions 4 and 5, we can map the GTSPO problem to a grouping problem.
To solve the GTSPO problem, the GGA is utilized in this paper to optimize a GTSP. In the following, before stating the proposed framework, the data preprocessing procedure to generate TSs is described in Fig. 1.
In Fig. 1, through the given stock price series and technical indicators, it shows that three steps are used in the data preprocessing procedure to generate the
In Fig. 2, first, the data preprocessing procedure is executed to derive
Components of Proposed Approach
In this section, the three main components of the proposed algorithm, including the encoding schema, the fitness function and reproduction, and the genetic operations, are stated in Sections VI.A to VI.C.
A. Encoding Schema
To effectively solve a task using the GA, it is important to design a data structure to represent a solution, which is known as the encoding schema. The purpose of this paper is to design an algorithm to obtain a GTSP that could reach both objective and subjective criteria. As stated in Section III, a GTSP is a set of groups where every group has TSs and the allocated capital. Thus, three parts, namely, the grouping, the trading strategy, and the weight parts, are utilized to represent a GTSP. The encoding schema is illustrated in Fig. 3.
In Figure 3, the grouping part indicates the number of groups to which TSs can belong. The trading strategy part expresses what TSs could be included in every group. Each
Figure 4 shows that there are four groups,
B. Fitness Function and Reproduction
To derive an optimized GTSP, various factors, such as objective and subjective criteria, should be taken into consideration for designing an effective fitness function. For evaluating the quality of a TSP, the maximum return and minimum risk are the two commonly known objective factors that should be considered. In addition, because every group has its own TSs that have similar properties and allocated weights, different factors that are the group balance and the weight balance should also be designed to access groups in a GTPS. As a result, the fitness function, which is shown in Formula (1), is used to evaluate a chromosome.\begin{equation*} f(C_{q})=PR(C_{q})^\ast Risk(C_{q})^\ast GB(C_{q})^{\alpha \ast } WB(C_{q}),\tag{1}\end{equation*}
\begin{equation*} {PR(C_{q}) =}\frac {\sum \limits _{j={1}}^{numTSP} {{return(TSP_{j})}}}{numTSP},\tag{2}\end{equation*}
\begin{align*} return(TSP_{j}) \!=\!\sum \limits _{i=1}^{K} {avgReturnRate(TS_{i}^{j})^\ast {weight_{i}} ^\ast {Capital}}, \\\tag{3}\end{align*}
\begin{equation*} avgReturnRate(TS_{i}^{j})=\frac {\sum \limits _{h=1}^{frequency_{i}} {returnRate(TS_{ih}^{j})}}{frequency_{i}},\tag{4}\end{equation*}
\begin{equation*} returnRate(TS_{ih}^{j})=\frac {sellPrice_{h} -{buyPrice}_{h}}{buyPrice_{h}},\tag{5}\end{equation*}
\begin{equation*} {risk(C_{q}) =}\frac {\sum \limits _{j={1}}^{numTSP} {{risk(TSP_{j})}}}{numTSP},\tag{6}\end{equation*}
\begin{equation*} risk(TSP_{j}) = min(MDD(TS_{1}^{j})\ldots,MDD(TS_{k}^{j})),\tag{7}\end{equation*}
\begin{align*}&MDD(TS_{i}^{j}) \\&=\! \min (returnRate(TS_{i1}^{j})\ldots,returnRate(TS_{ifrequent_{i}}^{j})),\tag{8}\end{align*}
\begin{equation*} GB(C_{q})=\sum \limits _{i=1}^{K} {-\frac {\left |{ {G_{i}} }\right |}{N} log \frac {\left |{ {G_{i}} }\right |}{N}},\tag{9}\end{equation*}
\begin{equation*} WB(C_{q})=\sum \limits _{i=1}^{K+1} {-\frac {\left |{ {c_{i}} }\right |}{T} log \frac {\left |{ {c_{i}} }\right |}{T}},\tag{10}\end{equation*}
C. Genetic Operations
The genetic operations are introduced in this section, including crossover, mutation and inversion. For crossover operations, they are applied on the grouping and weighting parts. In the grouping part, it first picks two individuals randomly, where one is used as the base chromosome and the other one is the insertion chromosome. Then, parts of groups in the insertion chromosome are selected and put into the base chromosome. After insertion, groups in the base chromosome are removed if they are redundant. At last, groups are merged or split until the number of groups in a chromosome is correct. To execute the crossover operation on the weight part, the two-point crossover operator is employed to generate new chromosomes in which two points will first be determined and their sub sequences will be exchanged. Note that the appropriate arrangement should be made to ensure that the numbers of ‘1’s and ‘0’s in a chromosome are correct. Below, the procedure for the crossover on the weight part is shown in Fig. 5.
Figure 5 shows that two crossover points,
For the mutation operations, they are performed on the trading strategy and the weight parts. To execute the mutation operation on the trading strategy part, it first chooses two groups,
Proposed Algorithm
This section outlines the proposed algorithm to derive a GTSP using the GGA. To make the proposed algorithm easily understood, its pseudo code is first described in Section V.A, and an example of it follows to illustrate it in Section V.B.
A. Pseudo Code of the Proposed Approach
In this section, the pseudo code of the proposed algorithm that is utilized to optimize a GTSP is shown in Fig. 6.
Fig. 6 exhibits how the proposed approach can be employed to optimize a GTSP based on the given stock price series and the technical indicators using the GGA. The data preprocessing, which is described in Fig. 1, is used to select
B. An Example
To illustrate the proposed algorithm, an example with eight steps is given in this section. Assume that there are 15 strategies derived by the data preprocessing procedure, and their related information is shown in Table 1.
The attribute Avg. Return Rate is calculated using Formula (4). The attribute MDD is the risk of a stock and is calculated by finding the maximum loss during the whole transaction period. It is calculated using Formula (8). The proposed approach is illustrated as follows.
STEP 1:
Assume that pSize and
were set at 10 and 3. The chromosomes are generated to form the initial population as follows.K The 15 strategies are randomly divided into three groups to form the grouping part. Take chromosome
as an example. Its group part may be [C_{1} : {3, 4, 5, 10},G_{1} : {0, 1, 6, 8, 9, 11, 12, 14},G_{2} : {2, 7, 13}].G_{3} Randomly generate the weight part with three 0s and one hundred 1s. For example, the weights for reserved cash, group 1, group 2 and group 3 are 0.29, 0.5, 0.14, and 0.07, respectively, when the weight part of
is generated as [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1]. Note that for the sake of being concise, we will directly use real numbers to represent the bit strings in the following sections. In other words, chromosomeC_{1} is represented as: [{3, 4, 5, 10}, {0, 1, 6, 8, 9, 11, 12, 14}, {2, 7, 13}, 0.29, 0.5, 0.14, 0.07].C_{1} Repeating the previous two substeps, an initial population with ten chromosomes is generated as follows:
C1: [{3, 4, 5, 10}, {0, 1, 6, 8, 9, 11, 12, 14}, {2, 7, 13}, 0.29, 0.5, 0.14, 0.07];
C2: [{3, 5, 8, 11, 13}, {1, 4, 6, 7, 10, 12}, {0, 2, 9, 14}, 0.05, 0.18, 0.11, 0.66];
C3: [{1, 3, 8, 11, 13}, {0, 4, 6, 7, 10, 12, 14}, {2, 5, 9}, 0.62, 0.26, 0.07, 0.05];
C4: [{3, 8, 13, 14}, {1, 6, 7, 12}, {0, 2, 4, 5, 9, 10, 11}, 0.29, 0.13, 0.04, 0.54];
C5: [{1, 6, 7, 8, 11, 12}, {2, 3, 10}, {0, 4, 5, 9, 13, 14}, 0.44, 0.05, 0.29, 0.22];
C6: [{0, 1, 2, 5, 8, 9}, {3, 4, 10}, {6, 7, 11, 12, 13, 14}, 0.08, 0.02, 0.65, 0.25];
C7: [{1, 4, 6}, {0, 3, 5, 8, 9, 10, 11, 12}, {2, 7, 13, 14}, 0.33, 0.25, 0.23, 0.19];
C8: [{1, 2, 7, 9, 11, 12}, {4, 6, 10, 13, 14}, {0, 3, 5, 8}, 0.21, 0.04, 0.67, 0.08];
C9: [{1, 5, 7, 8, 10, 12}, {0, 3, 4, 6}, {2, 9, 11, 13, 14}, 0.11, 0.12, 0.4, 0.37];
C10: [{0, 1, 3, 5, 6, 7, 12, 13}, {2, 9, 10, 14}, {4, 8, 11}, 0.24, 0.17, 0.01, 0.58].
STEP 2:
The fitness value of each chromosome is calculated using the following sub-steps.
The trading strategy portfolios are first generated. Take chromosome
as an example. According to its grouping part [C_{1} : {3, 4, 5, 10},G_{1} : {0, 1, 6, 8, 9, 11, 12, 14},G_{2} : {2, 7, 13}], there are 96 (G_{3} ) possible trading strategy portfolios. All of them are collected in a set= 4\times 8\times3 .TSP = \{tsp_{1}, tsp_{2}, \ldots, {\textit{tsp}}_{96}\}= \{\{3, 0, 2\}, \{3, 0, 7\}, \{3, 0, 13\}, {\ldots }, \{10, 14, 13\}\} The portfolio return of each chromosome is calculated as follows.
The return of each trading strategy portfolio is then calculated. Take tsp1: {3, 0, 2} as an example. According to the weight part of chromosome
, which is [0.29, 0.5, 0.14, 0.07], we assume that investment capital is 100000, and the profits of tsp1 are 24658 (= [C_{1} (0.354\times )100000\times0.5 (+ 0.320\times )100000\times0.14 (+ 0.354\times )]).100000\times0.07 The portfolio return of a chromosome can be calculated using Formula (2), and the results are shown in Table 2.
The risk in each chromosome is then calculated as follows.
The maximum draw down of every trading strategy is normalized to 0 to 1. After normalization, the maximum draw down of each trading strategy is shown in Table 3.
The risk of each
in the set TSP is calculated. Take tsp1: {3, 0, 2} as an example. The risk of tsp1 is calculated as 0.742 (= min(0.809, 0.742, 0.809)) by Formula (7).tsp_{j} The risk of a chromosome is set by Formula (6), and the results are shown in Table 4.
The group balance of each chromosome is calculated according to its grouping part. Take chromosome
as an example. Since the grouping part ofC_{1} is [C_{1} : {3, 4, 5, 10},G_{1} :{0, 1, 6, 8, 9, 11, 12, 14},G_{2} :{2, 7, 13}], the GB (G_{3} ) is calculated as 1.019 using Formula (9). The group balances of the other chromosomes are shown in Table 5.C_{1} The weight balance of each chromosome is then calculated according to its weight part. Take chromosome
as an example. Since the weight part ofC_{1} is [0.29, 0.5, 0.14, 0.07], the WB (C_{1} ) is calculated as 1.362 using Formula (10). The weight balances of the other chromosomes are shown in Table 6.C_{1} The fitness value of chromosome
is 1124.463 (C_{1} ) using Formula (1) and assuming that= 8549.419\times 0.093\times 1.019^{2}\times1.362 is 2. In the same way, the fitness values of other chromosomes can be calculated and the results are given in Table 7.\alpha
Step 3:
If the termination condition is not reached, the selection operator is applied on the population to generate the next population. The ten chromosomes derived by the previous step are selected to form the next population using the elitist selection strategy.
Step 4:
The crossover operation is utilized in this step to generate new offspring. Take chromosomes
andC_{6} asC_{9} an example for illustrating the crossover on weight part. Since the weight parts of_{} andC_{6} are [1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] and [1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1], and assuming that the initial cutoff points are 3 and 70, the new cutoff points will become 3 and 66 after the arrangement. As a result, the newly formed weight parts of the two chromosomes are [0.11, 0.12, 0.52, 0.25] and [0.08, 0.02, 0.53, 0.37]. Then, chromosomesC_{9} andC_{2} are used to demonstrate the crossover operation on the grouping part. The grouping parts ofC_{9} andC_{2} are [C_{9} : {3, 5, 8, 11, 13},G_{1} : {1, 4, 6, 7, 10, 12},G_{2} : {0, 2, 9, 14}] and [G_{3} : {1, 5, 7, 8, 10, 12},G_{1} : {0, 3, 4, 6},G_{2} : {2, 9, 11, 13, 14}]. Let the insertion position of the base chromosomeG_{3} be betweenC_{2} andG_{1} , and the insertion sequence selected by chromosomeG_{2} is [C_{9} : {0, 3, 4, 6},G_{2} : {2, 9, 11, 13, 14}]. After the crossover with arrangement, the grouping part ofG_{3} becomes [C_{2} : {1, 5, 7, 8, 10, 12}, G2: {0, 3, 4, 6},G_{1} : {2, 9, 11, 13, 14}].G_{3} Step 5:
The mutation operation is then performed on the population. Here, chromosome
is used to show the mutation operation on the strategy part. Assuming that the trading strategy TS11 inC_{3} is moved toG_{1} , the grouping part ofG_{2} becomes [G1: {0, 1, 2, 3, 5, 7},C_{3} : {4, 6, 8, 11, 12, 13},G_{2} : {9, 10, 14}]. With respect to the mutation on the weight part, assume that two genes with different values, which are genes 5 and 90, are picked, and the weight part ofG_{3} is changed to [0.04, 0.57, 0.34, 0.05].C_{3} Step 6:
The inversion operation is executed on the grouping part. Take chromosome
as an example. Since the grouping part ofC_{5} is [C_{5} : {1, 6, 7, 8, 11, 12},G_{1} : {2, 3, 10},G_{2} : {0, 4, 5, 9, 13, 14}] and assuming thatG_{3} andG_{2} are exchanged, the grouping part then becomes [G_{3} : {1, 6, 7, 8, 11, 12},G_{1} : {0, 4, 5, 9, 13, 14},G_{2} : {2, 3, 10}].G_{3} Steps 7 and 8:
If the stop criterion is satisfied, the GTSP with the best fitness value is output. In this example, after 100 generations, the derived GTSP is [
: {1, 2, 7, 9, 11, 12},G_{1} : {4, 6, 10, 13, 14},G_{2} : {0, 3, 5, 8}, 0.14, 0.27, 0.24, 0.35]. TheG_{3} shows that the fifteen strategies are divided into three groups. GroupC_{best} contains TS1 , TS2 , TS7 , TS9 , TS11 and TS12. GroupG_{1} contains TS4, TS6, TS10, TS13 and TS14. GroupG_{2} has TS0, TS3, TS5 and TS8. The weight part indicates the proportion of capital for groups to reach good profits, and there are 120 trading strategy portfolios (G_{3} ) that can be provided to investors for making trading plans in accordance with the grouping part.= 6\times 5\times4
Experimental Results
In this section, the experiments were conducted on three real financial datasets with different trends to verify the merits of the proposed approach. The number of groups, number of trading strategies and population size were set at 3, 15 and 50, respectively. The crossover rate, mutation rate, inversion rate and number of generations were set at 0.8, 0.03, 0.6 and 100, respectively. The stop-loss point and take-profit point were set at −15% and 15%. The data descriptions are described in Section VI.A. The experimental results on the three datasets are discussed in Section VI.B. At last, the optimized GTSP is shown in Section VI.C.
A. Data Descriptions
To verify the proposed approach, we conducted experiments on two datasets with different market trends, including the sideways trend and the downtrend. Three real financial datasets were collected from 2011/01 to 2016/12 and are shown in Figures 7 and 8.
Figure 7 shows that the stock prices of the sideways trend dataset are between 100 and 400. When applying the buy and hold trading strategy (BHS) on it, the returns of 2012, 2013, 2014, 2015 and 2016 are 32%, 25%, 10% and −21%, respectively. As to the downtrend dataset, from Figure 8, the maximum and minimum stock prices are closer to 1500 and 100, respectively. When using BHS, the returns of 2012, 2013, 2014, 2015 and 2016 are −40%, −53%, −1%, −45% and −2%, respectively.
In the proposed approach, ten technical indicators presented in [7] and [15] were used in the data preprocessing procedure to form the trading strategies, and the parameter settings of the used indicators were set according to [22]. The ten technical indicators are the Moving Average (MA), the Relative Strength Index (RSI), the Williams%R (WMS%R), Momentum (MOM), Psychology (PSY), the Commodity Channel Index (CCI), the stochastic oscillator (KD), the Moving Average Convergence-Divergence (MACD), the Bias ratio (BIAS), and the Directional Movement Index (DMI). Trading rules are then generated using the ten technical indicators to identify buy or sell signals and are shown in Table 8.
Table 8 shows that there are twenty trading rules, ten for buying rules and ten for selling rules, that are used for finding trading signals. Then, a trading strategy can be formed using one buying rule and one selling rule. For example, a trading strategy could be “If MA5 rises above MA20, it generates a buying signal, and if MA5 falls below MA20, it generates a selling signal.” Because there are 10 buying and 10 selling rules, 100 different trading strategies can be formed. Hence, using the data preprocessing procedure with the ranking functions,
Experimental results on the two different market trends are shown and discussed in Sections VI.B and VI.C. Two sets of trading strategies are picked using the data preprocessing procedures, namely, TOP15 and TOP555, to generate the GTSPs to verify the proposed approach. The top-15 trading strategies are selected from the 100 trading strategies to form the TOP15 set using the average return rate as a ranking function. To generate the TOP555 set, each of three ranking functions, which are the average return rate, trading frequency and maximum draw down, is utilized to pick five trading strategies. Then, the fifteen trading strategies are used to derive the GTSPs from the datasets with different training and testing intervals.
B. Evaluation on the Sideways Trend Dataset
In this section, experiments were conducted on the sideways trend dataset using the two trading strategies sets, TOP15 and TOP555. Tables 9 and 10 show the comparison results of the derived GTSPs using TOP15 and TOP555 on different training and testing periods with stop-loss and take-profit points (SLTP) and that using the BHS in terms of returns. Note that when the SLTP is considered in the proposed algorithm, it not only can reduce the transaction cost because the number of trading frequency is decreased but also provide the ability for the algorithm to avoid huge loss.
From Table 9, we can observe that the returns of the proposed approach with SLTP are better than that without SLTP. Then, when the training periods are more than two years, most of the derived GTSPs can achieve better returns than the BHS. In addition, when the testing period is 2016, the returns of the GTSPs trained using one, two and three years as training periods are 11%, 15%, and 16%, respectively. Because the return of the BHS is −20%, we can easily understand that the proposed approach is better than the BHS and can have positive returns on the sideways trend dataset. Comparing them in terms of average returns, we can also know that the proposed approach can have higher returns (18.8%) than the BHS (10%).
From Table 10, we can see that the returns of the proposed approach with SLTP are still better than that without SLTP. Comparing the proposed approach with the BHS, we can also observe that the proposed approach is effective because the returns of the proposed approach are almost positive. Especially in 2016, the returns of the derived GTSPs trained from one-, two- and three-year training datasets are 13%, 19% and 18%, respectively, which are better than the BHS of −20%.
C. Evaluation on the Downtrend Dataset
Experiments were then conducted on the downtrend dataset. In the following, the TOP15 and TOP555 are used to verify the effectiveness of the proposed approach. The comparison results of the proposed approach using the TOP15 and TOP555 on different training and testing periods and the BHS in terms of returns are given in Tables 11 and 12.
From Table 11, we can observe that irrespective of whether one-, two- or three-year training datasets are used for training, the proposed approach is better than the BHS in terms of returns. However, in the downtrend dataset, the proposed approach with SLTP can still reach better returns than that without the SLTP in most cases. Comparing the proposed approach with the BHS in terms of average returns, because their returns are −0.016 and −0.244, we can clearly know that the proposed approach is more effective at avoiding huge losses than the BHS. In addition, since the returns of the GTSPs trained from the two-year training periods are almost positive, we can also conclude that using the two-year training period to obtain GTSPs for making trading plans is appropriate when the market trend is a downtrend.
From Table 12, comparing the derived GTSPs with the BHS in terms of average returns, which are −0.014 and −0.244, it shows that the proposed approach has better returns than the BHS and also a higher ability to avoid losses. According to the results shown in Tables 11 and 12, we can say that the proposed approach is effective on the downtrend dataset, which means that the derived GTSPs have the ability to get positive returns with higher probability, or at least lose less money in bear markets.
D. Evaluation on the Derived GTSPs
At last, the optimized GTSPs by the proposed approach using 2014 to 2015 for training and 2016 as the testing period on the two datasets are illustrated in Tables 13 and 14. Since a GTSP can generate many TSPs, we use three measurements, namely, the MAXROI, AVGROI and MINROI, to indicate the quality of the optimized GTSPs. The MAXROI represents that the TSP generated from a GTSP can have the largest return. The MINROI, on the contrary, represents that the return of the TSP generated from a GTSP is the smallest. The AVGROI is the average return of all TSPs that can be generated from a GTPS.
Three observations can be found from Tables 13 and 14. First, the returns of the optimized GTSPs are positive and the proposed approach with the SLTP is again better than that without SLTP in terms of returns. Second, comparing the returns of the optimized GTSPs with the BHS on the two datasets, we know that regardless of which TSP is utilized for trading, their returns are better than the BHS. Third, comparing the proposed approach with TOP15 to that with TOP555, we also observe that using TOP555 as an input trading strategy set could get more stable returns than TOP15. For instance, the MAXROI, AVGROI and MINROI on the sideways trend dataset for TOP15 are 0.22, 0.15 and 0.00, respectively, and those for TOP555 are 0.24, 0.19 and 0.15, respectively. Note that the descriptions of the trading strategies are shown in Appendix I.
Conclusions and Future Work
In stock markets, a common way to find trading signals is using TSs, which could be generated by technical or fundamental indicators. To provide a more useful TSP, we first defined the GTSPO problem and then proposed an algorithm to obtain a GTSP using the GGA. To encode a GTSP into a chromosome, three parts, named the grouping, the trading strategy, and the weight parts, are used to represent a GTSP. Then, the fitness value of every chromosome is calculated according to four factors, which are the portfolio return, risk, weight balance, and group balance. The genetic operators are executed to generate various offspring. After evolution, by using the optimized GTSP, various TSPs can be provided to traders for making trading plans. Experiments on two real datasets, the sideways trend and the downtrend, were made to show the effectiveness of the proposed algorithm. As a result, three merits are described as follows: (1) The proposed approach with SLTP is better than that without SLTP in terms of returns; (2) on both datasets, the obtained GTSPs can have a better ability to reduce losses and increase returns than using the BHS; and (3) using TOP555 as the inputted trading strategy set, the proposed approach can derive a better GTSP than that using TOP15, especially in a bear market. In the future, several ways could be used to enhance the proposed algorithm, such as using the fuzzy grouping genetic algorithm to find a GTSP effectively and employing island-based algorithms to efficiently optimize a GTSP. Besides, based on the proposed approach, enhanced optimization approaches could also be designed to select appropriate set of trading strategies, e.g., TOP5, TOP10, or TOP20, and/or to decide a suitable number of trading strategies for deriving a GTSP.
ACKNOWLEDGMENT
This paper was presented at The Multidisciplinary International Social Networks Conference, in 2017.