Stock Prediction by Searching for Similarities in Candlestick Charts

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).

[1]  Anthony J. T. Lee,et al.  Stock price movement prediction using representative prototypes of financial reports , 2011, ACM Trans. Manag. Inf. Syst..

[2]  Dirk Neumann,et al.  Automated news reading: Stock price prediction based on financial news using context-capturing features , 2013, Decis. Support Syst..

[3]  David E. Rapach,et al.  In-sample vs. out-of-sample tests of stock return predictability in the context of data mining , 2006 .

[4]  Chih-Hsien Hsia,et al.  Memory-Efficient Hardware Architecture of 2-D Dual-Mode Lifting-Based Discrete Wavelet Transform , 2013, IEEE Transactions on Circuits and Systems for Video Technology.

[5]  Dar-Ren Chen,et al.  Computer-aided diagnosis with textural features for breast lesions in sonograms , 2011, Comput. Medical Imaging Graph..

[6]  Ravi Sankar,et al.  Time Series Prediction Using Support Vector Machines: A Survey , 2009, IEEE Computational Intelligence Magazine.

[7]  Marwan Izzeldin,et al.  Forecasting Daily Stock Volatility: the Role of Intraday Information and Market Conditions , 2008 .

[8]  Ronald MacDonald,et al.  Towards the fundamentals of technical analysis: analysing the information content of high, low and close prices , 2002 .

[9]  Moonsoo Kang Probability of Information-Based Trading and the January Effect , 2010 .

[10]  T. Bollerslev,et al.  Generalized autoregressive conditional heteroskedasticity , 1986 .

[11]  Rama Chellappa,et al.  Multiresolution Gauss-Markov random field models for texture segmentation , 1997, IEEE Trans. Image Process..

[12]  B. LeBaron,et al.  Simple Technical Trading Rules and the Stochastic Properties of Stock Returns , 1992 .

[13]  Ben R. Marshall,et al.  Are candlestick technical trading strategies profitable in the Japanese equity market? , 2008 .

[14]  Ricardo de A. Araújo,et al.  Hybrid intelligent methodology to design translation invariant morphological operators for Brazilian stock market prediction , 2010, Neural Networks.

[15]  J. Murphy Technical Analysis of the Futures Markets: A Comprehensive Guide to Trading Methods and Applications , 1986 .

[16]  Michael G. Madden,et al.  A neural network approach to predicting stock exchange movements using external factors , 2005, Knowl. Based Syst..

[17]  Jos B. T. M. Roerdink,et al.  Polyphase decompositions and shift-invariant discrete wavelet transforms in the frequency domain , 2010, Signal Process..

[18]  Alan Liu,et al.  Pattern discovery of fuzzy time series for financial prediction , 2006, IEEE Transactions on Knowledge and Data Engineering.

[19]  Yiannis Andreopoulos,et al.  Comments on "Phase-Shifting for Nonseparable 2-D Haar Wavelets" , 2009, IEEE Trans. Image Process..

[20]  Mohammad Hossein Fazel Zarandi,et al.  A new fuzzy functions model tuned by hybridizing imperialist competitive algorithm and simulated annealing. Application: Stock price prediction , 2013, Inf. Sci..

[21]  Gwénolé Quellec,et al.  Adaptive Nonseparable Wavelet Transform via Lifting and its Application to Content-Based Image Retrieval , 2010, IEEE Transactions on Image Processing.

[22]  Sung-Kwun Oh,et al.  Genetically optimized fuzzy polynomial neural networks , 2006, IEEE Transactions on Fuzzy Systems.

[23]  Yi-Fan Wang,et al.  Incorporating the Markov chain concept into fuzzy stochastic prediction of stock indexes , 2010, Appl. Soft Comput..

[24]  Marcel Worring,et al.  Content-Based Image Retrieval at the End of the Early Years , 2000, IEEE Trans. Pattern Anal. Mach. Intell..

[25]  Rasoul Rezvanian,et al.  Calendar anomalies in the Gulf Cooperation Council stock markets , 2011 .

[26]  Esmaeil Hadavandi,et al.  Hybridization of evolutionary Levenberg-Marquardt neural networks and data pre-processing for stock market prediction , 2012, Knowl. Based Syst..

[27]  Sofia C. Olhede,et al.  On the Analytic Wavelet Transform , 2007, IEEE Transactions on Information Theory.

[28]  Jui-Chung Hung A Fuzzy Asymmetric GARCH model applied to stock markets , 2009, Inf. Sci..

[29]  Xi Chen,et al.  Integrating piecewise linear representation and weighted support vector machine for stock trading signal prediction , 2013, Appl. Soft Comput..

[30]  Hsinchun Chen,et al.  Textual analysis of stock market prediction using breaking financial news: The AZFin text system , 2009, TOIS.

[31]  J. Murphy Technical Analysis of the Financial Markets , 1999 .

[32]  Shih-Fu Chang,et al.  Image Retrieval: Current Techniques, Promising Directions, and Open Issues , 1999, J. Vis. Commun. Image Represent..

[33]  R. Edwards,et al.  Technical Analysis of Stock Trends , 1966 .

[34]  E. Fama EFFICIENT CAPITAL MARKETS: A REVIEW OF THEORY AND EMPIRICAL WORK* , 1970 .

[35]  Guofu Zhou,et al.  Technical analysis: An asset allocation perspective on the use of moving averages , 2009 .

