skip to main content
research-article

Stock Prediction by Searching for Similarities in Candlestick Charts

Published:01 July 2014Publication History
Skip Abstract Section

Abstract

The aim of stock prediction is to effectively predict future stock market trends (or stock prices), which can lead to increased profit. One major stock analysis method is the use of candlestick charts. However, candlestick chart analysis has usually been based on the utilization of numerical formulas. There has been no work taking advantage of an image processing technique to directly analyze the visual content of the candlestick charts for stock prediction. Therefore, in this study we apply the concept of image retrieval to extract seven different wavelet-based texture features from candlestick charts. Then, similar historical candlestick charts are retrieved based on different texture features related to the query chart, and the “future” stock movements of the retrieved charts are used for stock prediction. To assess the applicability of this approach to stock prediction, two datasets are used, containing 5-year and 10-year training and testing sets, collected from the Dow Jones Industrial Average Index (INDU) for the period between 1990 and 2009. Moreover, two datasets (2010 and 2011) are used to further validate the proposed approach. The experimental results show that visual content extraction and similarity matching of candlestick charts is a new and useful analytical method for stock prediction. More specifically, we found that the extracted feature vectors of 30, 90, and 120, the number of textual features extracted from the candlestick charts in the BMP format, are more suitable for predicting stock movements, while the 90 feature vector offers the best performance for predicting short- and medium-term stock movements. That is, using the 90 feature vector provides the lowest MAPE (3.031%) and Theil’s U (1.988%) rates in the twenty-year dataset, and the best MAPE (2.625%, 2.945%) and Theil’s U (1.622%, 1.972%) rates in the two validation datasets (2010 and 2011).

