Processing math: 100%
An Effective Approach for Obtaining a Group Trading Strategy Portfolio Using Grouping Genetic Algorithm | IEEE Journals & Magazine | IEEE Xplore

An Effective Approach for Obtaining a Group Trading Strategy Portfolio Using Grouping Genetic Algorithm


The flowchart of the proposed approach to derive a GTSP.

Abstract:

To determine an appropriate trading time for buying or selling stocks is always a difficult task. The common way to deal with it is using trading strategies formed by tec...Show More

Abstract:

To determine an appropriate trading time for buying or selling stocks is always a difficult task. The common way to deal with it is using trading strategies formed by technical or fundamental indicators. Lots of approaches have been presented on how to form trading strategies and how to set suitable parameters for those strategies. Furthermore, some approaches were also designed to optimize a trading strategy portfolio, which is a set of strategies where the return and risk of the portfolio can be maximized and minimized, respectively. To provide a more useful trading strategy portfolio, we first define a group trading strategy portfolio (GTSP). Then, an algorithm that utilizes the grouping genetic algorithm is designed for solving the GTSP optimization problem. In the chromosome representation, the grouping, strategy, and weight parts are employed to encode a possible GTSP. The fitness value of a chromosome is calculated by the group balance, weight balance, portfolio return, and risk to assess the quality of every possible solution. Genetic operators, including crossover, mutation, and inversion, are applied on the population to form a new offspring. Evolution is continued until the stop conditions are reached. Lastly, experiments were conducted on two real datasets with different trends to show that the advantages and the effectiveness of the presented approach.
The flowchart of the proposed approach to derive a GTSP.
Published in: IEEE Access ( Volume: 7)
Page(s): 7313 - 7325
Date of Publication: 06 January 2019
Electronic ISSN: 2169-3536

Funding Agency:


SECTION I.

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.

  1. First, the group trading strategy portfolio optimization (GTSPO) problem is defined in order to provide more convenient ways for traders to establish trading plans.

  2. Then, an approach is designed to solve the GTSPO in order to optimize a GTSP using the GGA.

  3. 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).

  4. 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.

  5. 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.

SECTION II.

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.

SECTION III.

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 h TSs and is expressed as TSP = \{TS_{1}, TS_{2}, \ldots, TS_{h}\} , where h is larger than 2. For instance, a TSP could be {TS1: “If the CCI value of a stock crosses −100 from the bottom, then a buy signal is suggested, and if the CCI value of a stock crosses 100 from the top, then a sell signal is suggested”, TS2: “If the 5-day moving average value crosses the 20-day moving average from the bottom, then a buy signal is suggested, and if the 20-day moving average value crosses the 5-day moving average from the top, then a sell signal is suggested”}. Note that the return and risk values of a TSP are a common way to evaluate the quality of a TSP.

Definition 3 (Trading Strategy Group (TSG)):

A TSG contains a set of trading strategies TSP = \{TS_{1}, TS_{2}, \ldots, TS_{n}\} . The TSs in the same group have properties that are similar. For instance, the properties could be the ability to avoid risk.

Definition 4 (Grouping Problem):

The purpose of the grouping problem is to divide n instances into a specific number of groups, where each instance can only belong to a group. According to [13] and [14], given a set of instances U = \{u_{1}, u_{2}, \ldots, u_{n}\} , the definition of grouping problem can be represented as: \cup U_{i} = U , and U_{i} \cap U_{j}= \emptyset , i \ne j . In general, the grouping problem has a cost function, which is formed from the hard constraints of each problem and used to evaluate the quality of combinations of elements generated from groups.

Definition 5 (Group Trading Strategy Portfolio (GTSP)):

A GTSP consists of K TSGs and is represented as GTSP = \{TSG_{1}, {TSG}_{2}, \ldots, TSG_{K}\} . Using a GTSP, lots of trading strategy portfolios can be formed, which is represented as \vert {GTS}_{1}\vert \times \vert {GTS}_{2}\vert \times \ldots \times \vert {GTS}_{K}\vert . For instance, assume that a GTSP has three groups that contain 3, 4, and 3 TSs. Thus, 36 (= 3\times 4\times3 ) TSPs can be derived in total.

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.

FIGURE 1. - Data preprocessing procedure to form trading strategies.
FIGURE 1.

