Artificial intelligence applied to investment in variable income through the MACD (moving average convergence/divergence) indicator


  • Alberto Antonio Agudelo Aguirre Administracion, Universidad Nacional de Colombia, Manizales, Colombia
  • Néstor Darío Duque Méndez Informática y Computación, Universidad Nacional de Colombia, Manizales, Colombia
  • Ricardo Alfredo Rojas Medina Administración, Universidad Nacional de Colombia, Manizales, Colombia


Artificial intelligence, Genetic algorithms, Investment, MACD, Stock market, Technical analysis, Variable income


Purpose. This study aims to determine whether, by means of the application of genetic algorithms (GA) through the traditional technical analysis (TA) using moving average convergence/divergence (MACD), is possible to achieve higher yields than those that would be obtained using technical analysis investment strategies following a traditional approach (TA) and the buy and hold (B&H) strategy.

Design/methodology/approach. The study was carried out based on the daily price records of the NASDAQ financial asset during 2013–2017. TA approach was carried out under graphical analysis applying the standard MACD. GA approach took place by chromosome encoding, fitness evaluation and genetic operators. Traditional genetic operators (i.e. crossover and mutation) were adopted as based on the chromosome customization and fitness evaluation. The chromosome encoding stage used MACD to represent the genes of each chromosome to encode the parameters of MACD in a chromosome. For each chromosome, buy and sell indexes of the strategy were considered. Fitness evaluation served to defining the evaluation strategy of the chromosomes in the population according to the fitness function using the returns gained in each chromosome.

Findings. The paper provides empirical-theoretical insights about the effectiveness of GA to overcome the investment strategies based on MACD and B&H by achieving 5 and 11% higher returns per year, respectively. GA-based approach was additionally capable of improving the return-to-risk ratio of the investment.

Research limitations/implications. Limitations deal with the fact that the study was carried out on US markets conditions and data which hamper its application in some extend to markets with not as much development.

Practical implications. The findings suggest that not only skilled but also amateur investors may opt for investment strategies based on GA aiming at refining profitable financial signals to their advantage.

Originality/value. This paper looks at machine learning as an up-to-date tool with great potential for increasing effectiveness in profits when applied into TA investment approaches using MACD in well-developed stock markets.



Download data is not yet available.


Abdel-Basset, M., Abdel-Fatah, L. and Sangaiah, A. (2018), “Metaheuristic algorithms: a comprehensive review”, Computational Intelligence for Multimedia Big Data on the Cloud with Engineering Applications. doi: 10.1016/B978-0-12-813314-9.00010-4.

Agudelo Aguirre, A.A., Rojas Medina, R.A. and Duque Méndez, N.D. (2020), “Machine learning applied in the stock market through the Moving Average Convergence Divergence (MACD) indicator”, Investment Management and Financial Innovations, Vol. 17 No. 4, pp. 44-60, doi: 10.21511/imfi.17(4).2020.05.

Allen, F. and Karjalainen, R. (1999), “Using genetic algorithms to find technical trading rules”, Journal of Financial Economics, Vol. 51 No. 2, pp. 245-271, doi: 10.1016/S0304-405X(98)00052-X.

Anggono, A. and Herlanto, A. (2019), “Investment strategy based on exponential Moving Average and count back line”, Review of Integrative Business and Economics Research, Vol. 8 No. E, pp. 153-161.

Bautó, J., Canelas, A., Neves, R. and Horta, N. (2018), “Parallel SAX/GA for financial pattern matching using NVIDIA's GPU”, Expert Systems with Applications, Vol. 105 No. 5, pp. 77-88, doi: 10.1016/j.eswa.2018.03.026.

Drezner, Z. and Drezner, T. (2020), “Biologically inspired parent selection in Genetic Algorithms”, Annals of Operations Research, Vol. 287, pp. 161-183, doi: 10.1007/s10479-019-03343-7.

Dubinskas, P. and Urbsiene, L. (2017), “Investment portfolio optimization by applying a genetic algorithm”, Ekonomika, Vol. 96 No. 2, pp. 66-78, doi: 10.15388/Ekon.2017.2.10998.

Faijareon, C. and Sornil, O. (2019), “Evolving and combining technical indicators to generate trading strategies”, Journal of Physics, Vol. 1195 No. 1, pp. 66-78, doi: 10.1088/1742-6596/1195/1/012010.

Farias, N., Silva, J. and Sobeiro, A. (2017), “A literature review of technical analysis on stock markets”, Quarterly Review of Economics and Finance, Vol. 66, pp. 115-126, doi: 10.1016/j.qref.2017.01.014.

Fu, T., Chung, C.P. and Chung, F. (2013), “Adopting Genetic Algorithms for technical analysis and portfolio management”, Computers and Mathematics with Applications, Vol. 66 No. 10, pp. 1743-1757, doi: 10.1016/j.camwa.2013.08.012.

Gold, S. (2015), “The viability of six popular technical analysis trading rules in determining effective buy and sell signals”, Journal of Applied Financial Research, Vol. 2, pp. 8-29, doi: 10.2478/sbe-2019-0054.

