Document Type : Original article
Author
Master of Software Engineering, Azad University, Tehran, Iran
Abstract
Keywords
Introduction
Technical tools, including moving averages, are used to forecast stock prices. Using two moving averages is the most common way to find buying and selling points on time, requiring two periods. Optimum lengths for both short-term and long-term periods per share vary according to their price trend. Finding these optimum lengths using traditional methods is costly and usually does not lead to a globally optimal solution. The best way is to use GA intelligent tools. This study seeks to use these indicators in mining stock trading rules. A model for optimal portfolio management is obtained using technical and multiple-objective GA (MOGA) indicators to maximize returns and minimize risk.
This paper utilizes fundamental indicators for stock ranking and selection. Recent research, including Silva et al. (2015), has employed technical and fundamental analyses for portfolio management. This research initially extracts fundamental and technical variables by simulating coefficients to form an optimal portfolio. Then, using real-world studies, trading rules are extracted to manage the portfolio.
Background Research
Absolute stock valuation is practically impossible. Therefore, researchers exploit innovative methods such as local search (LS), taboo search (TS), simulated annealing (SA), ant colony optimization (ACO), particle swarm optimization (PSO), and evolutionary algorithms (EA) to solve the problem (Fonseca & Fleming, 1993). Evolutionary algorithms are based on biological evolution, where solutions are encrypted in the form of chromosomes, and the best candidates are selected to create new populations by the fitness function. By repeating the evolutionary process, the best solution to the problem is obtained. This method considers different limitations of the problem in making chromosomes (Streichert et al., 2004).
In these studies, researchers used evolutionary algorithms to optimize portfolio risk and return using objective-based management planning in portfolio management.
In portfolio management, three types of approaches can be used (Magin et al., 2007):
In the active portfolio management approach, efforts are made to achieve better performance than the market by doing more transactions. Some researchers have employed technical analysis to mine trading rules, including Hirabayashi et al. (2009).
Research Hypothesis
Portfolio management is done using GA and technical indicators such as relative strength index (RSI) and moving averages (MA). In their research, Ruiz et al. (2014) indicated that a higher return on the market could be achieved by using the moving average of the stock price variable.
In GA, by optimizing the variables on the chromosome, we can minimize risk and maximize return in portfolio management.
Research Methods
This research seeks to design a portfolio management model. The goal is to design a model applicable to achieving an appropriate level of risk and return in the portfolio. For this purpose, technical variables are utilized to mine trading rules. The following technical variables will be employed in this study:
Exponential moving average (EMA)
Exponential moving average (EMA) is a trend-following indicator. It helps determine whether the process has started or is ending its cycle. Moving averages, including EMA, can be calculated in several ways. This method has assigned more weight to more up-to-date information (Murphy, 1999). This variable is calculated using Eq. (1). To use it, we use Table 1.
Eq. (1)
Table 1. Assign points to the variable EMA
Event |
Decision |
Score |
In case the price chart is bearish and crosses the EMA |
A strong sell signal |
-1 |
In case the EMA chart is bearish |
Sell signal |
-0.5 |
In case the EMA chart is bullish |
Buy signal |
0.5 |
In case the price chart is bullish and crosses the EMA |
Strong buy signal |
1 |
Hall Moving Average (HMA)
This variable is also a trend-following indicator. Hull Moving Average (HMA) has a smoother chart than EMA. The price charts of these variables are closer to each other. It is commonly used in mid-/long-term trades. This variable is calculated using Eq. (2). To use it, we use Table 2.
Eq. (2)
Table 2. Assign points to the variable HMA
Event |
Decision |
Score |
The slope of HMA changes from positive to negative |
A strong sell signal |
-1 |
The HMA chart is bearish |
Sell signal |
-0.5 |
The HMA chart is bullish |
Buy signal |
0.5 |
The slope of HMA changes from negative to positive |
Strong buy signal |
1 |
Rate of price change (ROC)
The price rate of change is one of the indicators measuring the movement, expressing the percentage difference between the current closing price of a stock and the price of the previous n periods. This indicator indicates the rate of change in the price of a share. A rapid rise or fall in a given stock's price can indicate that it has been overbought or oversold. This variable is calculated using Eq. (3). To use it, we use Table 3.
Eq. (3)
Table 3. Assign points to the variable ROC
Event |
Decision |
Score |
In case the ROC chart is bearish and tends toward less than zero. |
A strong sell signal |
-1 |
In case of a bullish divergence, bullish ROC, and bearish price |
Sell signal |
-0.5 |
In case of a bearish divergence, bearish ROC, and bullish price |
Buy signal |
0.5 |
In case the ROC chart is bullish and tends toward more than zero. |
Strong buy signal |
1 |
Relative Strength Index (RSI)
RSI is one of the indicators measuring movement. It compares the magnitude of recent stock gains with recent stock losses to find overbought and oversold conditions. It also produces early signals, though they must be used with other indicators (Murphy, 1999). This variable is calculated using Eq. (4). To use it, we use Table 4.
Eq. (4).
Table 4. Assign points to the variable RSI
Event |
Decision |
Score |
In case the bearish RSI chart tends to be less than 70 |
A strong sell signal |
-1 |
In case the RSI chart becomes bearish in upper and lower domains (bounds) |
Sell signal |
-0.5 |
In case the RSI chart becomes bullish in upper and lower domains (bounds) |
Buy signal |
0.5 |
In case the bullish RSI chart tends to be less than 30 |
Strong buy signal |
1 |
Moving average convergence divergence (MACD)
Moving average convergence divergence (MACD) is also a trend-following indicator. As one of the reliable indicators of the market, it is equal to the difference between long-/short-term averages. This variable is calculated using Eq. (5). To use it, we use Table 5.
Eq. (5)
Table 5. Assign points to the variable MACD
Event |
Decision |
Score |
In case the bearish chart tends to be less than zero |
A strong sell signal |
-1 |
In case the negative part of the chart is bearish |
Sell signal |
-0.5 |
In case the positive part of the chart is bullish |
Buy signal |
0.5 |
In case the bullish chart tends to be more than zero |
Strong buy signal |
1 |
True strength index (TSI)
True strength index is also an indicator measuring the movement that simultaneously determines the trend and overbought and oversold conditions. This variable is calculated using Eq. (6). To use it, we use Table 6.
Eq. (6)
Table 6. Assign points to the variable TSI
Event |
Decision |
Score |
In case the TSI chart crosses the trigger line in the overbought region and goes lower |
A strong sell signal |
-1 |
In case the TSI chart is bearish between the upper and lower bounds |
Sell signal |
-0.5 |
In case the TSI chart is bullish between the upper and lower bounds |
Buy signal |
0.5 |
In case the TSI chart crosses the trigger line in the oversold region and goes higher |
Strong buy signal |
1 |
Chromosome construction
N |
S |
B |
Wn |
… |
W3 |
W2 |
W1 |
A chromosome was designed as follows:
important factors of technical variables
|
wherein:
Initially, the optimization problem started with an initial solution. For this purpose, hypothetical values were assigned to the important factors of technical variables, restrictions on the sale of shares, restrictions on shareholding, and the optimal number of shares in the portfolio. The required variables for each of the stocks in the portfolio were calculated using Eq. (7).
Eq. (7)
Then, the decision to buy or sell the share was made using the following rules:
If A>B for a given share, in case there is a surplus of money to invest, the amount is allocated to the purchase of that share. Here, N is the optimal default value for the number of shares in the portfolio, and n is the number of shares.
If A
We use GA to optimize the variables on the chromosome. To this aim, we utilized multi-objective GA to minimize risk and maximize returns. Consequently, the necessary rules for optimal portfolio management at different levels of risk and return are obtained. After extracting the optimum coefficients of chromosomes, we evaluate portfolio performance in the test period.
Conclusion
Herein, in response to the main question, "how will multi-objective intelligent algorithms help portfolio formation?" portfolio management guidelines were initially extracted to optimize risk and return using technical and GA analysis in the training period. Afterward, the performance of the results obtained from the model training period was tested. The multiple-objective nature of the utilized algorithm can be regarded as the center of gravity of the research question. The proper functioning or malfunctioning of the resulting portfolio management can be used as a benchmark for selecting or discarding the algorithm. On the other hand, the research question is focused on the application of technical analysis indicators. Therefore, in conclusion, both aspects of the research question, namely the multiple-objective nature of the algorithm in terms of analysis method and technical indicators in terms of features selected for analysis, must be taken into account. Investors looking for less risk should include more stocks in their portfolios. They should wait for the technical indicators to give strong buy signals at the time of purchase, act as soon as possible and not wait for strong sell signals when selling the stock.
On the other hand, investors looking for higher returns should include fewer stocks in their portfolios and buy less strong signals. They also should wait longer when selling and wait for strong sell signals. As shown, investors with varying degrees of risk-taking can use technical analysis in portfolio management to achieve greater returns than market returns.
Ethical considerations
The author has completely considered ethical issues, including informed consent, plagiarism, data fabrication, misconduct, and/or falsification, double publication and/or redundancy, submission, etc.
Data availability
The dataset generated and analyzed during the current study is available from the corresponding author on reasonable request.