References

  1. Andreopoulos, Y. 2009. Comments on “phase-shifting for nonseparable 2-D Haar wavelets. IEEE Trans. Image Process. 18, 8, 1897--1898. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Araújo, R. D. A. 2010. Hybrid intelligent methodology to design translation invariant morphological operators for Brazilian stock market prediction. Neural Netw. 23, 10, 1238--1251. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Araújo, R. D. A. and Ferreira, T. A. E. 2013. A morphological-rank-linear evolutionary method for stock market prediction. Inform. Sci., 237, 3--17. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Ariss, R. T., Rezvanian, R., and Mehdian, S. M. 2011. Calendar anomalies in the Gulf Cooperation Council stock markets. Emerg. Markets Rev. 12, 3, 293--307.Google ScholarGoogle ScholarCross RefCross Ref
  5. Asadi, S., Hadavandi, E., Mehmanpazir, F., and Nakhostin, M. M. 2012. Hybridization of evolutionary Levenberg--Marquardt neural networks and data pre-processing for stock market prediction. Knowl.-Based Syst. 35, 245--258. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Bollerslev, T. 1986. Generalized autoregressive conditional heteroscedasticity. J. Econometrics 31, 3, 307--327.Google ScholarGoogle ScholarCross RefCross Ref
  7. Briza, A. C. and Naval Jr., P. C. 2011. Stock trading system based on the multi-objective particle swarm optimization of technical indicators on end-of-day market data. Appl. Soft Comput. 11, 1, 1191--1201. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Brock, W., Lakonishok, J., and LeBaron, B. 1992. Simple technical trading rules and the stochastic properties of stock returns. J. Finance 47, 5, 1731--1764.Google ScholarGoogle ScholarCross RefCross Ref
  9. Caginalp, G. and Laurent, H. 1998. The predictive power of price patterns. Appl. Math. Finance 5, 3--4, 181--205.Google ScholarGoogle ScholarCross RefCross Ref
  10. Chan, S. W. K. and Franklin, J. 2011. A text-based decision support system for financial sequence prediction. Decision Supp. Syst. 52, 1, 189--198. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Chang, P. H. K. and Osler, C. L. 1999. Methodical madness: Technical analysis and the irrationality of exchange-rate forecasts. Econ. J. 109, 458, 636--661.Google ScholarGoogle ScholarCross RefCross Ref
  12. Chen, D. R., Huang, Y. L., and Lin, S. H. 2011. Computer-aided diagnosis with textural features for breast lesions in sonograms. Comput. Med. Imaging Graphics 35, 3, 220--226.Google ScholarGoogle ScholarCross RefCross Ref
  13. Chen, P. C. and Pavlidis, T. 1983. Segmentation by texture using correlation. IEEE Trans. Pattern Anal. Mach. Intell. 5, 1, 64--69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Cheng, C. H., Chen, T. L., and Wei, L. Y. 2010. A hybrid model based on rough sets theory and genetic algorithms for stock price forecasting. Inform. Sci. 180, 9, 1610--1629. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Chianga, J. Y. and Cheng, S. R. 2009. Multiple-instance content-based image retrieval employing isometric embedded similarity measure. Pattern Recog. 42, 1, 158--166. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Colander, D. C. 2012. Macroeconomics 9th Ed. McGraw-Hill, New York, NY.Google ScholarGoogle Scholar
  17. Corder, G. W. and Foreman, D. I. 2009. Nonparametric Statistics for Non-Statisticians: A Step-By-Step Approach 1st Ed. Wiley, New York, NY.Google ScholarGoogle Scholar
  18. de Groot, B. and Franses, P. H. 2012. Common socio-economic cycle periods. Technol. Forecasting Soc. Change 79, 1, 59--68.Google ScholarGoogle ScholarCross RefCross Ref
  19. Doyle, J. R. and Chen, C. H. 2009. The wandering weekday effect in major stock markets. J. Banking Finance 33, 8, 1388--1399.Google ScholarGoogle ScholarCross RefCross Ref
  20. Edwards, R. D., Magee, J., and Bassetti, W. H. C. 2012. Technical Analysis of Stock Trends 10th Ed. CRC Press, Boca Raton, FL.Google ScholarGoogle Scholar
  21. Engle, R. F. 1982. Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation. Econometrica 50, 4, 987--1007.Google ScholarGoogle ScholarCross RefCross Ref
  22. Fama, E. F. 1970. Efficient capital markets: A review of theory and empirical work. J. Finance 25, 2, 383--417.Google ScholarGoogle ScholarCross RefCross Ref
  23. Fiess, N. M. and MacDonald, R. 2002. Towards the fundamentals of technical analysis: Analysing the information content of high, low and close prices. Econ. Modell. 19, 3, 353--374.Google ScholarGoogle ScholarCross RefCross Ref
  24. Fock, J. H., Klein, C., and Zwergel, B. 2005. Performance of candlestick analysis on intraday futures data. J. Derivatives 13, 1, 28--40.Google ScholarGoogle ScholarCross RefCross Ref
  25. Friesen, G. C., Weller, P. A., and Dunham, L. M. 2009. Price trends and patterns in technical analysis: A theoretical and empirical examination. J. Banking Finance 33, 6, 1089--1100.Google ScholarGoogle ScholarCross RefCross Ref
  26. Fuertes, A. M., Izzeldin, M., and Kalotychou, E. 2009. On forecasting daily stock volatility: The role of intraday information and market conditions. Int. J. Forecasting 25, 2, 259--281.Google ScholarGoogle ScholarCross RefCross Ref
  27. Graña, M. and Veganzones, M. A. 2012. An endmember-based distance for content based hyperspectral image retrieval. Pattern Recog. 45, 9, 3472--3489. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Hagenau, M., Liebmann, M., and Neumann, D. 2013. Automated news reading: Stock price prediction based on financial news using context-capturing features. Decision Supp. Syst. 55, 3, 685--697.Google ScholarGoogle ScholarCross RefCross Ref
  29. Hansen, P. R. and Lunde, A. 2005. A forecast comparison of volatility models: Does anything beat a GARCH(1,1)? J. Appl. Econometrics 20, 7, 873--889.Google ScholarGoogle ScholarCross RefCross Ref
  30. He, D. C. and Wang, L. 1990. Texture unit, texture spectrum, and texture analysis. IEEE Trans. Geosci. Remote Sens. 28, 4, 509--512.Google ScholarGoogle ScholarCross RefCross Ref
  31. Hsia, C. H., Chiang, J. S., and Guo, J. M. 2013. Memory-efficient hardware architecture of 2-D dual-mode lifting-based discrete wavelet transforms. IEEE Trans. Circuits Syst. Video Technol. 23, 4, 671--683. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Hsia, C. H., Guo, J. M., and Chiang, J. S. 2009. Improved low-complexity algorithm for 2-D integer lifting-based discrete wavelet transform using symmetric mask-based scheme. IEEE Trans. Circuits Syst. Video Technol. 19, 8, 1202--1208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Hsieh, T. J., Hsiao, H. F., and Yeh, W. C. 2011. Forecasting stock markets using wavelet transforms and recurrent neural networks: An integrated system based on a artificial bee colony algorithm. Appl. Soft Comput. 11, 2, 2510--2525. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Hsu, C. M. 2011. A hybrid procedure for stock price prediction by integrating self-organizing map and genetic programming. Expert Syst. Appl. 38, 11, 14026--14036.Google ScholarGoogle Scholar
  35. Hsu, P. H. and Kuan, C. M. 2005. Reexamining the profitability of technical analysis with data snooping checks. J. Financial Econ. 3, 4, 606--628.Google ScholarGoogle ScholarCross RefCross Ref
  36. Hung, J. C. 2009. A fuzzy asymmetric GARCH model applied to stock markets. Inform. Sci. 179, 22, 3930--3943. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Kang, M. 2010. Probability of information-based trading and the January effect. J. Banking Finance 34, 12, 2985--2994.Google ScholarGoogle ScholarCross RefCross Ref
  38. Krishnamachari, S. and Chellappa, R. 1997. Multiresolution Gauss-Markov random field models for texture segmentation. IEEE Trans. Image Proc. 6, 2, 251--267. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Kwon, Y. K. and Moon, B. R. 2007. A hybrid neurogenetic approach for stock forecasting. IEEE Trans. Neural Netw. 18, 3, 851--864. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Lee, C. H. L., Liu, A., and Chen, W. S. 2006. Pattern discovery of fuzzy time series for financial prediction employing an isometric embedded similarity measure. Pattern Recog. 42, 1, 158--166.Google ScholarGoogle Scholar
  41. Lee, C. H. L., Liu, A., and Chen, W. S. 2006. Pattern discovery of fuzzy time series for financial prediction. IEEE Trans. Knowl. Data Eng. 18, 5, 613--625. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Lee, D. J., Antani, S., Chang, Y., Gledhill, K., Long, L. R., and Christensen, P. 2009. CBIR of spine X-ray images on inter-vertebral disc space and shape profiles using feature ranking and voting consensus. Data Knowl. Eng. 68, 12, 1359--1369. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Lee, K. H. and Jo, G. S. 1999. Expert system for predicting stock market timing using a candlestick chart. Expert Syst. Appl. 16, 4, 357--364.Google ScholarGoogle ScholarCross RefCross Ref
  44. Leigh, W., Modani, N., Purvis, R., and Roberts, T. 2002. Stock market trading rule discovery using technical charting heuristics. Expert Syst. Appl. 23, 2, 155--159.Google ScholarGoogle ScholarCross RefCross Ref
  45. Levy, T. and Yagil, J. 2012. The week-of-the-year effect: Evidence from around the globe. J. Banking Finance 36, 7, 1963--1974.Google ScholarGoogle ScholarCross RefCross Ref
  46. Lilly, J. M. and Olhede, S. C. 2010. On the analytic wavelet transform. IEEE Trans. Inf. Theory 56, 8, 4135--4156. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Lin, M. C., Lee, A. J. T., Kao, R. T., and Chen, K. T. 2011. Stock price movement prediction using representative prototypes of financial reports. ACM Trans. Manage. Inf. Syst. 2, 3, 11--18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Liu, C. F., Yeh, C. Y., and Lee, S. J. 2012. Application of type-2 neuro-fuzzy modeling in stock price prediction. Appl. Soft Comput. 12, 4, 1348--1358. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Liu, F. and Wang, J. 2012. Fluctuation prediction of stock market index by Legendre neural network with random time strength function. Neurocomput. 83, 12--21. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Luo, L. and Chen, X. 2013. Integrating piecewise linear representation and weighted support vector machine for stock trading signal prediction. Appl. Soft Comput. 13, 2, 806--816. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Marshall, B. R., Young, M. R., and Cahan, R. 2008. Are candlestick technical trading strategies profitable in the Japanese equity market? Rev. Quant. Finance Account. 31, 2, 191--207.Google ScholarGoogle ScholarCross RefCross Ref
  52. Marshall, B. R., Young, M. R., and Rose, L. C. 2006. Candlestick technical trading strategies: Can they create value for investors. J. Banking Finance 30, 8, 2303--2323.Google ScholarGoogle ScholarCross RefCross Ref
  53. Moller, N. and Zilca, S. 2008. The evolution of the January effect. J. Banking Finance 32, 3, 447--457.Google ScholarGoogle ScholarCross RefCross Ref
  54. Morris, G. L. 2006. Candlestick Charting Explained: Timeless Techniques for Trading Stocks and Futures 3rd Ed. McGraw-Hill, New York, NY.Google ScholarGoogle Scholar
  55. Murphy, J. J. 1999. Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and Applications 1st Ed. New York Institute of Finance, New York, NY.Google ScholarGoogle Scholar
  56. O’Connor, N. and Madden, M. G. 2006. A neural network approach to predicting stock exchange movements using external factors. Knowl.-Based Syst. 19, 5, 371--378.Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Oh, S. K., Pedrycz, W., and Park, H. S. 2006. Genetically optimized fuzzy polynomial neural networks. IEEE Trans. Fuzzy Syst. 14, 1, 125--144. Google ScholarGoogle ScholarDigital LibraryDigital Library
  58. Park, K. and Shin, H. 2013. Stock price prediction based on a complex interrelation network of economic factors. Eng. Appl. Artif. Intell. 26, 5--6, 1550--1561. Google ScholarGoogle ScholarDigital LibraryDigital Library
  59. Qi, M. and Zhang, G. P. 2008. Trend time-series modeling and forecasting with neural networks. IEEE Trans. Neural Netw. 19, 5, 808--816. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Quellec, G., Lamard, M., Cazuguel, G., Cochener, B., and Roux, C. 2010. Adaptive nonseparable wavelet transform via lifting and its application to content-based image retrieval. IEEE Trans. Image Proc. 19, 1, 25--35. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Rapach, D. E. and Wohar, M. E. 2006. In-sample vs. out-of-sample tests of stock return predictability in the context of data mining. J. Empirical Finance 13, 2, 231--247.Google ScholarGoogle ScholarCross RefCross Ref
  62. Rui, Y., Huang, T. S., and Chang, S. F. 1999. Image retrieval: Current techniques, promising directions and open issues. J. Visual Commun. Image Rep. 10, 1, 39--62. Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. Sapankevych, N. I. and Sankar, R. 2009. Time series prediction using support vector machines: A survey. IEEE Comput. Intell. Mag. 4, 2, 24--38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. Schumaker, R. P. and Chen, H. 2009. Textual analysis of stock market prediction using breaking financial news: The AZFinText system. ACM Trans. Inf. Syst. 27, 2, 1--19. Google ScholarGoogle ScholarDigital LibraryDigital Library
  65. Smeulders, A. W. M., Worring, M., Santini, S., Gupta, A., and Jain, R. 2000. Content-based image retrieval at the end of the early years. IEEE Trans. Pattern Anal. Mach. Intell. 22, 12, 1349--1380. Google ScholarGoogle ScholarDigital LibraryDigital Library
  66. Tsai, C. F. and Hsiao, Y. C. 2010. Combining multiple feature selection methods for stock prediction: Union, intersection, and multi-intersection approaches. Decis. Supp. Syst. 50, 1, 258--269. Google ScholarGoogle ScholarDigital LibraryDigital Library
  67. Wang, Y. F., Cheng, S., and Hsu, M. H. 2010. Incorporating the Markov chain concept into fuzzy stochastic prediction of stock indexes. Appl. Soft Comput. 10, 2, 613--617. Google ScholarGoogle ScholarDigital LibraryDigital Library
  68. Wink, A. M. and Roerdink, J. B. T. M. 2010. Polyphase decompositions and shift-invariant discrete wavelet transforms in the frequency domain. Signal Proc. 90, 6, 1779--1787. Google ScholarGoogle ScholarDigital LibraryDigital Library
  69. Yue, J., Li, Z., Liu, L., and Fu, Z. 2011. Content-based image retrieval using color and texture fused features. Math. Comput. Modell. 54, 3--4, 1121--1127. Google ScholarGoogle ScholarDigital LibraryDigital Library
  70. Zarandi, M. H. F., Zarinbal, M., Ghanbari, N., and Turksen, I. B. 2013. A new fuzzy functions model tuned by hybridizing imperialist competitive algorithm and simulated annealing application: Stock price prediction. Inf. Sci. 222, 213--228. Google ScholarGoogle ScholarDigital LibraryDigital Library
  71. Zarb, F. G. and Kerekes, G. T. 1970. The Stock Market Handbook: Reference Manual for the Securities Industry 1st Ed. Dow Jones-Irwin, Homewood, IL.Google ScholarGoogle Scholar
  72. Zheng, P. and Huang, J. 2013. Discrete wavelet transform and data expansion reduction in homomorphic encrypted domains. IEEE Trans. Image Proc. 22, 6, 2455--2468. Google ScholarGoogle ScholarDigital LibraryDigital Library
  73. Zhu, Y. and Zhou, G. 2009. Technical analysis: An asset allocation perspective on the use of moving averages. J. Financial Econ. 92, 3, 519--544.Google ScholarGoogle ScholarCross RefCross Ref

Index Terms

  1. Stock Prediction by Searching for Similarities in Candlestick Charts

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM Transactions on Management Information Systems
          ACM Transactions on Management Information Systems  Volume 5, Issue 2
          July 2014
          82 pages
          ISSN:2158-656X
          EISSN:2158-6578
          DOI:10.1145/2659230
          Issue’s Table of Contents

          Copyright © 2014 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 July 2014
          • Accepted: 1 February 2014
          • Revised: 1 October 2013
          • Received: 1 March 2013
          Published in tmis Volume 5, Issue 2

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article
          • Research
          • Refereed

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader