Machine learning applied in the stock market through the Moving Average Convergence Divergence (MACD) indicator

The implementation of tools such as Genetic Algorithms has not been exploited for asset price prediction despite their power, robustness, and potential application in the stock market. This paper aims to fill the gap existing in the literature on the use of Genetic Algorithms for predicting asset pricing of investment strategies into stock markets and investigate its advantages over its peers Buy & Hold and traditional technical analysis. The Genetic Algorithms strategy applied to the MACD was carried out in two different validation periods and sought to optimize the parameters that generate the buy-sell signals. The performance between the machine learning-based approach, technical analysis with the MACD and B&H was compared. The results suggest that it is possible to find optimal values of the technical indicator parameters that result in a higher return on investment through Genetic Algorithms, beating the traditional technical analysis and B&H by around 4%. This study offers a new insight for practitioners, traders, and finance researchers to take advantage of Genetic Algorithms for trading rules application in forecasting financial asset returns under a more efficient and robust methodology based on historical data analysis.


INTRODUCTION
Understanding the behavior of the price of financial assets and its prediction for the future has historically been a major challenge faced by practitioners. Anticipating price movements accurately is consequently key for rewarding and profitable decision-making on investments.
Different approaches to forecasting the stock market have been proposed despite the most famous Fama's (1970) efficient market hypothesis. The analysis based on fundamentals and that using technical tools are the main streams of the stock market forecasting approach studied for the last two decades in literature. Although less common, fundamental analysis relates mainly to macroeconomic time series (such as interest rates, customer price index, currency exchange rates, among other information), along with information gathered from financial news. On the other hand, technical analysis is a more common documented approach based on input stock prices or technical indicators. Technical analysis is based on the argument that macroeconomic information and disclosed financial news is already regarded in stock prices (for a more detailed study on state of the art in the stock market forecast based on fundamentals and technical approaches (Bustos & Pomares-Quimbaya, 2020).
In the search for predictability of future prices, fundamental analysis exhibits major limitations and weaknesses that make it even harder to build models depicting stock fluctuations in a consistent way. As fundamental analysts rely on a deeper understanding of all aspects of a company and specific stocks, the process of gathering all these features needed for a complete company valuation become intensive and time-consuming, making it frequently impractical.
Even though technical analysis encompasses powerful tools such as graphical analysis and indicators with grounds on historical data, discussions have arisen on subjectivity, and lack of precision derived from the graphical interpretations analysts could give to charts representing the asset's fluctuations prices. Therefore, the accuracy of the prediction would depend largely on the analysts' ability to interpret the collected and graphed information, which brings major challenges for a reliable stock market forecasting as a systematic approach per se. Despite these shortages, indicators-based analysis is supported by establishing computations and complementary charts to the stock prices, which helps practitioners make decisions about when to take a short or long position in a specific financial asset. Thus, if technical indicators such as RSI (Relative Strength Index) and MACD (as the most common indicators currently in use by practitioners) are rationally incorporated into more reliant price prediction approaches it would benefit the financial market and would be a major contribution towards eradicating subjectivity in the stock market analysis.
As the availability of computational resources has increased, technical analysis has also evolved to incorporate such tools. Genetic Algorithms (GA) have been successfully used to select optimal features and find the best parameters for an optimal solution to a problem in many fields. Moreover, there is empirical evidence in recent literature on a notably good performance in anticipating stock prices by GAbased approaches in different financial markets. GA may be able to facilitate the advance of technical indicators-based approaches from purely visual analysis and subjective frameworks to more quantitative ones by fusing GA with indicators for more objective testing and exploitation of technical indicators advantages. Thus, this study aims to develop an investment strategy in a variable income asset to evaluate the efficiency in returns that could be generated with a GA-based strategy using MACD technical indicator. The results are compared in terms of forecasting performance against that from the MACD traditional approach and the Buy & Hold (B&H) investment strategy. Lobato-Macedo, Godinho, and Alves (2020) investigated momentum, breakout, and trend indicators to optimize trading strategies based on a fusion with GA in three Forex markets. Their findings showed that GA-generated parameters outperformed comparable indicators used in the Forex industry. These observations could be attributed to the better search capabilities of GA to find wider solution spaces and facilitating solution convergence throughout the entire resolution process. Thus, GA's potential application into the price prediction of stock markets would supply a more extensive and varied set of solutions for a reliable optimal solution.

