You are currently viewing a new version of our website. To view the old version click .
Applied Sciences
  • Article
  • Open Access

23 September 2024

LSTM with Short-Term Bias Compensation to Determine Trading Strategy under Black Swan Events of Taiwan ETF50 Stock

,
,
and
1
Department of Computer Science and Information Engineering, National Taiwan University, Taipei 106319, Taiwan
2
Department of Computer Science and Information Engineering, Ming Chuan University, Taoyuan 333321, Taiwan
*
Author to whom correspondence should be addressed.
This article belongs to the Section Computing and Artificial Intelligence

Abstract

This paper uses Long Short-Term Memory (LSTM) networks to predict the stock prices of the Yuanta Taiwan Top 50 ETF (ETF50). To improve the accuracy of the model’s predictions, a calibration procedure called “Short-Term Bias Compensation” (STBC) is proposed to adjust the predicted stock prices. In STBC, the daily prediction error is calculated to estimate the short-term bias (STB) in prediction. Then, the predicted price of its next day will be corrected if this STB has exceeded a certain threshold. In this paper, we apply Genetic Algorithms (GAs) to optimize the parameters used in STBC for providing more confidence in its estimation. Based on these predicted stock prices, we propose a Genetic Fuzzy System (GFS) to determine the trading strategy, with trading points for buying and selling stocks. In GFS, various technical indicators are used to establish the fuzzy rules of the trading strategy, and GAs are used to evolve the best parameters for these fuzzy rules. Our experiments cover over 17 years of data (from 2003 to 2020) for ETF50 to consider black swan events such as the 2020 COVID-19 pandemic, the 2018 US–China trade war, and the 2011 US debt crisis. The first 90% of the data is used as training data, and the last 10% is used as testing data. We use 12 technical indicators of these data as the input of LSTM. The predicted values of LSTM are corrected using STBC and compared to the uncorrected prices. We use Mean Square Error (MSE) to evaluate the prediction accuracy. The results show that STBC can nearly reduce 90% of the prediction error (where MSE drops from 11.5758 to 1.2687). By using GFS with STBC to determine trading points, we achieve a return rate of 32.0%.

1. Introduction

This paper uses the “Yuanta/P-shares Taiwan Top 50 ETF (Exchange Traded Fund)” (ETF50) [1] as the research target. It tracks Taiwan’s top 50 stock index and holds the same constituent stocks as the top 50 index in Taiwan. This paper primarily focuses on the technical analysis of stocks, using the performance of technical indicators to understand the current state of the stock market. To achieve higher returns, investors aim to buy stocks at low prices and sell them at high prices. In past years, different studies were proposed to determine the trading points for buying and selling, serving as a stock trading strategy [2]. However, during certain black swan [3] events or periods of extreme market volatility, traditional rules that simply apply stock technical indicators [4] may not yield satisfactory trading results. For example, the 2020 COVID-19 pandemic [5], the 2018 US–China trade war, and the 2011 US debt crisis have greatly impacted financial markets, making it challenging for investors to achieve good returns.
The ETF50 considers 50 listed companies in Taiwan, among which TSMC (Taiwan Semiconductor Manufacturing Company) holds the most important position and determines much of the stock market trend. TSMC plays a pivotal role not only in Taiwan’s economy but also in the global semiconductor industry. As the largest contract chip manufacturer in the world, TSMC competes with other major players such as Intel, Nvidia, Samsung, and Philips. In terms of technological advancements and production capacity, TSMC has consistently maintained a leadership position, particularly in advanced node technology, such as 5 nm and 3 nm processes, which are critical for manufacturing next-generation chips used in smartphones, AI, and autonomous vehicles.
The COVID-19 pandemic significantly disrupted the global semiconductor supply chain. Lockdowns, workforce shortages, and surging demand for consumer electronics, such as laptops and smartphones, caused a global chip shortage that impacted industries from the automotive industry to telecommunications. TSMC, with its advanced manufacturing capabilities, was pivotal in addressing the shortage, but the gap between supply and demand persists. This situation highlighted the dependence of global industries on a few key manufacturers, like TSMC and Samsung, which continue to face pressure to ramp up production amidst geopolitical tensions and increasing global demand.
Traditional stock prediction models, including time-series analysis and statistical methods, largely rely on historical data and the assumption that future market movements will remain within predictable bounds. However, black swan events defy these assumptions, making such models ineffective in extreme scenarios. The inability of these models to account for rare and unexpected events often results in flawed predictions, especially during periods of heightened market volatility. Consequently, there is a growing need to explore deep learning techniques, which can adapt to a wider range of data and learn more complex, nonlinear patterns, to better handle the unpredictability of black swan events.
This paper uses a calibration procedure called “Short-Term Bias Compensation” (STBC) to adjust the model’s stock price predictions, aiming to reduce the impact of sudden external factors on the model’s prediction accuracy. We use fuzzy rules [6] evolved by genetic algorithms (GAs) to determine the stock trading strategy. The basic processing steps of this paper are as follows.
  • Predict Stock Prices: This paper employs a deep learning Long Short-Term Memory (LSTM) model [7] to predict stock prices. LSTM is particularly useful for handling time-series data, making it a powerful tool for financial market prediction [8]. By training on historical stock data through multiple neurons and multiple layers of the network, it learns the stock price trends to predict future stock prices.
  • Calibrate Prediction: Due to the LSTM prediction error, this paper uses STBC to adjust the predicted stock prices by avoiding inaccuracies caused by stock price volatility. It thereby achieves the goal of reducing model prediction errors.
  • Determine Trading Points: This paper uses GAs to evolve the optimal parameters of the membership functions of fuzzy rules to form a fuzzy system, which determines the buying and selling points.
  • Optimize Trading Strategy: The predicted lowest and highest prices are used as the buying and selling prices for executing trades.
