1. Introduction
Technical analysis is one of the most widely used strategies in financial markets, as it is based on the study of historical price patterns of assets with the aim of anticipating their future behavior. This approach relies on the generation of signals that guide decision-making regarding the appropriate timing to buy or sell an asset [
1]. In the financial domain, proper data analysis is essential to avoid erroneous decisions that may result in significant losses for both individuals and organizations. In this sense, rigorous information processing contributes to risk mitigation and supports decision-making that increases the likelihood of achieving the profitability objectives set by investors [
2,
3].
However, according to classical financial theory and the postulates of the Efficient Market Hypothesis (EMH), under conditions of a perfect market, it is not feasible to obtain returns above the market average. This is because the price of a stock immediately incorporates all available information, implying that prices reflect their fair value. Under this assumption, no investment strategy would systematically outperform average market returns [
4,
5]. Nevertheless, in practice, technical indicators are widely employed by analysts and investors to identify investment opportunities and anticipate price behavior in financial markets [
6].
These indicators are applied to various types of financial assets, such as stocks, commodities, debt instruments, currencies, and derivatives, and are constructed based on predefined parameters [
7]. This occurs even when there are substantial differences between the assets analyzed and the market contexts in which they are traded [
8].
Among the most widely used indicators by traders, due to their reliability and ease of interpretation, is the Relative Strength Index (RSI). This indicator is employed to evaluate the balance between buying and selling pressure in the market, making it possible to determine whether the price of a financial asset justifies a buy or sell strategy [
9,
10]. The RSI is classified as an oscillator, since its graphical representation corresponds to a line that fluctuates over time within a predefined range between 0 and 100. The standardized reference values are 30 and 70, which denote oversold and overbought zones, respectively. In essence, the RSI is a momentum indicator, as it measures the magnitude of recent price variations of an asset in order to anticipate possible changes in its trend [
10].
The RSI is calculated using the following mathematical formulation:
where
RS corresponds to the absolute value of the ratio between the average of positive price variations and the average of negative price variations, calculated over the considered time period. By convention, this period is set to the 14 most recent historical price data points [
11].
On the other hand, artificial intelligence (AI) techniques have been extensively explored in recent years across diverse fields of knowledge, including financial investment. The growing interest in their application to this domain stems from the fact that financial markets are nonlinear and complex systems, characterized by dynamic interactions that are difficult to model and understand. These characteristics have motivated the use of tools such as genetic algorithms (GA) and artificial neural networks (ANN), aimed at predicting asset price behavior, returns, volatility, and uncertainty [
12,
13]. The main advantage of AI-based predictive approaches lies in their ability to produce estimates or classifications while reducing modeling errors, thereby achieving superior results compared to those obtained through traditional mathematical, statistical, or econometric methodologies [
14,
15].
Within this line of research, a particularly relevant aspect is the construction of predictive models oriented toward decision-making. Such models constitute valuable tools for anticipating price movements of financial assets in stock markets—an endeavor widely recognized by researchers as highly complex in real-world financial applications.
The purpose of this study is to assess whether the application of artificial intelligence techniques to investment decisions in the stock market, through a technical analysis strategy based on the RSI indicator, can generate returns superior to those derived from traditional technical analysis. To this end, we propose the implementation of genetic algorithms to automatically optimize RSI parameters, such as buy/sell signal thresholds and the number of historical observations used in its construction. The parameters obtained from this optimization process subsequently serve as the input for an artificial neural network, which is employed to predict market behavior in a period subsequent to that used in the GA development [
16,
17].
The results of this approach are intended to highlight the advantages of the combined application of evolutionary algorithms and neural networks in the automatic optimization and prediction of investment strategies based on technical analysis, within the context of the stock market [
18].
2. Literature Review
Artificial intelligence (AI) can be defined as the capability of computational systems to emulate human cognitive processes, particularly in problem-solving and decision-making. AI systems interact with their environment—whether real or virtual—through the collection, organization, and analysis of information, in order to generate conclusions and select the most appropriate decisions to achieve defined objectives [
19].
From an operational perspective, AI systems integrate algorithms composed of rules or instructions that determine how input data should be processed and how actions should be taken accordingly. These systems also possess the ability to adjust their parameters based on patterns identified through machine learning processes, which provides flexibility and adaptive capacity to the models [
20].
The initial advances in AI led to the consolidation of multiple techniques applied across diverse knowledge domains. Among the most prominent are natural language processing, facial recognition, classification and machine learning algorithms, genetic algorithms, and neural networks. These developments, together with the increasing levels of interconnectivity among products, services, and their environments, have fostered the emergence of an expanding AI ecosystem that currently encompasses a wide spectrum of disciplines and technological domains [
21].
2.1. Genetic Algorithms
Genetic algorithms, initially proposed by [
22], are grounded in Charles Darwin’s theory of natural selection, particularly the principles of survival and reproduction of the fittest individuals. Today, GAs play a central role in solving complex problems characterized by large volumes of stochastic and multidimensional data, scenarios in which traditional optimization techniques often demonstrate limitations [
23]. In essence, GAs constitute adaptive search and optimization methods that enable efficient exploration of the solution space in order to identify alternatives that maximize an objective function [
22,
24].
The operation of GA is based on the creation of an artificial ecosystem composed of a population of encoded chromosomes, each containing a set of genes that represent the characteristic information of an individual. These chromosomes allow the calculation of the fitness of population members with respect to the problem under study. From them, a phenotype is formed, which is evaluated according to its capacity to adapt to the environment or, in computational terms, its suitability for solving the given problem [
25,
26].
In each iteration, the chromosomes with the highest fitness are selected to undergo crossover and random mutation processes, giving rise to new generations. This procedure is repeated continuously until the predefined convergence criteria are met. Such an approach is particularly suitable for large-scale and nonlinear configurations in which conventional methods fail to identify global solutions. Although GAs do not guarantee the discovery of a global optimum, they tend to converge toward solutions close to a local optimum with a high degree of efficiency [
27].
2.2. Artificial Neural Networks
Artificial neural networks are adaptive systems inspired by the functioning of the human brain, designed to process information in a nonlinear and flexible manner. These systems are capable of modifying their internal characteristics in accordance with a specific objective, which makes them particularly suitable for addressing complex problems where nonlinear relationships and fuzzy rules govern the search for optimal solutions [
28].
The range of ANN applications is broad and diverse, encompassing multiple scientific fields and areas of knowledge. In theory, the number of problems that can be solved through ANN is virtually unlimited, which explains their increasing adoption in disciplines such as economics and finance. This versatility has driven not only significant scientific development but also intensive exploration of practical and applied problem-solving [
29]. One of their main advantages lies in the ability to simultaneously model dynamic interactions among multiple factors, thereby capturing the complexity of the phenomena under study. Unlike traditional statistical and econometric methods, which typically rely on average trends, ANN enable analysis at the individual level, offering a more accurate representation of the specific characteristics of events [
28].
ANN are fundamentally composed of nodes, or processing elements, and the connections that interrelate them. Their operation relies on the combination of numerous processing units with properties such as self-adaptation, self-organization, and real-time learning [
30]. Each node receives inputs from other nodes or from the environment, transforms them according to its activation function, and generates an output. The connections between nodes are determined by weights, which reflect the degree to which one node can excite or inhibit another.
A key aspect is that these connections can be modified over time through repeated exposure to data, which constitutes the learning process. This mechanism is central to ANN, as it enables them to function as adaptive processing systems capable of adjusting their internal parameters to improve performance in problem-solving. Consequently, learning in neural networks can be understood as a process by which the system adapts to its environment, not only enhancing predictive capacity but also enabling a deeper understanding of the underlying relationships that characterize such an environment [
28].
In the implementation of ANN, several fundamental concepts must be considered as determinants of their functionality and performance:
2.2.1. Activation Functions
Activation functions are essential in ANN because they introduce nonlinearity into the model, increasing its complexity and learning capacity. They act as control mechanisms that determine whether a neuron should be activated, which is carried out by calculating a weighted sum of inputs, adding a bias term, and applying the corresponding activation function. Among the most widely used modern activation functions is the Rectified Linear Unit (ReLU), which outputs zero for negative input values and returns the input value itself for positive values. This function is efficient, as it helps overcome the vanishing gradient problem and enables faster and more effective learning in neural models.
2.2.2. Adam Optimizer
The Adam optimizer is an advanced variant of stochastic gradient descent that combines the advantages of the momentum method and the RMSprop algorithm. Its main strength lies in its ability to adaptively adjust the learning rate of each model parameter individually. This makes Adam an efficient algorithm in terms of convergence speed and error minimization, and one of the most widely employed optimizers in neural network training.
2.2.3. Mean Squared Error (MSE)
The Mean Squared Error is one of the most commonly used loss functions in regression problems. It is calculated by averaging the squared differences between predicted and actual values. This metric provides a quantitative measure of prediction error and serves as a key indicator for assessing the performance and generalization capability of a neural network model.
2.3. Related Work
Recent literature highlights a wide range of applications of artificial intelligence—particularly genetic algorithms and artificial neural networks—in the financial domain. These techniques have been employed either independently or within hybrid models combining AI with statistical and econometric methods, with the aim of developing solutions to diverse problems, most notably the prediction of asset prices, returns, and volatility [
12].
In recent years, there has been significant growth in research applying ANN to stock market investment, with the objective of optimizing portfolio performance in terms of profitability. For example, Morris and Comeau (2020) conducted a study evaluating whether the use of ANN for return prediction and probability classification could lead to portfolios with superior performance [
31]. Similarly, Manurung et al. (2020) employed ANN for stock selection in portfolio construction, considering criteria related to financial factors and the economic conditions of underlying firms [
32]. More recently, De Oliveira et al. (2023) analyzed the performance of portfolios built with ANN using Student’s asymmetric probability classification, comparing their results against traditional strategies such as the S&P index, the Sharpe ratio, and the Markowitz portfolio model [
33].
A substantial body of knowledge has also been generated regarding the application of genetic algorithms to investment in financial assets. Several studies focused on portfolio construction through GA-based parameter optimization—among them Chang et al. (2000) [
34], Soleimani et al. (2009) [
35], Chang et al. (2009) [
36], and De Greiff & Rivera (2018) [
37]—have demonstrated that this approach can deliver higher returns while reducing risk, compared to traditional investment methods. Beyond parameter adjustment, research such as that of Sinha et al. (2014) [
38] proposed applying GA under a priority index function criterion, grounded in the financial attributes of the underlying firm, to allocate and weight stocks within a portfolio. Similarly, Chen et al. (2019) [
39] employed GA based on the group factor criterion to segregate interchangeable subsets of stocks, thereby facilitating dynamic portfolio rebalancing at later stages.
Regarding the combined application of GA and ANN within technical analysis-based investment strategies, notable contributions include those of Macedo et al. (2016) [
40], Aloud (2020) [
41], Kapoor and Dey (2022) [
42], Xiaohua et al. (2022) [
43], and Li et al. (2024) [
44]. These authors implemented GA to optimize the parameters of technical indicators that generate buy, hold, or sell signals for financial assets—including stocks, futures, and stock indices—with the aim of achieving returns above the market average. In particular, Li et al. (2024) introduced a dynamic trading strategy based on the momentum effect, which allows for iterative optimization of trading parameters. Additionally, studies such as those by Chavarnakul and Enke (2008) [
45], Borovkova and Tsiamas (2019) [
46], Lee et al. (2021) [
47], and Peng et al. (2021) [
48] explored the application of ANN to technical analysis, focusing on predicting short-term price behavior from historical price and trading volume series. These studies employed various hidden-layer configurations and dropout rates applied to technical indicators, demonstrating superior performance compared to conventional technical analysis. However, Peng et al. (2021) reported findings consistent with classical financial theory, which asserts the impossibility of consistently outperforming the market average return, as measured by the Buy and Hold investment strategy.
3. Materials and Methods
This study implemented two artificial intelligence techniques: genetic algorithms and artificial neural networks. The analysis was carried out through the simulation of a stock market trading environment, in which buy and sell transactions of individual financial assets were executed using the technical indicator Relative Strength Index as a reference. Artificial intelligence techniques were applied with the aim of optimizing the fixed parameters of the RSI, such as the number of data points used to construct the indicator, and the lower and upper thresholds from which buy and sell signals are typically generated—values that are conventionally used in a standardized manner by market participants. The parameter optimization was conducted individually, taking into account the historical price behavior of each asset.
The procedure consisted of investing an initial capital based on the first buy signal. For each sell signal, the corresponding transaction was executed, recording profits or losses, and reinvesting the resulting capital in its entirety in the same asset. This process was iteratively repeated throughout the defined time horizon until the final liquidation of the investment. The return was estimated based on the capital invested and the time elapsed between the first purchase and the last sale. Subsequently, it was standardized by converting it into an effective annual rate, in order to facilitate comparison with other financial assets and traditional investment strategies, and to evaluate the efficiency of applying AI techniques to the RSI. The mathematical notation used for estimating the effective annual rate is presented in Equation (2):
where R represents the rate of return generated by the asset during the investment period, and n corresponds to the number of calendar days between the first buy transaction and the last sell transaction of the analyzed asset. Each buy or sell transaction included a commission equivalent to 0.3% of the total traded value, in order to approximate the results to real market operating conditions.
3.1. Data and Selection Criteria
The initial sample of the study consisted of 100 stocks selected from the Yahoo Finance® platform, an open access source that provides historical data on the performance of major financial assets worldwide. The stocks were selected entirely at random. Subsequently, a filtering criterion was applied to exclude stocks that exhibited periods longer than one month without price variation during the interval from 1 January 2018, to 31 December 2019, resulting in a final sample of 94 stocks.
The data used correspond to the daily closing prices of each stock, considering only trading days. Non-trading days, such as weekends and public holidays, were excluded; thus, each financial asset was analyzed as a continuous time series.
3.2. Implementation of Genetic Algorithms
To optimize the parameters of the Relative Strength Index and enhance its predictive capability regarding market movements, a genetic algorithm was implemented. This algorithm was designed to optimally determine the overbought and oversold thresholds, as well as the number of observations used in the RSI calculation.
The initial population consisted of 1000 individuals, which evolved over 100 generations. Each individual was represented by a chromosome composed of integer-valued genes encoding the RSI parameters: (i) the upper threshold, defined within a range between 60 and 90; (ii) the lower threshold, ranging between 10 and 40; and (iii) the number of observations for RSI construction, with values between 12 and 28.
Tree fundamental Genetic Operators were implemented in the optimization process: selection, crossover, and mutation.
3.2.1. Selection
Parent selection was carried out using the selTournament operator, which determines the individuals contributing genetic material to the next generation. This procedure generates a random subset of the population (tournament) and selects the best-performing individual within the group as a parent candidate. The process is repeated until the required pairs for crossover are formed.
The selTournament operator prioritizes the reproduction of the fittest individuals, consistent with the principle of natural selection. However, by introducing randomness into the tournament composition, it also allows less fit individuals to participate, thereby preserving the genetic diversity of the population. The tournament size acts as a control parameter for selective pressure: larger values increase the elitist nature of the process, while smaller values promote greater diversity.
3.2.2. Crossover
The crossover operator implemented was cxTwoPoint. This mechanism takes two parental chromosomes and randomly defines two cut points along their length. The segments between these points are then exchanged, generating two offspring. This recombination process facilitates exploration of the solution space by creating novel parameter configurations and improving the algorithm’s ability to escape local optima.
3.2.3. Mutation
Mutation was performed using the mutFlipBit operator, which randomly alters the value of individual bits in a chromosome with a low probability (0.05 in this study). This operator scans the chromosome position by position, deciding whether to apply mutation based on the predefined probability. When applied, the binary value is inverted (0 → 1 or 1 → 0). Mutation ensures the introduction of genetic variability into the population, thereby reducing the risk of premature convergence and supporting the search for global solutions.
3.2.4. Results Logging
Upon completion of the genetic algorithm execution, a .csv file was generated to store the optimized parameters. The file included the following fields:
3.3. Implementation of the Artificial Neural Network
To predict the parameters of the Relative Strength Index, and after conducting preliminary tests with different configurations, an artificial neural network was implemented consisting of an input layer, one hidden layer, and an output layer.
Input Layer: The network included an input layer with 445 nodes, each corresponding to a unique input feature, representing either a buy or sell signal generated by the RSI indicator.
Hidden Layer: A hidden layer with 10 neurons was integrated, employing the Rectified Linear Unit (ReLU) activation function. This configuration introduced nonlinearity into the model and enabled the capture of complex relationships in the input data without excessively increasing computational complexity.
Output Layer: The architecture concluded with an output layer of three nodes, using a linear activation function. Each of these neurons was dedicated to predicting one of the three RSI parameters.
For ANN implementation, a .csv file was employed, in which stock tickers were used to extract price series corresponding to the same analysis period applied in the genetic algorithm. The dataset was randomly split into two subsets: 80% of the observations were assigned to the training process, and the remaining 20% were reserved for testing.
Specific hyperparameters were selected to balance the model’s ability to learn complex patterns while avoiding overfitting, thereby ensuring optimal performance in predicting RSI parameters. Among these, the ReLU activation function was applied in the hidden layer to introduce nonlinearity and support the learning of complex relationships in the data. In the output layer, a linear activation function was implemented, appropriate for regression problems requiring continuous value prediction. To determine the optimal neural network architecture, hyperparameter tuning was performed using Grid Search. Grid Search systematically tests all possible combinations of hyperparameters, training and validating the model with each configuration, and selects the one that yields the best performance.
Model parameter adjustment was performed using the Adam Optimizer, due to its ability to dynamically adapt the learning rate and combine the advantages of AdaGrad and RMSprop, resulting in high computational efficiency and low memory requirements. The Mean Squared Error loss function was employed, widely recognized as suitable for regression problems by quantifying the discrepancy between predicted and observed values. The model was trained for 2000 epochs, allowing for more precise adjustment of the ANN’s internal parameters.
Once training was completed, the model was applied to a new time horizon spanning from 1 January 2022 to 10 October 2023. Using AI tools and strategies, the efficiency of the neural network was assessed during this period. The investment simulation allowed calculation of the return rate generated by each stock from the first buy transaction to final liquidation. Subsequently, this rate was standardized by conversion into an equivalent effective annual rate, facilitating comparative analysis. This standardization enabled results to be contrasted with those derived from a traditional investment strategy, in which the RSI parameters are fixed at 30, 70, and 14 for buy, sell, and calculation thresholds, respectively.
4. Results
This section presents the main findings of the study, with the objective of providing a comprehensive overview of the performance projected by the neural network compared with the rates of return obtained through traditional technical analysis. The dataset summarizing the results includes the following variables: Ticker, Total Profit, Percentage Gain, Investment Days, Predicted Annual Rate under ANN, Annual Rate under the Standard Method, and Prediction Parameters (see
Appendix A).
To illustrate the results in greater detail, the stock of Art’s-Way Manufacturing Co., identified by the ticker ARTW, was selected as a representative case. For this stock, tables and figures are presented to highlight investment performance, serving as an illustrative example of the contrast between the methods analyzed.
4.1. Results of the Traditional Technical Analysis Method with RSI
Figure 1 displays the performance of the traditional technical analysis method based on the Relative Strength Index. In the upper section of the chart, the solid black line represents the evolution of the stock’s daily closing price. In the lower section, three reference lines are depicted: (i) a red dashed upper line indicating the overbought threshold at the value of 70; (ii) a red dashed lower line marking the oversold threshold at the value of 30; and (iii) a continuous blue line representing the daily RSI value, which fluctuates above and below the overbought and oversold levels.
The blue RSI line, shown in the lower section of
Figure 1, exhibits an oscillatory pattern directly reflecting price fluctuations of the asset. This behavior caused the indicator to repeatedly exceed the predefined overbought and oversold thresholds during the analyzed period. Consequently, buy signals were generated when the RSI fell below the lower threshold, while sell signals were triggered when it rose above the upper threshold.
Although this mechanism constitutes the fundamental logic of traditional technical analysis, the results indicate that the frequency with which the RSI crosses these thresholds may lead to both investment opportunities and ambiguous or low-yielding signals, depending on the volatility of the asset. The consolidation of these operations is presented in
Table 1, which provides a quantitative overview of performance under this strategy and establishes a benchmark for comparison with the results projected by the artificial intelligence model.
The investment analysis based on traditional technical analysis, using standard RSI parameters, identified and executed three transactions to evaluate their returns and equivalence in terms of effective annual yield. The results reveal significant variability in both gains and losses, as well as in the annualized rates of return.
In the first transaction, conducted between 7 February and 25 May 2018, 400,000 shares were purchased at USD 2.50 each, representing a total investment of USD 997,000. The shares were later sold at USD 3.00, generating proceeds of USD 1,196,400. This operation yielded a 20% profit over 107 days, equivalent to an effective annual rate of 86.25%.
In contrast, the second transaction, executed between 10 September 2018, and 19 February 2019, resulted in a loss of 1.48% over 162 days, corresponding to an annual effective rate of –3.31%. Finally, the third transaction, carried out between 11 March and 5 April 2019, generated a 10.71% gain in 25 days, which equates to an annualized effective rate of 341.95%.
These results highlight the high sensitivity of the traditional technical analysis method to market dynamics, as well as the substantial differences in performance depending on the time window considered.
Table 2 synthesizes the overall performance of the operations conducted using the traditional technical analysis method with standard RSI parameters. Collectively, these operations generated a net profit of USD 300,142. Over the entire investment horizon, the accumulated return reached 30.1%. The total duration of the transactions was 422 days, corresponding to an annualized return rate of 25.56%.
4.2. Results of the Application of Genetic Algorithms
The optimization of the RSI through genetic algorithms produced a graphical behavior analogous to that shown in
Figure 1; however, significant variations were observed in the positioning of the upper and lower limits, as well as in the trajectory of the continuous RSI line. The optimization process determined that the most suitable number of historical observations for constructing the indicator was 12 data points. It also identified an optimal upper threshold of 62 and a lower threshold of 29. These adjustments demonstrate the ability of the genetic algorithm to adapt RSI parameters to the specific characteristics of the asset under analysis, in contrast to the traditional approach that employs fixed values.
Figure 2 illustrates the behavior of the RSI line, characterized by oscillatory movements that more frequently crossed the overbought and oversold thresholds compared with those observed under the traditional technical analysis method. This behavior resulted in the execution of a larger number of transactions, which are consolidated in
Table 3.
The optimized operations demonstrated strong performance in most cases analyzed. The first transaction, conducted between 2 February and 6 March 2018, involved the purchase of 408 163 shares at a unit price of USD 2.45, for a total investment of USD 996,999.35. The subsequent sale at USD 2.85 per share generated proceeds of USD 1,159,774.76. This resulted in a gain of 16.33% over a 32-day period, equivalent to an effective annual rate of 461.24%.
Another transaction with particularly high returns was carried out between 27 December 2018, and 19 February 2019. In this case, 643,108 shares were acquired at a unit price of USD 2.00, totaling USD 1,282,357.35. The shares were later sold at USD 2.66 each, generating USD 1,705,535.28 in revenue. This represented a 33.0% gain over 54 days, corresponding to an annualized effective rate of 587.3%. However, not all operations were favorable. A representative example is the transaction executed between 6 September and 26 October 2018, which recorded a loss of 5.84%, equivalent to an annualized effective rate of –35.55%.
Table 4 summarizes the overall performance of the operations optimized through the application of GA to the RSI indicator. The total profit obtained, calculated as the difference between the final value and the initial investment, reached USD 935 586, equivalent to an accumulated return of 93.84%. This outcome reflects a significantly higher performance over the 502 days during which the operations were executed, corresponding to an effective annual rate of 61.81%.
4.3. Results of the Application of Artificial Neural Networks
The analysis with artificial neural networks involved investment in 80% of the initially selected assets, with the objective of evaluating performance both at the individual level and in aggregate, by considering the portfolio as a composite of all the stocks included in the study.
Appendix A provides a detailed description of the prediction parameters and associated results. A relevant finding is reflected in the last column of
Table A1, which reports the optimized parameter values: lower limit, upper limit, and number of data points used in the RSI calculation for each asset. These parameters differ substantially both across assets and in comparison to the standardized values traditionally employed in RSI under classical technical analysis. Within this set, 58.51% of the predictions not only outperformed the returns obtained with the traditional method but were also positive. This outcome highlights the ability of ANN to generate forecasts that are not merely optimistic but also realistic, reinforcing their potential utility in investment analysis and decision-making.
The cumulative gains recorded in the “Profit (USD)” column of
Table A1 amounted to USD 2,517,170. However, this figure was influenced by the atypical performance of Aptose Biosciences Inc. (APTO). Excluding this extraordinary outlier, the cumulative gain remained at USD 517,170, confirming that the portfolio’s favorable performance did not depend on a single asset but rather reflected diversification and the robustness of the predictive approach. Finally, when the analysis was conducted from a portfolio perspective under the assumption of investing an equivalent amount in each of the stocks listed in
Appendix A—the consolidated results are presented in
Table 5.
The findings of this study demonstrate the capacity of advanced neural networks to predict annual rates of return in financial contexts. Specifically, it was observed that in 69.15% of the cases analyzed (see
Appendix A), the annual rate of return estimated by the neural network exceeded that achieved through investment strategies based on conventional technical analysis approaches.
When assessing aggregate performance under a portfolio configuration consisting of one unit of each stock, the annual return obtained through the ANN-enhanced strategy was 22.71%, compared to 4.55% annually derived from the traditional strategy. This difference represents a significant result, underscoring the ability of the neural network to consistently predict superior and predominantly positive returns. These findings suggest that artificial neural networks possess a greater capacity to model and capture the inherent complexity of financial market dynamics, thereby overcoming the methodological limitations of traditional approaches. Consequently, the results emphasize the value of ANN as an advanced and effective tool for investors and financial analysts, opening new perspectives for their application in investment analysis and decision-making.
5. Discussion
The findings of this research, which applied genetic algorithms and artificial neural networks to equity investment through technical analysis using the Relative Strength Index, demonstrate satisfactory results. In most of the individually analyzed cases, returns exceeded those obtained through traditional technical analysis. Furthermore, when assessing the formation of a portfolio comprising all the financial assets considered, the results showed a significantly higher aggregate return, thereby confirming the effectiveness of the artificial intelligence-based approach.
These findings are consistent with prior studies by Bahrammirzaee (2010) [
14], Asadi et al. (2012) [
49], and Zhou et al. (2020) [
50], who also reported substantial improvements in investment profitability and corporate financial management when applying artificial intelligence techniques in equity market contexts. Specifically, Bahrammirzaee (2010) [
14] demonstrated that the integration of diverse AI methods—including ANN—applied in credit evaluation, portfolio management, and financial planning substantially outperforms traditional statistical models, particularly in problems characterized by nonlinear relationships and high temporal variability.
Although the AI methodologies employed in the present research are not fully aligned with those utilized in the aforementioned studies, the results converge in two key aspects: (i) the ability to outperform conventional statistical methods in most of the analyzed cases, and (ii) the recognition that, while returns are not superior across all scenarios, the general trend reflects a significant advantage in favor of AI-based approaches.
Zhou et al. (2020) [
50] conducted a study combining ANN and GA to optimize real-number encoding schemes, thereby enhancing the effectiveness of stock market investment predictions. Their work implemented a three-layer neural network, which facilitated improved sample segmentation, strengthened the training process, increased convergence speed, and prevented convergence toward local minima, thereby favoring the attainment of globally optimal solutions. Within this framework, GAs were initially employed to establish suitable learning rules that guided ANN operations according to the problem’s nature. One of the principal conclusions of Zhou et al.’s study was the critical role of ANN in compensating for optimization limitations inherent in GA applications.
In Zhou et al.’s research, historical stock data were directly used to predict immediate future prices (T + 1). In contrast, the present study employed a technical analysis approach based on RSI with a broader time frame, encompassing several months during both training and testing stages. Nevertheless, both studies underscore the effectiveness of combining GA and ANN, beginning with GA optimization of the parameters later incorporated as ANN inputs. This procedure enables high levels of efficiency in predicting stock prices and investment returns. Additionally, both works acknowledge that, despite favorable results—whether in next-day price prediction or in achieving returns superior to those derived from traditional technical analysis—not all scenarios yielded consistently superior performance compared with conventional investment methods.
Similarly, Asadi et al. (2012) [
49] focused their research on forecasting specific stock indices, such as those of Taiwan and Tehran, as well as various sectoral and reference indices from Asian and U.S. markets, including the Dow Jones Industrial Average and NASDAQ. To this end, they implemented ANN with data preprocessed using GA and the Levenberg–Marquardt algorithm. In their case, preprocessing was designed to optimize neuron weighting across the network’s layers. The methodological approach of Asadi et al. (2012) [
49] aligns with that of the present study insofar as both employ AI techniques to refine and prepare input data for ANN. This procedure yields significantly improved results in terms of reducing training time, adapting to nonlinear problem structures, and enhancing predictive accuracy in financial market fluctuations.
Overall, studies that integrate multiple AI techniques, particularly ANN-based models, consistently report satisfactory results relative to their objectives, whether by improving predictive accuracy or achieving higher returns compared with traditional investment and data analysis methods. At the same time, these works converge in acknowledging the limited temporal validity of such models. The high volatility of financial markets and the multitude of factors influencing asset prices complicate long-term prediction. In this regard, the primary reason for the inability to achieve consistently superior performance through the joint application of GA and ANN is that no method—whether traditional or AI-based—is sufficiently robust to consistently outperform market dynamics. This limitation arises because each stock, index, or financial asset exhibits particular characteristics that evolve over time, thereby determining that the variables used for their analysis possess varying degrees of effectiveness depending on the context of application [
51].
6. Conclusions
This study, which integrates genetic algorithms and artificial neural networks applied to equity investment through technical analysis using the Relative Strength Index, demonstrates results that are significantly superior to those obtained through conventional investment methodologies. In most of the individual stock-level analyses, higher returns were achieved compared to those obtained with the traditional use of the RSI. However, the findings also indicate that the application of artificial intelligence to technical analysis-based strategies does not systematically guarantee superior results in all cases under examination.
When the investment strategy is evaluated jointly under a portfolio framework, with equal monetary allocations among the considered assets, the resulting returns outperform those of the traditional approach, even multiplying the values of annualized profitability in some cases.
The superiority of the results obtained through AI-driven techniques can be primarily attributed to the dynamic adjustment of parameters used in the construction of the RSI indicator. Since the price and return behavior of financial assets is shaped by idiosyncratic and contextual factors and exhibits nonlinear, time-varying characteristics, the optimization of these parameters provides a substantial advantage over the traditional methodology, which relies on fixed and invariable configurations regardless of the specific features of each asset, the issuing company’s performance, or the surrounding economic environment.
However, the results also indicate that the parameters optimized through artificial intelligence techniques exhibit a limited temporal validity. Their effectiveness largely depends on prevailing market conditions, the degree of volatility, and the inherent dynamics of the underlying companies. Consequently, it becomes necessary to consider relatively short analysis periods, along with the periodic review and continuous adjustment of the technical indicator parameters for each asset, in order to preserve the model’s effectiveness in contexts characterized by high variability and financial turbulence.
Limitations and Future Research Directions
The main limitation of this research lies in the computational power required for the implementation of artificial intelligence-based models. The combined application of genetic algorithms and artificial neural networks demands significant computational resources, substantially increasing the time required to carry out the study. As a result, the research was limited to the analysis of the Relative Strength Index technical indicator applied to equity assets, with performance evaluated exclusively based on the individual returns of each stock or their aggregation as an investment portfolio.
This technical limitation highlights the relevance of future research aimed at broadening the scope to include other technical indicators commonly used in financial markets, as well as the evaluation of different asset classes. In this regard, future lines of research should focus on the application of hybrid artificial intelligence methodologies in broader contexts, considering the diversification of investment technical indicators, different time horizons, and emerging financial markets. The objective would not only be to improve the expected portfolio performance, but also to conduct an investment risk analysis that enhances risk-return efficiency. Additionally, incorporating dividend payments from stocks should be considered, thereby providing relevant empirical evidence to support decision-making in investment management.