Machine learning applied in the stock market through the Moving Average Convergence Divergence (MACD) indicator
-
DOIhttp://dx.doi.org/10.21511/imfi.17(4).2020.05
-
Article InfoVolume 17 2020, Issue #4, pp. 44-60
- Cited by
- 1862 Views
-
621 Downloads
This work is licensed under a
Creative Commons Attribution 4.0 International License
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.
- Keywords
-
JEL Classification (Paper profile tab)C45, E47, F14
-
References62
-
Tables4
-
Figures5
-
- Figure 1. Traditional form of the oscillator MACD
- Figure 2. Genetic sequencing procedure followed in this study
- Figure 3. Cumulative performance for GA, B&H, and TA strategies in the initial validation
- Figure 4. Cumulative performance for GA, B&H and TA strategies in the final validation
- Figure 5. Validation of signals across limits (lower and upper) for the MACD indicator
-
- Table 1. Definition and properties of gens applied to MACD and general chromosome structure
- Table 2. Buy & Sell strategy under GA, validation stages
- Table 3. Effective annual return1 of GA, B&H, and TA strategies
- Table 4. Oscillator parameters and values defined by the Genetic Algorithms
-
- Ahmad, M., Guohui, W., Rafiq, M., Hasan, M., Chohan, A.-H., & Sattar, A. (2017). Assesing performance of moving average investment timing strategy over the UK stock market. The Journal of Developing Areas, 51(3), 349-362.
- Ahmadi, E., Jasemi, M., Monplaisir, L., Nabavi, M. A., Mahmoodi, A., & Jam, A. P. (2018). New efficient hybrid candlestick technical analysis model for stock market. Expert Systems with Applications, 94, 21-31.
- Bessembinder, H., & Chan, K. (1998). Market efficiency and the returns to technical analysis. Financial Management, 27(2), 5-17.
- Bodas, D., Bodas-Sagi, D. J., Fernández-Blanco, P., Hidalgo J., & Soltero-Domingo, F. (2013). A parallel evolutionary algorithm for technical market indicators optimization. Natural Computing, 12, 195-207.
- Bustos, O., & Pomares-Quimbaya, A. (2020). Stock market movement forecast: a systematic review. Expert Systems with Applications, 156, 113464.
- Cervelló-Royo, R., Guijarro, F., & Michniuk, K. (2015). Stock market trading rule based on pattern recognition and technical analysis. Expert Systems with Applications, 42(14), 5963-5975.
- Chan, P., & Mehralizadeh, M. (2016). Forecasting east Asian indices futures via a novel hybrid of Wavelet-PCA denoising and artificial neural network models. PLoS ONE, 11(6), 1-29.
- Chiang, Y.-C., Ke, M.-C., Liao, T., & Wang, C.-D. (2012). Are technical trading strategies still profitable? Applied Financial Economics, 22(12), 955-965.
- Cohen, G., & Cabiri, E. (2015). Can technical oscillators outperform the buy and hold strategy? Applied Economics, 47(30), 3189-3197.
- Dale, C., & Workman, R. (1980). The Arc Sine law and the treasury bill futures market. Financial Analysts Journal, 36, 71-74.
- DeBuse, B. (2016). MACD: The trade’s indicator.
- Dejan, E. Andjelic, G., & Redzepagic, S. (2009). Application of MACD and RVI indicators as functions of investment strategy optimization on the financial market. Journal of Economics and Business, 27(1), 171-196.
- Dichtl, H. (2019). Investing in the S&P 500 index: Can anything beat the buy-and-hold strategy? Review of Financial Economics, 38(2), 1-27.
- Ding, S., Cui, T., Xiong, X., & Bai, R. (2020). Forecasting stock market return with nonlinearity: a genetic programming approach. Journal of Ambient Intelligence and Humanized Computing, 1-13.
- Dunis, C., Laws, J., & Karathanassopoulos, A. (2011). Modelling and trading the Greek Stock market with Mixed Neural Network Models. Applied Financial Economics, 21(23), 1793-1808.
- Eiamkanitchat, N., Moontuy, T., & Ramingwong, S. (2017). Fundamental analysis and technical analysis integrated system for stock filtration. Cluster Computing, 20(1), 883-894.
- Elder, A. (1993). Trading for a Living: Psychology, trading Tactics, Money Management. New York: John Wiley & Sons Inc.
- Eric, D., Andjelic, G., & Redzepagic, S. (2009). Application of MACD and RVI indicators as functions of investment strategy optimization on the financial market. Zbornik Radova Ekonomskog Fakultet au Rijec, 27(1), 171-196.
- Esfahanipour, A., & Mousavi, S. (2011). A genetic programming model to generate risk adjusted technical trading rules in stock markets. Expert System with Applications, 38(7), 8438-8445.
- Fama, E. (1970). Efficient capital markets: a review of theory and empirical work. Journal of Finance, 25, 383-417.
- Fama, E., & Blume, M. (1966). Filter rules and stock market trading. Journal of Business, 39(1), 226-241.
- Farooq, M., & Reza, H. (2014). Applying technical analysis from a comparative perspective. International Journal of Islamic and Middle Eastern Finance and Management, 7(4), 395-420.
- Fernández, G., De la Cal, E., & Quiroga, R. (2010). Improving return using risk-return adjustment and incremental training in technical trading rules with GAPs. Applied Intelligence, 33(2), 93-106.
- Fernández, H. (2018). Aplicación del análisis técnico para la toma de decisiones (buying/selling) intradia en el futuro e-mini Standard & Poor’s 500.
- Gorgulho, A., Neves, R., & Horta, N. (2011). Applying a GA Kernel on optimizing technical analysis rules for stock picking and portfolio composition. Expert Systems with Applications, 38(11), 14072-14085.
- Grossman, S. (1976). On the efficiency of competitive stock markets where trades have diverse information. Journal of Finance, 31(2), 573-585.
- Han, Y., Yang, K., & Zhou, G. (2013). The cross-sectional profitability of technical analysis. The Journal of Financial and Quantitative Analysis, 48(5), 1433-1461.
- Hilliard, J., Schwartz, A., & Squire, J. (2013). A test of technical analysis: Matching time displaced generalized patterns. Financial Management, 42(2), 291-314.
- Hjalmarsson, E. (2010). Predicting global stock returns. The Journal of Financial and Quantitative Analysis, 45(1), 49-80.
- Hoque, H. A., Kim, J. H., & Pyun, C. S. (2007). A comparison of variance ratio tests of random walk: A case of Asian emerging stock markets. International Review of Economics and Finance, 16(4), 488-502.
- Huang, C. (2012). A hybrid stock selection model using genetic algorithms and support vector regression. Applied Soft Computing, 12(2), 807-818.
- Hung, L., Cheng, C., & Chin, H. (2010). Technical analysis, investment psychology, and liquidity provision: evidence from the Taiwan stock market. Emerging Markets Finance and Trade, 46(5), 18-38.
- Karathanasopoulos, A., Mitra, S., Skindilias, K., & Lo, C. (2017). Modelling and trading the English and German stock markets with novelty optimization techniques. Journal of Forecasting, 36(8), 974-988.
- Khan, M., Khan, N., Hussain, J., Shah, N., & Abbas, Q. (2017). Validity of technical analysis indicators. Abasyn University Journal of Social Sciences, 10(1), 1-19.
- Kubińska, E., Czupryna, M., Markiewicz, Ł., & Czekaj, J. (2016). Technical analysis as a rational tool of decision making for professional traders. Emerging Markets Finance and Trade, 52(12), 2756-2771.
- Lahmiri, S. (2018). A technical analysis information fusion approach for stock price analysis and modeling. Fluctuation & Noise Letters, 17(1), 1-14.
- Lee, C., & Tzeng, J. (2013). Trend-oriented training for neural networks to forecast stock markets. Asia Pacific Management Review, 18(2), 181-195.
- Lin, X., Yang, Z., & Song, Y. (2011). Intelligent stock trading system based on improved technical analysis and echo state network. Expert Systems with Applications, 38(9), 1347-11354.
- Liu, C., Yao, S., & Chen, Y. (2019). Lcyanalysis: An R package for technical analysis in stock markets. IEICE Transactions on Information and Systems, E102.D(7), 1332-1341.
- Lobato-Macedo, L., Godinho, P., & Alves, M. J. (2020). A comparative study of technical trading strategies using a Genetic Algorithm. Computational Economics, 55, 349-381.
- Metghalchi, M., Chen, C., & Hayes, L. (2015). History of share prices and market efficiency of the Madrid general stock index. International Review of Financial Analysis, 40, 178-184.
- Moosa, I., & Li, L. (2011). Technical and fundamental trading in the Chinese stock market. Emerging Markets Finance & Trade, 47(1), 23-31.
- Murphy, J. (1999). Technical Analysis of the Financial Markets: A Comprehensive guide to trading methods and applications. New York: Prentice Hall Press.
- Parker, A. S., Larson, A. M., Kalaycioglu, S., Apoian, Z. A., & Clavel, C. (2010). SLAM!: SelL-SignAl model for predicting underperforming stocks.
- Pimenta, S., Nametala, C., Guimaraes, F., & Carrano, E. (2017). An automated investing method for stock market based on multiobjective genetic programming. Computational Economics, 52, 125-144.
- Rosillo, R., De la Fuente, D., & Brugos, J. (2014). Technical analysis and the Spanish stock Exchange. Applied Economics, 45(12), 1541-1550.
- Sanel, H. (2016). MACD-analysis of weaknesses of the most powerful technical analysis tool. Independent Journal of Management & Production, 7(2), 367-379.
- Scott, G., Carr, M., & Cremonie, M. (2016). Technical analysis: Modern perspectives. Research Foundation Literature Reviews, 11(1), 45.
- Shalini, T., Pranav, S., & Utkarsh, S. (2019). Picking buy-sell signals. Studies in Business & Economics, 14(3), 205-219.
- Shin, K., & Kim, K. (2012). Evolving profitable trading rules with genetic algorithms. International Information Institute Koganei, 15(8), 3313-3321.
- Silva, R., Tonissi A., & Zambon, A. (2009). Moving average convergence-divergence as a tool for deciding on investments in the stock market. RAC Curitiba, 13(2), 291-309.
- Singla, R., & Malik, N. (2016). Role of EMA in technical analysis: Finance India. Indian Institute of Finance, XXX(3), 919-942.
- Subramanian, V., & Balakrishnan, K. (2015). Profitability of technical analysis: Finance India. Indian Institute of Finance, XXIX(4), 1245-1254.
- Tai-Leung Chong, T, Ng, W.-K., & Liew, V. K-S. (2014). Revisiting the performance of MACD and RSI oscillators. Journal of Risk and Financial Management, 7(1), 1-12.
- Vasilakis, G., Vasilakis, G. A., Theofilatos, K. A., Georgopoulos, E. F., Karathanasopoulos, A., & Likothanassis, S. D. (2013). A genetic programming approach for EUR/USD exchange rate forecasting and trading. Computational Economics, 42(4), 415-431.
- Wang, J., Liu, H.-C., Du, J., & Hsu, Y.-T. (2018). Economic benefits of technical analysis in portfolio management: Evidence from global stock markets. International Journal of Finance & Economics, 24(2), 890-902.
- Wang, L., An, H., Liu, X., & Huang, X. (2016). Selecting dynamic moving average trading rules in the crude oil futures market using a genetic approach. Applied Energy, 162(C), 1608-1618.
- Wang, T., & Sun, Q. (2015). Why investors use technical analysis? Information discovery vs herding behavior. China Finance Review International, 5(1), 53-68.
- Wiles, P., & Enke, D. (2015). Optimizing MACD parameters via genetic algorithms for soybean futures. Procedia Computer Science, 61, 85-91.
- Xu, S., & Yang, Y. (2013). Fractional Black-Scholes Model and Technical Analysis of Stock Price. Journal of Applied Mathematics, 1-7.
- Yu, H., Nartea, G., Gan, C., & Yao, L. (2013). Predictive ability and profitability of simple technical trading rules: Recent evidence from Southeast Asian stock markets. International Review of Economics & Finance, 25, 356-371.
- Zhang, J., & Maringer, D. (2015). Using a Genetic Algorithm to Improve Recurrent Reinforcement Learning for Equity Trading. Computational Economics, 47, 551-567.