In financial markets, stock price prediction is not only critical for investors’ trading decisions but also helps assess the financial health of companies, thereby predicting bankruptcy risk. The Z-Score model [9], widely used for bankruptcy prediction, is based on financial ratios that assess a company’s risk of insolvency. These ratios include operating capital, reinvested income, earnings before interest and taxes, market value of equity, and sales revenue, all of which reflect a company’s stability and debt-paying ability. Therefore, stock price fluctuations are not only tied to market sentiment and supply–demand dynamics but also have a close relationship with the underlying financial risks of a company.
This study aims to predict stock prices of the Taiwan Stock Exchange ETF50 using LSTM networks with STBC calibration. By training on historical stock data, we can learn market trends and further estimate a company’s financial status and bankruptcy risk. Such a stock prediction model provides investors with a deeper risk management perspective, particularly in volatile markets, enhancing decision-making accuracy.
This paper is divided into five sections. Section 1 addresses the research motivation of the paper. Section 2 introduces the relevant literature on LSTM, fuzzy systems, GAs, and stock trading strategies. Section 3 explains the experimental process and framework to determine the trading points and the trading strategy. Section 4 presents the experimental results and analysis, identifying the optimal trading strategy. Finally, Section 5 summarizes the research findings and discusses any shortcomings and possible directions for future improvements and extensions.

3. Research Methods

3.1. System Framework

This study first calculates individual technical indicators for the data and removes any null values generated during the initial calculations. Subsequently, the data weights are adjusted according to TSMC’s proportion (i.e., 18.78%) in the ETF50’s constituent stocks. The model is then trained and its parameters fine-tuned. To enhance the accuracy of the model’s predictions, we adjust the predicted values to align with current market trends. Finally, we combine GAs and fuzzy systems to determine the optimal parameters for the fuzzy membership functions, which will be used as trading strategies. Figure 2 illustrates the system framework of this study and it follows Figure 1.
Figure 2. System framework.

3.2. Data Preprocessing