LITERATURE REVIEW AND THEORETICAL BACKGROUND
Genetic programming, a specialized form of evolutionary algorithms with a similar structure to GA has also been adopted in the futures and options markets characterized by discontinuous price movements and jumps in the stock markets. To address such discontinuity, natural log functions have been included with genetic programming in the solution framework to capture the nonlinearity derived from this irregular tendency. In this regard, Ding, Cui, Xiong, and Bai (2020) used lagged returns as predictors and special relation to accounting for the nonlinearity of the price trends into the genetic programming framework. Their work suggests that improved profitability superior to 15% compared to typical models such as autoregressive models, can be achieved by applying approaches based on genetic programming with nonlinearity capture models. Please refer to Pimenta, Nametala, Guimaraes, and Carrano (2017) for additional information about Genetic Programming studies and its variants.

Methodology
The methodology carried out in this study consisted of two stages. Stage 1 constituted the technical analysis strategy under the traditional scheme using the technical indicator MACD (Moving Average Convergence Divergence) applied to the data under study. Stage 2 was based on the application of Genetic Algorithms (GA) to the MACD using the historical data from stage 1. Python software was used for the development and application of GA. The initial analysis period in stage 2 was made up of one-third of all the historical data and corresponded to the algorithm's training phase developed in this stage. The training period aimed at determining the initial parameters leading to the highest possible return on investment. Subsequently, the training phase results were applied to the second segment of historical data to confirm the consistency of the parameters obtained and the validation of the results leading to the achievement of the investor's objective. Validation processes were included as a methodological confirmation required for the predictive application of asset prices based on these study's results.
Taking into account that the theories on which modern financial investment is based present the impossibility of predicting future behaviors of variable income assets, an additional validation process is developed with the third part of the remaining data in a period different from those two periods initially considered to establish the quality and consistency of the results. This test is carried out through the comparative analysis of the values obtained in the two validation stages. A final stage is developed by calculating the difference between the price of the asset on the date of the last sale and its price on the date of the first buy to establish the return achieved by holding the asset throughout the period (B&H strategy).
For the calculation of the return on investment under each of the strategies analyzed, the assumptions of an initial acquisition of 1,000 units of assets and the reinvestment of the total value achieved with each sale (including the surpluses generated) until the date of the last transaction when the investment is liquidated were made in this study.

Traditional technical analysis with MACD
The technical analysis was carried out using the Moving Average Convergence/Divergence (MACD) indicator in its traditional form, which uses exponential averages for its calculation and prioritizes the most current information in its weighting process (Singla & Malik, 2016).
Expression (1) was used for the calculation of traditional MACD: where p -asset price for the period, i -current period, n -number of data considered for the calculation of the moving average.
According to Sanel (2016), the calculation of the MACD considered two moving averages (slow (θ 1 ) and fast (θ 2 )) for its calculation. The moving averages were obtained according to the following criteria: θ 1 made up with 26 data (market standard), θ 2 with 12 data (usual for the financial market), θ 1 -θ 2 (required for the construction of the MACD line) and finally, the moving average was calculated with the data from the MACD line (standardized with 9 data points, according to the expression SMA 9 [θ 1 − θ 2 ]).
The MACD oscillator is developed by drawing a graph consisting of three lines: the MACD line    Figure 1.
Each of these behavioral characteristics between the lines is considered as signals, therefore the buy signal offered by the MACD strategy occurs when the fast line crosses the slow line from the bottom up, as long as the crossing occurs below zero and as farthest as possible from this value. While it is interpreted as a sell signal when the fast line crosses the slow one from top to bottom, but unlike the previous one, the crossing must occur above zero, and as farthest as possible from this value (Han, Yang, & Zhou, 2013; Tai-Leung Chong, Ng, & Liew, 2014). The above happens because crossings above or below the zero level of the lines without fulfilling the requirement to be away from zero can be false signals and therefore, analysts generally do not consider them as valid signals to take a stand in a financial asset (Metghalchi, Chen, & Hayes, 2015).