Data preprocessing procedure to form trading strategies.

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 m processed TSs. First, according to the selected n technical indicators, a combination of them is utilized to generate all possible TSs. Second, trading signals, including sell and buy signals, are derived from the stock price series for every TS. In the third step, m TSs are kept by using the three ranking functions, including the average return rate, the trading frequency, and the maximum draw down. By combining the data preprocessing procedure, the framework of the proposed algorithm is shown in Fig. 2.

FIGURE 2. - Framework of the proposed approach.
FIGURE 2.

Framework of the proposed approach.

In Fig. 2, first, the data preprocessing procedure is executed to derive m TSs, as described in Fig. 1. Then, an initial population is formed based on the predefined population size and the derived m TSs, where every chromosome in the population is a GTSP and is represented by grouping, trading strategy and weighting parts. The four factors, including the portfolio return, the risk of the portfolio, the weight balance and the group balance, are utilized to form the fitness function for the chromosome quality evaluation. According to fitness values of solutions, the selection operation is used to produce the next population. The genetic operators of crossover, mutation and inversion are executed to find new solutions. The evolution is repeated until the stop conditions are reached. Finally, the best GTSP that has the highest fitness value will be delivered to users for making trading plans.

SECTION IV.

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.

FIGURE 3. - Encoding schema for a GTSP.
FIGURE 3.

Encoding schema for a GTSP.

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 c_{j} in the weight part is a ‘1’ string that represents the invested capital of the j -th groups, and c_{0} represents the capital to be reserved. A symbol ‘0’ is employed to separate the two groups c_{i} and c_{j} . In accordance with the encoding schema, the initial population can be then generated randomly. Below, an example is given to demonstrate a chromosome. Assume that there are 15 trading strategies and that the number of groups is 4. A possible chromosome is shown in Fig. 4.

FIGURE 4. - A possible chromosome.
FIGURE 4.

A possible chromosome.