Using daily stock prices, trading volumes, and nine technical indicators, a total of 14 variables were used to calculate daily technical indicators and input them into an NN for training. The model aims to predict the daily highest price, lowest price, and closing price, resulting in three separate models. Table 1 lists the input variables of the technical indicator [4] for the model predicting the highest price.
Table 1. Variables of the technical indicator inputs.
Min–max scaling is a common normalization technique that scales the numerical feature data to fall within the range [0, 1]. This method helps to constrain the values within a specified range and accelerates the training speed of the model. The formula for normalization is as follows:
x n o r m = x x m i n x m a x x m i n   [ 0,1 ]
where:
-
x is the original value.
-
x m i n is the minimum value in the dataset.
-
x m a x is the maximum value in the dataset.
-
x n o r m is the normalized value.
This approach ensures that the model accounts for the influence of the largest component stock, thereby improving the accuracy and stability of the predictions. This formula ensures that the scaled values lie within the [0, 1] interval. By applying min–max scaling, the features contribute equally to the model training process, thus improving the performance and convergence rate of the model.
According to the experimental findings of [19], incorporating only the largest component stock can enhance the stability of the model. Given that TSMC holds the highest percentage among the component stocks in ETF50, this study considers only TSMC stock as training data. Initially, the ETF50 weights are set to 100%. Then, based on the proportion of TSMC within the ETF50 component stocks, the adjusted stock weights are calculated. Finally, the normalized data are multiplied by the adjusted weights.
W T = W i
W W i W T = W i W T × 100 %
where
-
Wi is stock weighting ratios.
-
WT is total stock weight.
-
W W i W T is adjusted stock weighting (percentage)
When training an LSTM model, the data need to be segmented into a fixed-length via the sliding window concept. This means dividing the data into sequences of equal length, with a set sequence length of 20 days. Data from day 1 to day 20 serve as the input data to predict the stock price on day 21 as the model’s prediction target. As illustrated in Figure 3, the data within the dark box represent the input data, while the red text indicates the prediction target for this iteration. Finally, the segmented data are divided into training and testing datasets, with 90% used as the training dataset and 10% as the testing dataset. Additionally, 10% of the training dataset is set aside as the validation dataset.
Figure 3. Data splitting diagram.

3.3. Model Training

Figure 4 illustrates the architecture of LSTM used in this study, implemented using Keras [29]. The model consists of two LSTM layers to capture temporal dependencies in the data, one dropout layer to prevent overfitting by randomly setting a fraction of input units to 0 at each update during training, and two dense layers in fully connected layers to output the final prediction results.
Figure 4. LSTM architecture diagram [19].
The model’s performance is evaluated using Mean Squared Error (MSE) as the loss function. After each training iteration (i.e., n = 3849), the MSE is calculated and fed back to the NN to adjust the weights of each layer. A smaller MSE indicates higher prediction accuracy, while a larger MSE indicates lower accuracy. The formula for MSE is:
M S E = i = 1 n y ŷ 2 / n
where:
-
n is the sample size.
-
y is the actual value.
-
ŷ is the predicted value.
The model’s predicted stock prices may have small discrepancies from the actual daily stock prices, which can affect the trading points of subsequent trades and the highest and lowest prices during trading. To address this, a correction method [19] is used to adjust the predicted values. While this method reduces prediction error, it only corrects the next day’s predictions and cannot improve future stock price trends.
This study proposes STBC that uses the short-term prediction error of the current day’s stock price to determine if the predicted value needs adjustment and then corrects future stock prices accordingly. Algorithm 1 presents the calibration procedure for calculating the error and determining whether to apply the correction.
Where:
-
Rt is today’s stock price.
-
Pt models today’s predicted stock price.
-
δ is the calibration threshold.
-
Clast is the previous calibration value.
-
Ct is today’s calibration value.
Algorithm 1. STBC Deviation Calibration Procedure.
1: P t = P t + C l a s t
2: C t = R t P t
3: If  C t > ( R t × δ )  then
4:   C l a s t = C l a s t + C t
5: end if
To reduce the prediction error of the model and determine the optimal correction threshold δ , this study employs GAs to evolve and find the best value. In GAs, the fitness function is used to calculate the fitness value, which evaluates an individual’s adaptability to the environment. The higher the fitness value, the greater the individual’s survival probability. In this study, the fitness value is calculated using the MSE obtained after applying STBC.
Table 2 outlines the parameters and initial values for the GAs. The initial value for the correction threshold is set to 0.05, and the evolution is set to stop after 15 iterations. Given the relatively low complexity of the problem, the Steady State Selection [30] method is used to select individuals for reproduction, which is computationally efficient. After selection, single-point crossover is performed to evolve the next generation, with a mutation rate of 1% during the crossover process. By the end of the GA process, the optimal correction threshold δ is identified, which minimizes the prediction error and improves the model’s accuracy.
Table 2. GA parameters.