Application of Genetic Algorithms in MACD
The AG strategy development stages consisted of natural selection, crossing, and mutation, according to Zhang and Maringer (2015). The random generation of the chromosome population corresponded to the initial optimization phase. Each of the chromosomes (made up of genes that represent a characteristic of each individual, according to G. Vasilakis, G. A. Vasilakis, Theofilatos, Georgopoulos, Karathanasopoulos, and Likothanassis. (2013) was considered a possible candidate to achieve the objective initially set out in the strategy. The selection process was then carried out according to the adjustment parameters to the objective function in order to obtain the highest return on investment.
Combinations by crossing individuals were made from the created population. As a result of these combinations, new individuals with genetic characteristics from their parents were originated. Consequently, an iterative process was initiated by originating a new generation of individuals by each iteration. Variations to the chromosomes were then applied through the mutation process that consecutively generated new individuals (de-scendants) with superior characteristics compared to those in their ancestors. Based on the results of the mutation process that generated a population of superior individuals, the selection process was carried out, according to Shin and Kim (2012). The previous iterative process promoted generations at each time with characteristics of improved adaptability and better genetic quality than those in its predecessors (Huang, 2012).
Sequentially, the basic parameters corresponding to the number of data of θ 1 , θ 2 , and SMA n [θ 1 − θ 2 ] were defined in the modeling process and considered for the development of this study. Subsequently, minimum ranges (above and below the zero-level) suitable for the validation of buy and sell signals of the indicator were established and automatic stop loss and take profit parameters representative of entry, and exit signals of the position were defined.

Genetic sequencing procedure
The AG strategy development took into consideration a configuration of chromosomes consisting of 31 bits (total number) distributed in 9 genes of varied magnitude. Each of the genes (referenced from gene A to gene I) with a specific trading rule function is described further. The definition of genes and the operators used in each of them are defined in Table 1. The methodological procedure followed for the structured genetic sequencing followed in this study is presented in Figure 2.

Data
The analysis data used to carry out this study corresponded to the historical price of a variable income asset representative of the stock market NASDAQ stock index (USA) over a seven-year period. During this period, the prices were the opening, closing, highest and lowest prices in each business round between January 01, 2013 and December 31, 2019. The data for the study were divided equally into three segments: a data segment to carry out the training phase corresponding to 33.3% of all historical data, and a second and third segments used in the initial validation and validation stages in a period other than the one studied, corresponding to 66.6 % of data in both cases.
Determine the range above zero and establish a suitable limit for "selling" signals validation Determine the range below zero and establish the suitable limit for "buying" signals validation 3 Establish the upper limit for "selling" price ("take profit") Determine the level of maximum loss to assume on "selling" decisions ("stop loss") Determine the level for maximum loss to assume after receiving a "buying" signal due to the start rising the price ("stop loss") Establish a lower limit of motion for the "buying price signal ("take profit")

EMPIRICAL RESULTS
The objective function that sought the definition of the best trading rules applicable to the MACD oscillator, based on the individual with the highest possible performance through the AG strategy, allowed the execution of six and five buy-sell transactions for the final initial validation stages, respectively ( Table 2).
The results in the initial validation showed a nominal return (Final value / Initial value -1) equivalent to 40.7% and an effective annual return ((1 + nominal yield) (365 / # days investment) ) -1) of 17.4% during the analysis time starting from an investment of USD 4,735,280 and ending with a settlement of USD 6,663,284, as shown in Table 2.
The final validation process showed a return of around 20.1% from an initial investment of USD 7,083,645 and a final accumulated value of USD 8,506,987, corresponding to 19.5% of the effective annual rate in the analysis period ( Table 2).
The results of applying the three strategies (B&H, TA, and GA) were contrasted in terms of the performance achieved in each of them. Figures 3 and  4 describe the behavior of the performance variable for the B&H, the TA, and the GA strategies for the analysis period in the initial and final validations of the application of GA, respectively. The accumulated return on investment was calculated at the same initial and final times, which consid-ered the acquisition of 1,000 units of assets and the reinvestment of the total value of the accumulated money once a purchase signal was generated.
The results also showed decreases in asset value between buying and selling (as shown in Table 2). This indicates that, although the strategy was appropriate in terms of returns (as confirmed in the results of good returns shown in Table 2), it was not exempted from deficiencies, and in some cases, losses were generated in certain buy-sell transactions (e.g., 1-Aug-15 and 24-Sep-15; 09-Sep-16 and 02-Nov-16).
The results in the initial validation stage showed the holding of the money from the selling of the asset through the GA strategy, and consequently, the absence of volatility in three ranges that stand out for a long time elapsed between the generation of the sell signal and the next buy (Figure 3), out of a total of 6 sell operations and the same number of buying transactions ( Table 2). Although the first GA-strategy selling transaction was executed on September 24, 2015 and a buying signal was generated on October 2, 2015 (Table 2), the transaction (sell-buy) did not allow increasing the accumulated value difference between investments ( Figure 3). On the other hand, the GA-based strategy with transactions on December 2, 2015 (sell) and January 7, 1016 (buy) showed a positive difference of 10.37% compared to the B&H strategy ( Figure 3). The results also showed that a new selling signal was generated on July 12, 2016, under Note: 1 Type of transaction corresponding to initial and final validations. 2 Asset quotation at the time of the sell or the buy completion, expressed in USD. 3 Number of negotiated asset units at each buying and selling transaction. 4 Represents the value of each deal, computed as the number of asset units times its unit price.
the GA strategy resulting in an increment close to 4% in the accumulated value and deriving in a smaller difference between the accumulated value of the investment and that for the B&H strategy at the time the following purchase signal was generated (September 09, 2016. Figure 3). Under this strategy, a new sell-buy transaction was generated between February 15 and April 20, 2017 ( Figure  3). However, after this sell, although fluctuations were evidenced, no significant drops in price were also confirmed, which led to a smaller differences in the accumulated return (corresponding to 4.1%) and sustained until the time of liquidation of the investment between the GA and B&H strategies came to a term ( Figure 3).
On the other hand, the results showed that sellbuy signals were generated under the TA strategy (November 11, 2015 and January 28, 2016, Figure  3). In turn, during the following period, despite frequent fluctuations, an upward price trend was leading until the sell signal was received (April 4,    Figure 3). This selling signal turned into the asset's liquidation by the absence of buying signals afterwards. Although the results showed value of investment from TA strategy be above the ones from GA and B&H-based strategies during the aforementioned date, the sustained and generalized valuation of the asset price after this date allowed GA and B&H strategies to exceed the accumulated value of the investment from the TA strategy in a figure close to 13% for the GA and around 8.9% for the B&H.
The results of the analysis of the asset acquisition at market price in response to the generation of the first buy signal in the final validation (February 14, 2018, Figure 4) showed a similar trend for TA, B&H, and GA-based strategies up to the moment of generation of the first selling signal through the GA strategy (March 23, 2018). This behavior caused the accumulated value of the investment under the GA to remain stable for 17 days due to the holding of the money from its liquidation. This could be evidenced by the horizontal line displayed in the price trend as shown in Figure 4. New variations in the accumulated value of the investment were observed from the following purchase (April 10, 2018, Figure 4). As a result, due to the investment money holding through the GA strategy in the first sell, the B&H strategy benefits from the fluctuation in the price and positions it as superior against the genetic strategy.
As shown in Figure 4, holding the money for a 2-month time resulted in the absence of fluctuation in the accumulated value (originated on August 24, 2018) when a new sale was executed under the GA strategy. The price trends also showed a drop from the beginning October and accentuated in December, which was translated into a considerable decrease in the accumulated investment value under the B&H. Moreover, this was overcoming by the GA strategy by the selling signal received on December 7, 2018 ( Figure 4). This fact caused the AG strategy's accumulated value to remain above the B&H strategy up to the point in time that the asset was liquidated (February 25, 2019) ending with a difference in yield of 7.12% per year, as shown in Figure 4. In general, the accumulated value of the investment under the GA strategy was below the TA and the B&H during the first half of the time analyzed. On the contrary, the GA strat-egy's accumulated value was superior to the other strategies during the second half of the period (Figure 4).
The behavior of the accumulated value of the investment under the TA strategy is shown in Figure  4. In general, throughout the analysis, it maintained an average value between that for GA and B&H strategies, except for a short period in which it was lower until reaching its final liquidation with a value of 1.69% above the B&H and at the same time it was exceeded by the GA strategy in 5.43%.
The returns are expressed in terms of effective annual rates for each strategy, as a comparable indicator is essential to understand the net profit after deducting costs associated with the transaction. The effective annual return (Table 3) calculated for the investment using the three strategies showed notable differences between the GA strategy vs. the B&H and the TA strategies in both validation stages. The annualized effective return greater than 4% per year was obtained through the GA strategy compared with that obtained in the initial validation through the B&H strategy ( Table  3). The final validation phase showed the effective performance resulting from the TA strategy closer to the result of the GA strategy than that obtained by the B&H strategy, although the difference concerning the GA strategy was more than 5% below (Table 3). The values of the conformation parameters of the MACD technical indicator concerning the TA strategy and the definition of the stop loss and take profit values that complement the asset buy signals, were also established in this study (Table  4). Both upper and lower validation limits were assigned to the MACD indicator lines' crosses using the GA methodology as validation parameters of the respective buy-sell signals, as shown in Figure 5. The upper and lower limiting lines concerning zero are shown in Figure 5, corresponding to values of 10 and −5, respectively. The limits showed asymmetry regarding their distance to zero (Figure 4), showing GA-based strategy with greater capacity to capture non-linear and complex trends as characterized by financial assets (Karathanasopoulos, Mitra, Skindilias, & Lo, 2017). The results of the analysis under Genetic Algorithms showed that due to the general upward trend in the price of the asset during the training period (and as the range of the established upper limit was extended), the MACD indicator showed less sensitivity to the signals generated at this limit due to the effect that historical data have in determining oscillator parameters. The results also showed that for the same reason, the strategy under the GA displayed sell signals on different dates than those under the TA strategy (Table 2).

DISCUSSION
The timely and effective management of information is currently an essential circumstance to structure an optimal investment strategy that assertively guides the investor, indicating when to execute a transaction. In today's aggressive financial world, a delay in executing a transaction can lead to the loss of considerable profits. The increasing development of statistical and computational tools such as Genetic Algorithms now makes the frequency and accuracy of forecasts more powerful and robust. It favors success in generating profits against their passive investment pairs B&H strategy and active investment through the TA strategy. The objective function that sought the definition of the best trading rules applicable to the MACD oscillator based on the individual with the highest possible performance through the GA strategy allowed the execution of six and five buy and sell transactions for the initial and final validation stages, respectively (see Table 2).
The superiority of the GA-based investment strategy was observed in the comparative analysis in the initial validation phase among the three types of methodologies studied. Increases in annual yield close to 4.14% and 12.98% were achieved through the GA strategy, respectively, surpassing the B&H and the TA strategies. Although the GA strategy yields against the B&H and the TA strategies yields   differed from each other during the final validation phase (7.12% and 5.43%) regarding the initial phase, the GA strategy's superiority was consistent in both periods. Bessembinder and Chan (1998) researched the profitability in the use of moving averages and the range breakout indicator in the North American stock market. The study showed that, although the analysis using these technical indicators is robust in its predictability, transaction costs represent a high negative impact on the net return on investment. In this study, the surplus obtained through the GA strategy exceeded the committed transaction cost, which has been shown to have a high incidence on the net return on investment (including transactional costs) in contrast to the study by Bessembinder and Chan (1998), whose costs compromised the surplus, reaching only marginal profitability.
Although there is evidence of good performance in price prediction when technical analysis is applied in emerging markets such as the Asian market -Malaysia, Thailand, Indonesia, and the Philippines (Hoque, Kim, & Pyun, 2007; Yu, Nartea, Gan, & Yao, 2013), the negative impact of transaction costs on profitability to the point of marginalization of profits in net profitability has also been documented, according to Yu et al. (2013). Empirical studies before Yu et al. (2013) have shown that the use of common trading rules as filter rules (Fama & Blume, 1966) and moving averages (Dale & Workman, 1980) have presented good predictive capacity for profitability in more evolved and efficient markets (in terms of information) such as the North American markets. However, the profit generation of this type of technical strategies against the B&H strategy has also been debated due to the low net profit margins when transaction costs are considered.
The net profits obtained from the strategy based on the technical analysis under Genetic Algorithms were higher than those generated by the B&H strategy in this study. The good performance of the technical strategy can be attributed to the characteristics of the MACD indicator by providing the analyst with the ability to identify the direction of the short-term trend speedily and effortlessly in the asset's price. In turn, these properties would generate unequivocal transactional signals to the analyst that assist in the exclusion of any subjectiv-ity in decision-making (Scott, Carr, & Cremonie, 2016). The MACD indicator also, understandably, showed changes and trends in the direction of the momentum by assisting in measuring the market sentiment and optimizing decision-making (Eric, Andjelic, & Redzepagic, 2009). The slow-moving average value and the fast-moving average value of the MACD indicator were typically 26 and 12 in this study (DeBuse, 2016), while the same parameters corresponded to 10 and 4 using the GA strategy applied to the indicator. The MACD indicator (like the Relative Strength Index -RSI) is among the instruments with the highest statistically consistent returns over time when used even with their typical parameters (Elder, 1993). The GA strategy was a useful methodological tool to be applied to the indicator and achieve a greater adjustment exceeding the performance through its typical configuration and including the limit measurements (lower and upper) to verify the signals' validity from the crossing of lines of the indicator.
The signals generated by the traditional MACD indicator during this study's investment process were surpassed by 8.84% with the B&H strategy in the first validation. They exceeded the B&H strategy by 1.69% in the second validation (annual net profitability), suggesting that, under selected parameters in some cases, the indicator can be robust on reliable signals even in its typical series configuration  without prior optimization required. Investment strategies using the MACD indicator applied to less efficient financial markets than North American markets such as the Republic of Serbia stock market (Eric, Andjelic, & Redzepagic, 2009). It has shown that the MACD parameters require optimization to exceed the B&H strategy earnings. Eric, Andjelic, and Redzepagic (2009) managed to overcome the B&H strategy with a level of net profitability close to 280% by optimizing the parameters of the indicator. The admissible performance of the MACD parameters through the GA strategy (10-4) of this study with annualized yields higher than the B&H strategy of 4.14% and 7.12%, respectively, in the first and second validation, could have benefited from market conditions in which the study was applied and for its characteristic performance regarding high volume and frequency of transactions (Eric, Andjelic, tor's robustness in a wide variety of markets and the efficient adjustment of Genetic Algorithms are also widely documented. The MACD indicator could generate effective and real buy and sell signals confirmed with the histogram, and it captured the trends and momentum of the market during the analysis time, managing to consolidate the opportunities for action. Trading rules defined for traditional technical analysis provided signals that could be identified as bullish or bearish trends and take early action on the buy or sell. The application of Genetic Algorithms to the MACD technical indicator in the NASDAQ stock index's asset transaction made a better profit than the simple strategy of buying and holding the asset (B&H). Using the fitness function evaluated, which defined the net capital gain in the transaction of the assets studied (sum of the differentials obtained from the transactions of selling and buying financial assets during the total study period), the Genetic Algorithms provided a practical candidate to locate a sufficiently close solution to the global optimum time interval within the study for the specified stock index. The MACD indicator is especially useful due to its ability to find points of return within the captured price trends in the market that indicate buy and sell signals and take advantage of the speed response of the indicator to the price movement (Wiles & Enke, 2015). In practical terms, this is derived as an indicator of strength and reliability in the MACD indicator's signals within the analysis and its results.
On the other hand, the results also evidenced the generation of false signals using the traditional technical analysis strategy, although this behavior is not atypical of technical investment strategies, as documented in the literature (Shalini, Pranav, & Utkarsh, 2019). The failed signals observed in this study were found in both validation phases. In the initial phase, it was shown that the traditional technical strategy did not receive a buy signal after April 4, 2016, despite evidence of sustained growth in the price (higher than a 24% increase in the price) that occurred in the months following the period analyzed. Likewise, in the final phase of validation, this fact was evidenced when no sell signal was received (liquidation of the investment) when the most noticeable drop in the price of the asset occurred in the first days of December 2018 (losses of more than 20% of its value) within 24 days. The use of the MACD indicator has proven to be sufficiently effective when presented at the beginning or the end of a trend, and it has proven to be less effective in the absence of any trend in the price of any financial asset (this is commonly called laterality in the price). Additionally, the generation of failed signals has been associated with technical analysis that uses moving averages, such as the MACD indicator case. This as a consequence of the selection of two very short-term moving averages (between 5 and 8 days generally) that would generate many cuts between them and consequently, more false signals as a result of the random movement of the price in the short term (Bodas et al., 2013). This then suggests that it would be advisable to combine the indicator messages with warnings of the breakdown of trend lines and levels of buying and selling, which generate confirmation messages to make the entries of the indicator more effective.
The results from applying the GA strategy to the MACD indicator also showed the presence of false buy or sell signals. Specifically, false sell signals were received on July 12, 2016 and February 15, 2017, is revealed when the observed disposition indicated a continuous bullish trend. During the final validation, a false sell signal was generated on February 25, 2019, which led to the investment's liquidation even though the price growth was sustained for an additional time range. Parker, Larson, Kalaycioglu, Apoian, and Clavel (2010) found that the application of the GA strategy does not guarantee that the price movement will conclude in signals that lead to a change of position with the asset and, therefore, the elimination of false signals in the analysis is not guaranteed. Studies carried out by Lee and Tzeng (2013) also support these findings by reporting a prediction accuracy level of 70% using a technical analysis strategy under a machine learning methodology.
The results of the validation phases were particularly differentiating between the GA and the B&H strategies regarding the number of buy-sell signals. The GA strategy captured 5-6 buy-sell signals in the initial-final stages, being efficient in identifying reliable action opportunities before the buying at the beginning of the period and selling only at the end of the period (B&H strategy).
Consequently, the B&H strategy's benefit constituted only the difference in assets between these two points in time, significantly lower than the respective benefit of the global solution through the GA strategy. Grossman (1976) suggests that successive changes in the prices of financial assets in the market are a consequence of a random process of the independent variables involved. This argument is of fundamental importance to be debated in this study because it is then proposed that, in a fully efficient market governed by such random behavior, no technical rule could be used to reliably achieve higher profits than those obtained by a simple rule of the B&H strategy (Fama & Blume, 1966).
This argument is of fundamental importance to be debated in this study because it is proposed that, in a fully efficient market governed by such random behavior, no technical rule could be used to reliably achieve higher profits than those obtained by a simple rule of the B&H strategy (Fama & Blume, 1966).
Differences in the return and the accumulated value of the investment were evident in this study. The GA-based investment strategy exhibited better performance than the TA strategy over time, derived from the dynamics and versatility of Genetic Algorithms, favoring the search for parameters more adjusted to the trends in the asset's prices under study (see Table 3). These findings are similar to yields above 13% reported by Shin and Kim (2012) in unfavorable market conditions and by Bodas et al. (2013) under the machine learning application. In both cases, these returns' causality was directly related to the adjustment of the parameters of the technical indicators applied. This suggests that the adjustment in the oscillator parameters highly favored the GA strategy's beneficial results.

CONCLUSION
Technical analysis was applied in this study through the use of the MACD oscillator in its traditional configuration and, alternatively, the application of Genetic Algorithms to the oscillator in the asset investment strategy of the NASDAQ stock index was studied. Both investment strategies primarily sought to achieve superior performance on net return (single-target strategies) than the return obtained with a simple B&H strategy until the final transaction. These strategies examined the use of the indicator within technical strategies that generate buy and sell signals (of variable income financial instruments) derived from the statistical calculation of moving averages and their transmission to the market. The fundamental basis of the analysis consisted of debating the "infallibility" premises of the market for its effective performance forecast based only on the intrinsic value of an asset and its dependence on events in the real economy and not on the stock market, its weighting expectations and, therefore, subjectivity. In contrast, this study supported the idea that refined quantitative techniques with the support of evolutionary procedures applied to historical data result in efficient price prediction and timely generation of buy and sell signals. Based on the above, the most relevant conclusions of the study can be summarized.
The exploitation of historical data on asset prices in the developed stock index such as the one in this study, with high volume movements and high frequency (amplitude) information, for the development of profitable investment strategies should be applied to active strategies such as technical analysis. More than the wide availability of information by the investor and other participants in the market that would reduce information asymmetry, its efficient and profitable manipulation can be transferred to emerging markets with more limited information, thus favoring efficiency in these markets.
Technical analysis per se is a useful tool in the consistent search for price trends and asset behavior with sufficient historical information availability. The robustness of technical indicators such as the MACD indicator is appropriate to institute adjusted trends (bullish, bearish, or lateral) to the real behavior of the asset price in the stock market, even though it is sensitive to generating misleading indications that must be detected a priori or expectedly to increase confidence in its use in the medium and long term.
Genetic Algorithms are effective procedures in adapting historical asset price data to its population and its evolutionary representation over time, even under contrasting market conditions. Therefore, the optimization of the return on investment in the stock index is possible through its implementation within a technical analysis strategy to favor its synergism. This study represents a starting point for new effective and reliable ways of approaching investment strategies with a special application on equity markets. This was achieved by identifying the most fitting input parameters for the MACD indicator describing each particular asset.