Figure 4 shows that there are four groups, G_{1}, G_{2}, G_{3} and G_{4} . Group G_{1} contains the five trading strategies TS4, TS5, TS6, TS7 and TS14. Since the number of ’1’s in c_{0} and the total number of ‘1’s in the weighting part are one and five, respectively, it means that 20% (= 1/5) capital is reserved. In the same way, we know that the number of ‘1’s in c_{1} to c_{4} is 0, 3, 1 and 0, respectively. Thus, the weights for groups G_{1} to G_{4} are 0%, 60%, 20% and 0%, respectively. In this GTSP, 10 (= 2\times5 ) trading strategy portfolios can be generated and provided to users.

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*} View SourceRight-click on figure for MathML and additional features. where PR (C_{q} ) is the portfolio return, Risk (C_{q} ) is the risk of a GTSP, GB (C_{q} ) and WB (C_{q} ) are the group balance and weight balance, and \alpha is a parameter used to show the influence of the group balance. In the following, those four factors are described. The PR (C_{q} ) is defined in Formula (2).\begin{equation*} {PR(C_{q}) =}\frac {\sum \limits _{j={1}}^{numTSP} {{return(TSP_{j})}}}{numTSP},\tag{2}\end{equation*} View SourceRight-click on figure for MathML and additional features. where return (TSP_{j} ) is the profit of a trading strategy portfolio TSP_{j} , and numTSP is the number of TSPs that can be formed from C_{q} . The return (TSP_{j} ) is defined in Formula (3).\begin{align*} return(TSP_{j}) \!=\!\sum \limits _{i=1}^{K} {avgReturnRate(TS_{i}^{j})^\ast {weight_{i}} ^\ast {Capital}}, \\\tag{3}\end{align*} View SourceRight-click on figure for MathML and additional features. where avgReturnRate (TS_{i}^{j} ) is the average return rate of TS in group G_{i}, weight_{i} is the weight of group G_{i} , and Capital is the capital that a trader uses for trading. The higher the returns of TSPs generated from a chromosome are, the better the GTSP is. The avgReturnRate (TS_{i}^{j} ) is stated in Formula (4).\begin{equation*} avgReturnRate(TS_{i}^{j})=\frac {\sum \limits _{h=1}^{frequency_{i}} {returnRate(TS_{ih}^{j})}}{frequency_{i}},\tag{4}\end{equation*} View SourceRight-click on figure for MathML and additional features. where frequency_{i} is the number of trading times in the given training period, and returnRate(TS _{ih}^{j}) is described in Formula (5).\begin{equation*} returnRate(TS_{ih}^{j})=\frac {sellPrice_{h} -{buyPrice}_{h}}{buyPrice_{h}},\tag{5}\end{equation*} View SourceRight-click on figure for MathML and additional features. where the sellPrice_{h} and buyPrice_{h} are the sell and buy prices of the h -th trading using the i -th TS in TSP_{j} , respectively. Then, the risk of a chromosome is shown in Formula (6).\begin{equation*} {risk(C_{q}) =}\frac {\sum \limits _{j={1}}^{numTSP} {{risk(TSP_{j})}}}{numTSP},\tag{6}\end{equation*} View SourceRight-click on figure for MathML and additional features. where risk (TSP_{j} ) is the risk of a TSP, numTSP is the number of TSPs generated from C_{q} , and risk (TSP_{j} ) is defined in Formula (7).\begin{equation*} risk(TSP_{j}) = min(MDD(TS_{1}^{j})\ldots,MDD(TS_{k}^{j})),\tag{7}\end{equation*} View SourceRight-click on figure for MathML and additional features. where MDD (TS_{i}^{j} ) is the maximum draw down of a TS in G_{i} of TSP_{j} , and K is the number of groups. It indicates that the risk of a TSP is calculated using the minimum and maximum draw down of TSs in the TSP. Note that the maximum draw down of TSs will be normalized from 0 to 1. The MDD (TS_{i}^{j} ) is given in Formula (8).\begin{align*}&MDD(TS_{i}^{j}) \\&=\! \min (returnRate(TS_{i1}^{j})\ldots,returnRate(TS_{ifrequent_{i}}^{j})),\tag{8}\end{align*} View SourceRight-click on figure for MathML and additional features. where returnRate(TS _{ih}^{j} ) is the same as that given in Formula (5). The GB (C_{q} ), which is the group balance of a chromosome, is defined in Formula (9).\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*} View SourceRight-click on figure for MathML and additional features. where \vert G_{i}\vert is the number of TSs in G_{i} , and N is the number of the given TSs. The purpose of the group balance is to ensure that the number of TSs is similar among groups in the chromosome C_{q} . The weight balance, WB (C_{q} ), is defined in Formula (10).\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*} View SourceRight-click on figure for MathML and additional features. where \vert c_{i}\vert is the length of the string c_{i} , and T is the summation of length of strings c_{i}, 0\le i \le K . The goal of the weighted balance is to reduce the probability that all capital is located in certain specific groups. Utilizing the designed fitness function, the fitness value of each chromosome can be evaluated. The reproduction can be executed in accordance with the fitness values to select the next population using different strategies. For instance, elitist selection or roulette wheel selection could be employed, where elitist selection is used to form the next population in the proposed algorithm.

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. - Crossover on the weight part.
FIGURE 5.

Crossover on the weight part.

Figure 5 shows that two crossover points, s and t , are first generated (Line 2). The genes between the s and t of chromosomes C_{A} and C_{B} will start to be changed. Because we need to ensure that the sections to be exchanged have the same number of 1s, when the selected crossover points do not satisfy this condition of having the same number of 1s, then the crossover point t will subtract 1 until the condition is satisfied (Lines 3 to 5). Finally, the qualified sections are exchanged and the generated C^{new}_{A} and C^{new}_{B} are returned. If the procedure cannot find the same number of 1s between points s and t , it will not perform the crossover operator.

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, G_{i} and G_{j} , that both contain more than one trading strategy. Then, a trading strategy in group G_{i} is picked and reassigned randomly to the group G_{j} . With respect to the mutation operator on the weight part, two genes are selected and exchanged if they have different values. Finally, the inversion operation is executed only on the grouping part. Since the purpose of inversion operation is to increase the diversity of chromosomes, this operation exchanges two groups from the two selected groups.

SECTION V.

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.

FIGURE 6. - The pseudo code of the proposed approach.
FIGURE 6.