3.4. Trading Strategy

To align with the trading rules and simulated trading conditions in the Taiwan stock market, we define the following buy–sell rules for the simulated trading system.
  • Buying is executed on a per-share basis, and selling is also conducted on a per-share basis.
  • The transaction fee for each buying or selling action is 1.425‰ of the transaction price.
  • A securities transaction tax of 1‰ of the transaction price is levied for each selling action.
  • This study does not involve margin trading and short selling and does not consider short covering.
  • Selling of stocks is only allowed if the stock is held.
  • Simulated trading is conducted in a one-buy-one-sell manner, representing a complete trading cycle. If the last transaction is a buying action, the cost of that purchase is deducted.
  • At the end of simulated trading, if the investor still holds stocks, the closing price of the day is used to calculate the final return rate.
  • The buying price for each transaction is the model-predicted and corrected highest price of the day, while the selling price is the model-predicted and corrected lowest price of the day.
  • A trade is considered unsuccessful if the actual lowest price of the day is not larger than the buying price or the actual highest price of the day is not less than the selling price. If a trade fails on a given day, it is postponed to the next day.
  • If two consecutive days of trading fail, the trading activities are halted.
  • This study employs 1,000,000 as the total experimental capital for stock trading.
In this study, the investment return rate is used as the evaluation metric for trading strategies and buy–sell strategies. The calculation method for the investment return rate involves subtracting the total cost of purchases from the total revenue from sales, dividing by the total cost of purchases, and finally expressing the result as a percentage. The formula for the return rate is as follows:
I n v e s t m e n t   R e t u r n   R a t e % = T o t a l   R e v e n u e n   f r o m   S a l e s T o t a l   C o s t   o f   P u r c h a s e s T o t a l   C o s t   o f   P u r c h a s e s × 100
This formula provides a percentage measure of the profit or loss generated from the trading activities relative to the initial investment.

3.5. Genetic Fuzzy System (GFS)

This study uses the K, D, and RSI technical indicators to establish membership functions for Buy (BUY), Sell (SELL), and Hold (HOLD) actions. To identify the optimal parameters for these membership functions, a genetic-evolution-based fuzzy algorithm is employed. This approach aims to enhance the buy–sell strategy by optimizing the parameters of the membership functions through genetic evolution. The pygad package [31] is used to implement the GAs in this study.
The application rules for the K, D, and RSI technical indicators are established to generate BUY, SELL, and HOLD signals based on specific thresholds. These rules help determine the appropriate trading actions according to the current values of the indicators. The rules are as follows:
K—Indicator Application Rules:
-
BUY Signal: If K value ≤ KBH, then it is a BUY signal.
-
SELL Signal: If K value ≥ KSL, then it is a SELL signal.
-
HOLD Signal: If KHL < K value < KHH, then it is a HOLD signal.
D—Indicator Application Rules:
-
BUY Signal: If D value ≤ DBH, then it is a BUY signal.
-
SELL Signal: If D value ≥ DSH, then it is a SELL signal.
-
HOLD Signal: If DHL < D value < DHH, then it is a HOLD signal.
RSI—Indicator Application Rules:
-
BUY Signal: If RSI value ≤ RBH, then it is a BUY signal.
-
SELL Signal: If RSI value ≥ RSH, then it is a SELL signal.
-
HOLD Signal: If RHL < RSI value < RHH, then it is a HOLD signal.
The rules for each indicator are summarized [32] in Table 3:
Table 3. Rules for technical indicators and signals with action (A.S).
Since HOLD indicates no action, we can logically optimize the rules in Table 3 as follows:
  • If both K and D indicators signal BUY, then ACTION is A.BUY.
  • If both K and D indicators signal SELL, then ACTION is A.SELL.
  • If both K and RSI indicators signal BUY, then ACTION is A.BUY.
  • If both K and RSI indicators signal SELL, then ACTION is A.SELL.
Using the aforementioned technical indicator application rules, we can establish the membership functions as shown in Table 4. This table contains a total of 16 membership function parameters and the corresponding output membership functions.
Table 4. Setting of membership function parameters for technical indicators and outputs.
When the K value is less than or equal to KBH, the ACTION is set to BUY. When the K value is between KHL and KHH, it is determined as HOLD. When the K value is greater than or equal to KSL, the ACTION is set to SELL. This same method of determination is applied to the other indicators, as shown in Figure 5.
Figure 5. Membership functions of K values.
The initial values of the membership functions can be defined based on experience or generated randomly. As shown in Table 5, the K value ranges between 0 and 100. A K value above 80 indicates that the market is overheated and may reverse downwards, which is a signal to sell the stock. A K value below 20 indicates that the market is too cold and may reverse upwards, which is a signal to buy the stock. A K value between 20 and 80 indicates no action. Table 5 shows the initial values of the membership function parameters for the K, D, and RSI indicators.
Table 5. Initial values of membership functions for technical indicators.
As shown in Table 6, G1 to G4 are the parameters for the K indicator membership function, G5 to G8 are the parameters for the D indicator membership function, and G9 to G12 are the parameters for the RSI indicator membership function.
Table 6. GA input variables.
The new parameters evolved are input into the membership functions to establish a fuzzy system. The fuzzy system is then used to determine the trading points for buying and selling, and the returns are calculated as the fitness function. This evaluates whether the newly evolved parameters are optimal.
Table 7 shows the training parameters and methods for the genetic fuzzy system. The training evolves for a total of 50 generations, using the Steady State Selection method to select individuals for reproduction. After selection, single-point crossover is used to evolve the next generation, with a mutation rate set at 1%.
Table 7. Training parameters of the genetic fuzzy system.

4. Experimental Results

4.1. Model Prediction

The data for this study were sourced from the Taiwan Stock Exchange, focusing on ETF50 and its largest constituent stock, TSMC. The dataset spans from 30 June 2003 to 31 December 2020. Out of the total data, 90% was used for training and 10% for testing. After excluding null values from the calculation of technical indicators, the final dataset comprised 4297 records. The training data period is from 18 August 2003 to 8 April 2019, while the testing data period is from 9 April 2019 to 31 December 2020.
The MSE of the predicted stock price by the original model is 11.5758, which decreases to 1.2687 after STBC. It successfully reduces the error by nearly 90%, effectively improving future stock price predictions. Figure 6 shows the daily closing prices of the predicted stock prices, while Figure 7 shows the daily closing prices after correction. In the figures, the grey dots represent the actual stock prices of the day and the black dots represent the predicted stock prices. It can be observed that there is a significant deviation between the actual and predicted stock prices during the period marked by the red box, which is from March 2020 to April 2020.
Figure 6. Daily closing prices of model predicted stock prices.
Figure 7. Daily closing prices of corrected model predicted stock prices.
Figure 6 and Figure 7 show that starting from March 2020 (the area marked by the red box), the stock prices show a continuous downward trend. During this time, the model’s predicted stock prices start to deviate from the actual stock prices. Without correction, the future stock price errors could increase, affecting the decision-making process for buying and selling. Through STBC, we can correct the stock prices in a timely manner. For example, on 9 December 2020, the predicted value was 109.53, while the actual stock price of the day was 120.05. There was a deviation between the predicted and actual values. After correction, the adjusted value was 120.39, correcting the error by 10.85, making the prediction more accurate.
To determine the correction threshold in STBC, we used GAs to compute the optimal correction threshold. Table 8 compares the MSE values of STBC with and without the GAs. It can be observed that after obtaining the optimal correction threshold through the GAs, the MSE of the highest price, closing price, and lowest price all decrease. There are three models in the experiment, predicting the highest price, lowest price, and closing price, respectively. To verify whether the predicted stock prices of the three models match the actual stock prices, they are checked after correction. Here, we observe if the lowest price of the day is higher than the highest price. The result shows this situation only occurred on the first day.
Table 8. Comparison of the MSE values of STBC with and without the GAs.

4.2. Genetic Fuzzy System

After correcting the model predictions, the technical indicator application rules are used to establish a fuzzy system to determine the trading points. To find the optimal membership function values, GAs are used to derive the best parameter values. The parameters of the technical indicator membership functions are input into the GAs for training. Using the parameters derived from the GAs, a fuzzy system is established. By calculating the technical indicators of the stock prices through the fuzzy system, the trading points for buying and selling are determined. Simulated trading is conducted, and the return rate is calculated as the fitness function. After several evolutions, the optimal membership function parameters are obtained.
Table 9 shows that the membership function parameters for the BUY and SELL of the K and D indicators are not significantly different from the initial values. However, there is some difference in the K indicator HOLD membership function parameter KHL, with the initial value being 20, adjusted to 9 after the GAs. The D indicator follows a similar pattern, with the initial DHL parameter value being 20, adjusted to 8 after evolution. The RSI indicator BUY membership function parameter RBH shows a larger difference compared to the initial value of 30. Overall, the 16 parameters, after being trained by the GAs, indeed play a role in optimizing the parameters.
Table 9. Optimal membership function parameters derived from the genetic algorithm.
The optimized membership functions, as shown in Figure 8, Figure 9 and Figure 10, result from GA fine-tuning the parameters to achieve the best performance for predicting stock market actions. These functions define the fuzzy logic rules used to determine the appropriate trading actions based on the K, D, and RSI indicators. The training graph of the GAs, showing the relationship between each evolution and the fitness value, indicates that after two evolutions, the fitness value stabilizes around 0.28, with a slight increase.
Figure 8. Optimal membership function of K indicator.
Figure 9. Optimal membership function of D indicator.
Figure 10. Optimal membership function of RSI indicator.

4.3. Comparison of Trading Strategies

Trading strategies determine the appropriate trading points for buying and selling. This study compares three trading strategies: “One-time Conversion” [18], “Fuzzy System (using initial values)”, and “Genetic Fuzzy System”, as shown in Table 10. It can be observed that using the Genetic Fuzzy System achieves a return rate of 32.0%, while the return rates of the other two trading strategies are both less than 5.0%.
O n e - t i m e   C o n v e r s i o n   C o s t = P t + 1 R t R t
where:
-
P t + 1 : Predicted closing price for the next day.
-
R t : Actual closing price of today.
Table 10. Comparison of returns for different trading strategies.
Table 10. Comparison of returns for different trading strategies.
Trading StrategyReturn on Investment (%)
One-time Conversion4.70
Fuzzy System (using initial values)4.72
Genetic Fuzzy System32.00

4.3.1. Analysis after Price Correction

The test set data start predicting stock prices from 9 April 2019. In the first half of 2020, the COVID-19 event affected the financial market, causing the model’s predicted stock price errors to increase. After correction, as shown by the black dots in Figure 11, the red dots indicate the times when stocks were bought, and the green dots indicate the times when stocks were sold. The period marked by the yellow box is when COVID-19 had the most severe impact on Taiwan.
Figure 11. Impact of COVID-19 on ETF50 stock prices.
It can be observed that despite COVID-19 significantly affecting stock prices, the Genetic Fuzzy System found the optimal buying and selling points. Although there was only one round of trading, the selling point was at an upward trend, which is the desired high point for selling, thus the return rate is relatively high.

4.3.2. Comparison of Returns across the COVID-19 Event

A detailed examination of return performance across different time periods compares the “Buy and Hold” strategy with the GA strategy over a six-month period across the COVID-19 event. The Best Buy and Hold return rate is calculated by buying the stock at the lowest price on the first day and selling it at the highest price on the last day. The Buy and Hold strategy involves buying on the first day and selling on the last day without any transactions in between. Table 11 shows the return rates across the COVID-19 event. In these periods, the Buy and Hold return rates are negative but the Genetic Fuzzy System still yields profits. This indicates that even in challenging market conditions, the Genetic Fuzzy System can achieve stable profits.
Table 11. Comparison of returns across the COVID-19 event.

5. Conclusions and Future Work

Although stock market trends change rapidly and can cause significant price fluctuations due to various reasons, the STBC proposed in this study can promptly adjust future stock price trends and reduce prediction errors, achieving more accurate stock price predictions. Furthermore, by using fuzzy membership functions optimized through GAs, this study has derived the best parameters for technical indicators, established a fuzzy system, and combined it with technical indicator application rules to infer the best trading points. This approach has been tested through simulated trading, resulting in a positive return rate.
We will further discuss improvements to the correction method and the fuzzy system, outlining two main areas for future enhancement:
Firstly, we can increase the number of technical indicator membership functions and application rules to more accurately determine the best buying and selling points, achieving better results. By introducing more technical indicators, the model’s adaptability to different market conditions can be improved.
Secondly, although STBC can reduce daily prediction errors, frequent corrections might be caused by a few days of significant anomalies, leading to substantial fluctuations in future corrected stock prices. To address this issue, we should limit the correction values to within a reasonable range by using data and errors from previous days to infer the appropriate correction value for future predictions, thus reducing the frequency of corrections. This approach can enhance the model’s stability and accuracy, thereby increasing the return rate.
Finally, while the genetic fuzzy system achieves returns during significant market upswings, its conservative trading strategy limits high profitability. Therefore, we can consider incorporating additional indicators, such as Bollinger Bands, to further optimize entry points and enhance the flexibility and profitability of the trading strategy. These improvements will make the model more stable and effective under various market conditions. The proposed method can also be implicated for other stock markets or financial instruments. It can also contribute to the existing body of knowledge in financial forecasting and machine learning.

Author Contributions