Gupta-Bhattacharya, N., Aganvd, V. and Sachedeva, J. (2014), “Impact of economic and demographic factors on stock market investments in India”, South Asian Journal of Management, Vol. 21, pp. 72-99.

Holland, J. (1975), Adaptation in Natural and Artificial Systems, University of Michigan Press, Ann Arbor.

Hsieh, W.W. (2009), Machine Learning Methods in Environmental Sciences. Neural Networks and Kernels, Cambridge University Press, Cambridge.

Ibrahim, M. (2011), “Level and volatility of stock prices and aggregate investment: the case of Thailand”, Global Economic Review, Vol. 40 No. 4, pp. 445-461, doi: 10.1080/1226508X.2011.626155.

Ivanovski, Z., Ivanovska, N. and Narasanov, Z. (2017), “Technical analysis accuracy at Macedonian stock exchange”, UTMS Journal of Economics, Vol. 8 No. 2, pp. 105-118, available at:

Jacobsen, L. and Kanber, B. (2016), Genetic Algorithms in Java Basics, Springer, New York.

Kohers, G., Kohers, N. and Kohers, T. (2006), “The risk and return characteristics of developed and emerging stock markets: the recent evidence”, Applied Economics Letters, Vol. 13 No. 11, pp. 737-743, doi: 10.1080/13504850500407210.

Kumar, N., Mohapatra, S. and Sandhu, G. (2013), “Importance of technical and fundamental analysis and other strategic factors in the Indian stock”, Management Review: An International Journal, Vol. 8 No. 1, pp. 38-75.

Martín, C., Quintana, D. and Isasi, P. (2018), “Evolution of trading strategies with flexible structures: a configuration comparison”, Neurocomputing, Vol. 331, doi: 10.1016/j.neucom.2018.11.062.

Metaxiotis, K. and Psarras, J. (2004), “The contribution of neural networks and genetic algorithms to business decision support: academic myth or practical solution?”, Management Decision, Vol. 42 No. 2, pp. 229-242, doi: 10.1108/00251740410518534.

Metghalchi, M. and Garza-Gómez, X. (2013), “The use of technical trading rules to predict overall stock price movements”, International Journal of Management, Vol. 30 No. 2, pp. 678-691.

Moghaddam, A.H., Moghaddam, M.H. and Esfandyari, M. (2016), “Stock Market index prediction using artificial neural network”, Journal of Economics, Finance and Administrative Science, Vol. 21, pp. 89-93, doi: 10.1016/j.jefas.2016.07.002.

Murphy, J. (1999), Análisis Técnico de los Mercados Financieros, New York Institute of Finance, Barcelona.

Narwal, K.P., Sheera, V.P., Mittal, R. and Soriya, S. (2018), “Risk-return relationship for stock-market investments: a study of the implied volatility index of Japan (VXJ)”, South Asian Journal of Management, Vol. 25 No. 1, pp. 1-19.

Redelinghuys, P. (2019), “Knowing a buy signal from a sell”, available at: (accessed 16 February 2020).

Rosillo, R., de la Fuente, D. and Brugos, J. (2013), “Technical analysis and the Spanish stock exchange”, Applied Economics, Vol. 45 No. 12, pp. 1541-1550, doi: 10.1080/00036846.2011.631894.

Sezer, O.B., Ozbayoglu, A.M. and Dogdu, E. (2017), “An artificial neural network-based stock trading system using technical analysis and big data framework”, ACM Proceedings of the Southeast Conference, pp. 223-226, doi: 10.1145/3077286.3077294.

Slen, F. (2019), Nasdaq-100 Higher Volatility than the S&P 500, Global Information Services, available at: (accessed 09 November 2020).

Snipper Market Timing (1987), “The market crash of 1987”, available at: (accessed 10 November 2020).

Sörensen, K. (2015), “Metaheuristics - the metaphor exposed”, International Transactions in Operational Research, Vol. 22, pp. 3-18, doi: 10.1111/itor.12001.

Terence, T., Wing, N. and Venus, K. (2014), “Revisiting the performance of MACD and RSI oscillators”, Journal of Risk and Financial Management, Vol. 7 No. 1, pp. 1-12, doi: 10.3390/jrfm7010001.

Wang, J. and Kim, J. (2018), “Predicting stock price trend using MACD optimized by historical volatility”, Mathematical Problems in Engineering, Vol. 2018, pp. 1-12, doi: 10.1155/2018/9280590.

Zhang, J. and Maringer, D. (2016), “Using a Genetic Algorithm to improve recurrent reinforcement learning for equity trading”, Computational Economics, Vol. 47, pp. 551-567, doi: 10.1007/s10614-015-9490-y.




How to Cite

Agudelo Aguirre, A. A., Duque Méndez, N. D., & Rojas Medina, R. A. (2021). Artificial intelligence applied to investment in variable income through the MACD (moving average convergence/divergence) indicator. Journal of Economics, Finance and Administrative Science, 26(52), 268–281. Retrieved from