The pseudo code of the proposed approach.

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 m trading strategies (Line 2). The m selected strategies are utilized to find buy and sell signals and form the initial population (Lines 3 to 4). Every chromosome is then evaluated using the fitness function, which is composed of the four factors of the portfolio return, risk, group balance and weight balance (Lines 6 to 13). The crossover, mutation, inversion and selection operations are executed on the population to generate new offspring and the next population (Lines 14 to 18). Finally, when the stop conditions are reached, the best chromosome, which is the optimized GTSP, is output for use (Line 20).

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.

TABLE 1 Strategies and Related Information Used in This Example
Table 1- 
Strategies and Related Information Used in This Example

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 K were set at 10 and 3. The chromosomes are generated to form the initial population as follows.

    1. The 15 strategies are randomly divided into three groups to form the grouping part. Take chromosome C_{1} as an example. Its group part may be [G_{1} : {3, 4, 5, 10}, G_{2} : {0, 1, 6, 8, 9, 11, 12, 14}, G_{3} : {2, 7, 13}].

    2. 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 C_{1} 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, chromosome C_{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].

    3. 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.

    1. The trading strategy portfolios are first generated. Take chromosome C_{1} as an example. According to its grouping part [G_{1} : {3, 4, 5, 10}, G_{2} : {0, 1, 6, 8, 9, 11, 12, 14}, G_{3} : {2, 7, 13}], there are 96 (= 4\times 8\times3 ) possible trading strategy portfolios. All of them are collected in a set TSP = \{tsp_{1}, tsp_{2}, \ldots, {\textit{tsp}}_{96}\}= \{\{3, 0, 2\}, \{3, 0, 7\}, \{3, 0, 13\}, {\ldots }, \{10, 14, 13\}\} .

    2. The portfolio return of each chromosome is calculated as follows.

      1. 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 C_{1} , which is [0.29, 0.5, 0.14, 0.07], we assume that investment capital is 100000, and the profits of tsp1 are 24658 (= [0.354\times (100000\times0.5 ) + 0.320\times (100000\times0.14 ) + 0.354\times (100000\times0.07 )]).

      2. The portfolio return of a chromosome can be calculated using Formula (2), and the results are shown in Table 2.

    3. The risk in each chromosome is then calculated as follows.

      1. 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.

      2. The risk of each tsp_{j} 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).

      3. The risk of a chromosome is set by Formula (6), and the results are shown in Table 4.

    4. The group balance of each chromosome is calculated according to its grouping part. Take chromosome C_{1} as an example. Since the grouping part of C_{1} is [G_{1} : {3, 4, 5, 10}, G_{2} :{0, 1, 6, 8, 9, 11, 12, 14}, G_{3} :{2, 7, 13}], the GB (C_{1} ) is calculated as 1.019 using Formula (9). The group balances of the other chromosomes are shown in Table 5.

    5. The weight balance of each chromosome is then calculated according to its weight part. Take chromosome C_{1} as an example. Since the weight part of C_{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.

    6. The fitness value of chromosome C_{1} is 1124.463 (= 8549.419\times 0.093\times 1.019^{2}\times1.362 ) using Formula (1) and assuming that \alpha is 2. In the same way, the fitness values of other chromosomes can be calculated and the results are given in Table 7.

  • 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 C_{6} and C_{9} as_{} an example for illustrating the crossover on weight part. Since the weight parts of C_{6} and C_{9} 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, chromosomes C_{2} and C_{9} are used to demonstrate the crossover operation on the grouping part. The grouping parts of C_{2} and C_{9} are [G_{1} : {3, 5, 8, 11, 13}, G_{2} : {1, 4, 6, 7, 10, 12}, G_{3} : {0, 2, 9, 14}] and [G_{1} : {1, 5, 7, 8, 10, 12}, G_{2} : {0, 3, 4, 6}, G_{3} : {2, 9, 11, 13, 14}]. Let the insertion position of the base chromosome C_{2} be between G_{1} and G_{2} , and the insertion sequence selected by chromosome C_{9} is [G_{2} : {0, 3, 4, 6}, G_{3} : {2, 9, 11, 13, 14}]. After the crossover with arrangement, the grouping part of C_{2} becomes [G_{1} : {1, 5, 7, 8, 10, 12}, G2: {0, 3, 4, 6}, G_{3} : {2, 9, 11, 13, 14}].

  • Step 5:

    The mutation operation is then performed on the population. Here, chromosome C_{3} is used to show the mutation operation on the strategy part. Assuming that the trading strategy TS11 in G_{1} is moved to G_{2} , the grouping part of C_{3} becomes [G1: {0, 1, 2, 3, 5, 7}, G_{2} : {4, 6, 8, 11, 12, 13}, G_{3} : {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 of C_{3} is changed to [0.04, 0.57, 0.34, 0.05].

  • Step 6:

    The inversion operation is executed on the grouping part. Take chromosome C_{5} as an example. Since the grouping part of C_{5} is [G_{1} : {1, 6, 7, 8, 11, 12}, G_{2} : {2, 3, 10}, G_{3} : {0, 4, 5, 9, 13, 14}] and assuming that G_{2} and G_{3} are exchanged, the grouping part then becomes [G_{1} : {1, 6, 7, 8, 11, 12}, G_{2} : {0, 4, 5, 9, 13, 14}, G_{3} : {2, 3, 10}].

  • 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 [G_{1} : {1, 2, 7, 9, 11, 12}, G_{2} : {4, 6, 10, 13, 14}, G_{3} : {0, 3, 5, 8}, 0.14, 0.27, 0.24, 0.35]. The C_{best} shows that the fifteen strategies are divided into three groups. Group G_{1} contains TS1 , TS2 , TS7 , TS9 , TS11 and TS12. Group G_{2} contains TS4, TS6, TS10, TS13 and TS14. Group G_{3} 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 (= 6\times 5\times4 ) that can be provided to investors for making trading plans in accordance with the grouping part.

TABLE 2 The Portfolio Returns of the Ten Chromosomes
Table 2- 
The Portfolio Returns of the Ten Chromosomes
TABLE 3 Normalized MDD for Every Strategy
Table 3- 
Normalized MDD for Every Strategy
TABLE 4 The Risks of Ten Chromosomes
Table 4- 
The Risks of Ten Chromosomes
TABLE 5 The Group Balances of all Chromosomes
Table 5- 
The Group Balances of all Chromosomes
TABLE 6 The Weight Balances of all Chromosomes
Table 6- 
The Weight Balances of all Chromosomes
TABLE 7 The Fitness Values of all Chromosomes
Table 7- 
The Fitness Values of all Chromosomes

SECTION VI.

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. - The sideways trend dataset.
FIGURE 7.

The sideways trend dataset.

FIGURE 8. - The downtrend of the dataset.
FIGURE 8.

The downtrend of the dataset.

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 The Trading Rules Generated Using the Ten Technical Indicators
Table 8- 
The Trading Rules Generated Using the Ten Technical Indicators

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, m trading strategies can be selected to form a GTSP.

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.

TABLE 9 Comparison Results of the Derived GTSPs and BHS in Terms of Returns on the Sideways Trend Dataset Using the TOP15
Table 9- 
Comparison Results of the Derived GTSPs and BHS in Terms of Returns on the Sideways Trend Dataset Using the TOP15
TABLE 10 Comparison Results of the Derived GTSPs and BHS in Terms of Returns on the Sideways Trend Dataset Using the TOP555
Table 10- 
Comparison Results of the Derived GTSPs and BHS in Terms of Returns on the Sideways Trend Dataset Using the TOP555

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.

TABLE 11 Comparison Results of the Derived GTSPs and BHS in Terms of Returns on the Downtrend Dataset Using the TOP15
Table 11- 
Comparison Results of the Derived GTSPs and BHS in Terms of Returns on the Downtrend Dataset Using the TOP15
TABLE 12 Comparison Results of the Derived GTSPs and BHS in Terms of Returns on the Downtrend Dataset Using the TOP555
Table 12- 
Comparison Results of the Derived GTSPs and BHS in Terms of Returns on the Downtrend Dataset Using the TOP555

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.

TABLE 13 The Optimized GTSPs on the Sideways Trend Dataset
Table 13- 
The Optimized GTSPs on the Sideways Trend Dataset
TABLE 14 The Optimized GTSPs on the Downtrend Dataset
Table 14- 
The Optimized GTSPs on the Downtrend Dataset

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.

SECTION VII.

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.

Appendix

See Appendix I.

Table

References

References is not available for this document.