Conceptualization, R.-I.C.; methodology, R.-I.C. and C.-H.W.; software, L.-C.W. and Y.-F.L.; validation, C.-H.W., L.-C.W. and Y.-F.L.; Formal analysis, R.-I.C.; investigation, C.-H.W., L.-C.W. and Y.-F.L.; resources, C.-H.W. and L.-C.W.; data curation, R.-I.C., L.-C.W. and Y.-F.L.; writing—original draft, C.-H.W. and Y.-F.L.; writing—review & editing, R.-I.C. and C.-H.W.; visualization, C.-H.W. and Y.-F.L.; supervision, R.-I.C.; project administration, R.-I.C., C.-H.W. and L.-C.W.; funding acquisition, C.-H.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research and APC were funded by NSTC Taiwan, grant number NSTC 112-2221-E-130-001.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The original contributions presented in the study are included in the article. Further inquiries can be directed to the corresponding authors.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. ETF Overview, Taiwan Stock Exchange Corporation. Available online: https://www.twse.com.tw/en/products/securities/etf/overview/introduction.html (accessed on 16 September 2023).
  2. Allen, F.; Karjalainen, R. Using genetic algorithms to find technical trading rules. J. Financ. Econ. 1999, 51, 245–271. [Google Scholar] [CrossRef]
  3. Taleb, N.N. Black swans and the domains of statistics. Am. Stat. 2007, 61, 198–200. [Google Scholar] [CrossRef]
  4. Lane, G. The Stochastic Indicator. Technical Analysis of Stocks & Commodities Magazine, 1984; p. 6. [Google Scholar]
  5. Lee, K.-J.; Lu, S.-L. The Impact of COVID-19 on the Stock Price of Socially Responsible Enterprises: An Empirical Study in Taiwan Stock Market. Int. J. Environ. Res. Public Heal. 2021, 18, 1398. [Google Scholar] [CrossRef] [PubMed]
  6. Zadeh, L.A. Fuzzy Sets. Inf. Control. 1965, 8, 338–353. [Google Scholar] [CrossRef]
  7. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed]
  8. Fischer, T.; Krauss, C. Deep learning with long short-term memory networks for financial market predictions. Eur. J. Oper. Res. 2018, 270, 654–669. [Google Scholar] [CrossRef]
  9. Altman, E.I. Financial ratios, discriminant analysis and the prediction of corporate bankruptcy. J. Financ. 1968, 23, 589–609. [Google Scholar] [CrossRef]
  10. Elman, J.L. Finding structure in time. Cogn. Sci. 1990, 14, 179–211. [Google Scholar] [CrossRef]
  11. Jang, J.-S. Self-learning fuzzy controllers based on temporal backpropagation. IEEE Trans. Neural Netw. 1992, 3, 714–723. [Google Scholar] [CrossRef] [PubMed]
  12. Wang, L.-X.; Mendel, J. Generating fuzzy rules by learning from examples. IEEE Trans. Syst. Man Cybern. 1992, 22, 1414–1427. [Google Scholar] [CrossRef]
  13. Beasley, D.; Martin, R.R.; Bull, D.R. An overview of genetic algorithms: Part 1. Fundamentals. Univ. Comput. 1993, 15, 56–69. [Google Scholar]
  14. Holland, J.H. Adaptation in Natural and Artificial Systems, 1st ed.; University of Michigan Press: Ann Arbor, MI, USA, 1975. [Google Scholar]
  15. Chang, K.-T. A Collaborative Trading Model by Support Vector Regression and Fuzzy Rule for Stock Turning Points’ Prediction. Master’s Thesis, Department of Information Management, Yuan Ze University, Taoyuan City, Taiwan, 2011. [Google Scholar]
  16. Ho, K.-H. The Trading Performance of Technical Analysis: The Case of Taiwan 50 ETF. Master Thesis, Department of International Business, National Taiwan University, Taipei, Taiwan, 2016. Available online: https://www.airitilibrary.com/Article/Detail/U0001-1706201617425300 (accessed on 17 January 2023).
  17. Wu, Y.-C. Stock Trading Using CNN-LSTM Neural Network Model. Master’s Thesis, Institute of Computational and Modeling Science, National Tsing Hua University, Hsinchu, Taiwan, 2021. [Google Scholar]
  18. Huang, H.-S.; Chiu, I.-H. The Study of Neural Network to Predict Taiwan ETF-50 Stock Index Price. J. Inf. Technol. Soc. 2005. Available online: https://jitas.cpu.edu.tw/2005-2/2.pdf (accessed on 26 January 2023).
  19. Shen, P.-H. Forecasting ETF50 Trend with LSTM and Two-time Trading Strategy. Master’s Thesis, Department of Engineering Science and Ocean Engineering, National Taiwan University, Taipei, Taiwan, 2020. [Google Scholar]
  20. Chang, B.-N. Discussion on Applying Genetic Algorithm to Financial Index Stock Selection Strategy. Master’s Thesis, Department of Information Management, National Central University, Taoyuan City, Taiwan, 2001. [Google Scholar]
  21. Sharpe, W.F. A Theory of Market Equilibrium under Conditions of Risk. J. Financ. 1964, 19, 425–442. [Google Scholar]
  22. Cao, L.; Luo, C.; Ni, J.; Luo, D.; Zhang, C. Stock Data Mining through Fuzzy Genetic Algorithm. In Proceedings of the 2006 Joint Conference on Information Science (JCIS 2006), Kaohsiung, Taiwan, 8–11 October 2006. [Google Scholar]
  23. Altman, E.I. Corporate Financial Distress & Bankruptcy. John Wiley Google Sch. 1993, 2, 57–64. [Google Scholar]
  24. Hillson, D. (Ed.) The Risk Management Handbook: A Practical Guide to Managing the Multiple Dimensions of Risk; Kogan Page Publishers: London, UK, 2023. [Google Scholar]
  25. Aggarwal, C.C. Neural Networks and Deep Learning; Springer: Cham, Switzerland, 2018. [Google Scholar]
  26. Russell, S.J.; Norvig, P. Artificial Intelligence: A Modern Approach; Pearson: London, UK, 2016. [Google Scholar]
  27. Holland, J.H. Hidden Order; Business Week-Domestic Edition; McGraw-Hill: New York, NY, USA, 1995; Volume 21. [Google Scholar]
  28. Gen, M.; Cheng, R. Genetic Algorithms and Engineering Optimization; John Wiley & Sons: Hoboken, NJ, USA, 1999; Volume 7. [Google Scholar]
  29. Keras. Available online: https://keras.io/ (accessed on 3 September 2023).
  30. Goldberg, D.E. Genetic Algorithms in Search, Optimization, and Machine Learning; Addison-Wesley: Boston, MA, USA, 1989. [Google Scholar]
  31. PyGAD. Available online: https://pygad.readthedocs.io/en/latest/ (accessed on 3 June 2023).
  32. Yeh, W.-H. An Empirical Study on the Application of Fuzzy Decision System in Taiwan Stock Market. Master’s Thesis, College of Electrical Engineering and Computer Science, National Ilan University, Yilan, Taiwan, 2022. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.