[36]  Chih-Fong Tsai,et al.  Combining multiple feature selection methods for stock prediction: Union, intersection, and multi-intersection approaches , 2010, Decis. Support Syst..

[37]  Lu Liu,et al.  Content-based image retrieval using color and texture fused features , 2011, Math. Comput. Model..

[38]  Wei-Chang Yeh,et al.  Forecasting stock markets using wavelet transforms and recurrent neural networks: An integrated system based on artificial bee colony algorithm , 2011, Appl. Soft Comput..

[39]  J. Doyle,et al.  The wandering weekday effect in major stock markets. , 2009 .

[40]  M. Parkin Macroeconomics 9th ed. , 2010 .

[41]  Prospero C. Naval,et al.  Stock trading system based on the multi-objective particle swarm optimization of technical indicators on end-of-day market data , 2011, Appl. Soft Comput..

[42]  Chung-Ming Kuan,et al.  Reexamining the Profitability of Technical Analysis with Data Snooping Checks , 2005 .

[43]  Manuel Graña,et al.  An endmember-based distance for content based hyperspectral image retrieval , 2012, Pattern Recognit..

[44]  Chih-Feng Liu,et al.  Application of type-2 neuro-fuzzy modeling in stock price prediction , 2012, Appl. Soft Comput..

[45]  Byung Ro Moon,et al.  A Hybrid Neurogenetic Approach for Stock Forecasting , 2007, IEEE Transactions on Neural Networks.

[46]  Chih-Ming Hsu,et al.  A hybrid procedure for stock price prediction by integrating self-organizing map and genetic programming , 2011, Expert Syst. Appl..

[47]  Shuenn-Ren Cheng,et al.  Multiple-instance content-based image retrieval employing isometric embedded similarity measure , 2009, Pattern Recognit..

[48]  Philip Hans Franses,et al.  Common socio-economic cycle periods , 2012 .

[49]  Joseph Yagil,et al.  The week-of-the-year effect: Evidence from around the globe , 2012 .

[50]  G. Caginalp,et al.  The Predictive Power of Price Patterns , 1998 .

[51]  P. Hansen,et al.  A Forecast Comparison of Volatility Models: Does Anything Beat a Garch(1,1)? , 2004 .

[52]  P. Weller,et al.  Price Trends and Patterns in Technical Analysis: A Theoretical and Empirical Examination , 2009 .

[53]  R. Engle Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inflation , 1982 .

[54]  Luis Garcia-Feijoo,et al.  Candlestick Technical Trading Strategies: Can They Create Value for Investors? , 2007 .

[55]  Kyungjik Lee,et al.  Expert system for predicting stock market timing using a candlestick chart , 1999 .

[56]  P. Chang,et al.  Methodical Madness: Technical Analysis and the Irrationality of Exchange-rate Forecasts , 1999 .

[57]  Peijia Zheng,et al.  Discrete Wavelet Transform and Data Expansion Reduction in Homomorphic Encrypted Domain , 2013, IEEE Transactions on Image Processing.

[58]  Theodosios Pavlidis,et al.  Segmentation by Texture Using Correlation , 1983, IEEE Transactions on Pattern Analysis and Machine Intelligence.

[59]  Gregory W. Corder,et al.  Nonparametric Statistics for Non-Statisticians: A Step-by-Step Approach , 2009 .

[60]  Guoqiang Peter Zhang,et al.  Trend Time–Series Modeling and Forecasting With Neural Networks , 2008, IEEE Transactions on Neural Networks.

[61]  Jun Wang,et al.  Fluctuation prediction of stock market index by Legendre neural network with random time strength function , 2012, Neurocomputing.

[62]  Dong-Chen He,et al.  Texture Unit, Texture Spectrum And Texture Analysis , 1989, 12th Canadian Symposium on Remote Sensing Geoscience and Remote Sensing Symposium,.

[63]  Tiago Alessandro Espínola Ferreira,et al.  A Morphological-Rank-Linear evolutionary method for stock market prediction , 2013, Inf. Sci..

[64]  Shlomo Zilca,et al.  The evolution of the January effect , 2008 .

[65]  Yuchou Chang,et al.  CBIR of spine X-ray images on inter-vertebral disc space and shape profiles using feature ranking and voting consensus , 2009, Data Knowl. Eng..

[66]  Chih-Hsien Hsia,et al.  Improved Low-Complexity Algorithm for 2-D Integer Lifting-Based Discrete Wavelet Transform Using Symmetric Mask-Based Scheme , 2009, IEEE Transactions on Circuits and Systems for Video Technology.

[67]  Russell L. Purvis,et al.  Stock market trading rule discovery using technical charting heuristics , 2002, Expert Syst. Appl..

[68]  Jonas Gloeckner,et al.  Candlestick Charting Explained Timeless Techniques For Trading Stocks And Futures , 2016 .

[69]  Christian Klein,et al.  Performance of Candlestick Analysis on Intraday Futures Data , 2005 .

[70]  Hyunjung Shin,et al.  Stock price prediction based on a complex interrelation network of economic factors , 2013, Eng. Appl. Artif. Intell..

[71]  Ching-Hsue Cheng,et al.  A hybrid model based on rough sets theory and genetic algorithms for stock price forecasting , 2010, Inf. Sci..

[72]  Samuel W. K. Chan,et al.  A text-based decision support system for financial sequence prediction , 2011, Decis. Support Syst..