Time Series Representation for Elliott Wave Identification in Stock Market Analysis Chaliaw Phetking Faculty of Science and Technology Suan Dusit Rajabhat University Bangkok, Thailand +662-244-5600 chaliaw_phe@dusit.ac.th Mohd Noor Md. Sap Faculty of Comp. Sci. and Info. Sys. Universiti Teknologi Malaysia Johor, Malaysia +607-553-2419 mohdnoor@fsksm.utm.my Ali Selamat Faculty of Comp. Sci. and Info. Sys. Universiti Teknologi Malaysia Johor, Malaysia +607-553-2638 aselamat@fsksm.utm.my ABSTRACT Elliott waves are considered as the crowded psychological effect. In stock market time series, there are several Elliott waves and in different resolution. To identify existing Elliott wave in time series, a dimensional reduction technique is determined. Unfortunately, existing financial time series reduction methods usually produce the distorted wave-like shape time series which is difficult to identify Elliott waves. In this study, we propose the method of financial time series reduction for Elliott Wave identification based on perceptually important points identification method. These collected points are used to produce a wave-like time series by using point-importance order of wavelike shape preservation. The method is tested in Elliott Wave identification in real time series. Categories and Subject Descriptors Time series analysis. General Terms Algorithms, Economics. Keywords Financial time series representation, Pattern matching, Elliott Wave Theory, Fibonacci number. 1. INTRODUCTION Technical analysis is an attempt to predict the future prices of securities based on historical prices and volumes rather than underlying company fundamentals, political events, and economic factors. Technical analysts believe in chart analysis to looking for some significant information for predicting the next price movement. Several chart analysis techniques are considered as analysis tools. There are three main popular charting techniques: bar charts, point-and-figure charts, and candlestick charts[1]. All of them have been focused on attempting to recognize important patterns. At the very least, chart pattern recognition is a subjective method open to different interpretations by different individuals based on their experience. Many researchers have been focusing their works on technical analysis by automatically applying several distinguish pattern recognition approaches to improve the investment return. Many approaches are applied to automatically recognize the stock chart patterns include; genetic algorithm [2][3], fuzzy logic [4], neural network[5]. Various supported theories are implemented including Dow theory and Elliott Wave theory. Elliott wave theory is widely implemented in various technical analysis approaches[6][7][8]. Unfortunately, Elliott wave identification is a very difficult task and usually depending on analyst experiences. Further, stock time series always demonstrates its movement in a fluctuant way due to some important factors or events. These give the hard problem of identification of existing Elliott wave. However, with the time series dimensionality reduction technique, it is available to identify the existing of Elliott wave. By considering the time series dimensionality reduction techniques, many researchers propose various advantage techniques. The work done by Agrawal et al.(1993)[9] utilizes the Discrete Fourier Transform(DFT) to reduce the time series dimensions. However, other techniques are suggested including Singular Value Decomposition (SVD) [10] and the Discrete Wavelet Transform (DWT)[11]. Keogh et al.[12] introduce a novel transforming technique for time series dimensionality reduction call Piecewise Aggregate Approximation (PAA). This technique approximates the dimensions by segmenting the sequences into equi-length sections and recording the mean value of these sections. The extended versions of PAA can be found by the works of [13] so-called symbolic aggregate approximation (SAX), and Extended SAX by [14 ]. Important points are also determined in dimensionality reduction techniques. Based on identifying the perceptually importance points (PIPs)[15], Fu et al.[16] proposed SB-Tree representation to perform financial time series dimensionality reduction. Fink and Pratt[17] collects the important points in time series by considering some of its minima and maxima and discards the other points. Among the minima and maxima important points collecting, Bao[18] interests in local minimal and maximal points and considers them as the turning points. In this research, we propose the method of time series dimensionality reduction for Elliott wave identification in stock market time series. We also improve the technique of Elliott wave pattern matching. This paper is organized as follows. Section 2 describes the principle of Elliott wave and time series dimensionality reduction methods. Section 3 describes the proposed method of time series dimensionality reduction. Section 4 the experimental results are presented. Finally, section 5 concludes the paper and outlines some direction for future works.
2. RELATED WORKS In this section, the reviews of existing works and related theories are described. 2.1 Elliott Wave Principle The Elliott Wave Theory is introduced by Ralph Nelson Elliott[19] which is inspired by the Dow Theory[20] and by observations found throughout nature. Elliott concluded that the movement of the stock market could be predicted by observing and identifying a repetitive pattern of waves. In fact, Elliott believed that all of man's activities, not just the stock market, were influenced by these identifiable series of waves. Elliott based part his work on the Dow Theory, which also defines price movement in terms of waves, but Elliott discovered the fractal nature of market action. Thus Elliott was able to analyze markets in greater depth, identifying the specific characteristics of wave patterns and making detailed market predictions based on the patterns he had identified. The Elliott Wave Theory describes the stock market s behavior as a series of waves up and another series of waves down to complete a market cycle. Those cycles are grouped into eight waves, with five of those following the main trend, and three being corrective trends. After the eight moves are made, the cycle is complete. The graphical view of Elliott Wave is depicted in figure 1. Figure 1. Elliott wave cycle Elliott Wave Theory interprets market actions in terms of recurrent price structures. Basically, Market cycles are composed of two major types of Wave : Impulse Wave and Corrective Wave For every impulse wave, it can be sub-divided into 5 wave structure (1-2-3-4-5), while for corrective wave, it can be subdivided into 3 wave structures (a-b-c). The whole theory of Elliott Wave can be classified into two parts: impulse patterns and corrective patterns. 2.1.1 Impulse patterns The impulse pattern consists of five waves. The five waves can be in either direction, up or down. As can be seen in figure 1, the first wave is usually a weak rally with only a small percentage of the traders participating. Once Wave 1 is over, they sell the market on Wave 2. The sell-off in Wave 2 is very vicious. Wave 2 will finally end without making new lows and the market will start to turn around for another rally. The initial stages of the Wave 3 rally are slow, and it finally makes it to the top of the previous rally (the top of Wave 1). At this time, there are a lot of stops above the top of Wave 1. Traders are not convinced of the upward trend and are using this rally to add more shorts. For their analysis to be correct, the market should not take the top of the previous rally. Therefore, many stops are placed above the top of Wave 1. The Wave 3 rally picks up steam and takes the top of Wave 1. As soon as the Wave 1 high is exceeded, the stops are taken out. Depending on the number of stops, gaps are left open. Gaps are a good indication of a Wave 3 in progress. After taking the stops out, the Wave 3 rally has caught the attention of traders. The next sequence of events are as follows: Traders who were initially long from the bottom finally have something to cheer about. They might even decide to add positions. The traders who were stopped out (after being upset for a while) decide the trend is up, and they decide to buy into the rally. All this sudden interest fuels the Wave 3 rally. This is the time when the majority of the traders have decided that the trend is up. Finally, all the buying frenzy dies down; Wave 3 comes to a halt. Profit taking now begins to set in. Traders who were long from the lows decide to take profits. They have a good trade and start to protect profits. This causes a pullback in the prices that is called Wave 4. Wave 2 was a vicious sell-off; Wave 4 is an orderly profit-taking decline. While profit-taking is in progress, the majority of traders are still convinced the trend is up. They were either late in getting in on this rally, or they have been on the sideline. They consider this profit-taking decline an excellent place to buy in and get even. On the end of Wave 4, more buying sets in and the prices start to rally again. The Wave 5 rally lacks the huge enthusiasm and strength found in the Wave 3 rally. The Wave 5 advance is caused by a small group of traders. Although the prices make a new high above the top of Wave 3, the rate of power, or strength, inside the Wave 5 advance is very small when compared to the Wave 3 advance. Finally, when this lackluster buying interest dies out, the market tops out and enters a new phase. 2.1.2 Corrective patterns Corrections are very hard to master. Most Elliott traders make money during an impulse pattern and then lose it back during the corrective phase. An impulse pattern consists of five waves. With the exception of the triangle, corrective patterns consist of 3 waves. An impulse pattern is always followed by a corrective pattern. Corrective patterns can be grouped into two different categories: simple correction (zigzag) and complex corrections (flat, irregular, triangle). Simple Correction (Zigzag). There is only one pattern in a simple correction. This pattern is called a Zigzag correction. A Zigzag correction is a three-wave pattern where the Wave B does not retrace more than 75 percent of Wave A. Wave C will make new lows below the end of Wave A. The Wave A of a zigzag correction always has a five-wave pattern. In the other two types of corrections (Flat and Irregular), Wave A has a three-wave pattern. Thus, if you can identify a five-wave pattern inside Wave A of any correction, you can then expect the correction to turn out as a zigzag formation. Complex Corrections (Flat, Irregular, Triangle). In a Flat correction, the length of each wave is identical. After a five-wave impulse pattern, the market drops in Wave A. It then rallies in a Wave B to the previous high. Finally, the market drops one last time in Wave C to the previous Wave A low. Irregular Correction. In this type of correction, Wave B makes a new high. The final Wave C may drop to the beginning of Wave A, or below it. Triangle Correction In addition to the three-wave correction patterns, there is another pattern that appears time and time again. It is called the Triangle pattern. Unlike other triangle studies, the Elliott Wave Triangle approach designates five sub-waves of a triangle as A, B, C, D and E in sequence. Triangles, by far, most commonly occur as fourth waves. One can sometimes see a
triangle as the Wave B of a three-wave correction. Triangles are very tricky and confusing. One must study the pattern very carefully prior to taking action. Prices tend to shoot out of the triangle formation in a swift thrust. When triangles occur in the fourth wave, the market thrusts out of the triangle in the same direction as Wave 3. When triangles occur in Wave Bs, the market thrusts out of the triangle in the same direction as the Wave A. 0.5 0.4 0.3 0.2 peak-peak connecting bottom-bottom connecting 3. THE PROPOSED MODEL Our model comprises of two parts; part 1, the time series dimensionality reduction, and the part 2, the identification of Elliott wave. 3.1 Time Series Dimensionality Reduction A stock market time series consists of several fluctuant price movements of up and down directions. These movements always form wave-like structure. However, most of minor fluctuated movements usually become noise in many analysis methods. Reducing the dimensions or minor fluctuated movements of stock market time series can provide a higher degree of analysis results. Due to Elliott wave analysis, the early identifying the forming of the waves is very important for traders to gain their profit taking. Modeling of stock market time series dimensionality reduction can be determined by reducing the minor fluctuated movements and retaining the major fluctuated movement. The major fluctuated movement points can be known as Perceptually Important Points(PIPs). Algorithm of identification of PIPs was first introduced by Chung et al. (2001)[15], and, with the similar idea, it is independently introduced by Douglas and Peucker (1973)[21]. Chung et al [15] describe the concept of data point importance as the influence of a data point on the shape of the time series. A data point that has a greater influence to the overall shape of the time series is considered as more important. The implementation of PIPs identification can be found in [15][16][22]. In a time series, PIPs identification is performed recursively until all points are considered. With the method introduced by Fu et al.(2007)[15], importance-ordered PIPs are used for constructing the SB-Tree data structure and dimensionality reduction can be done by accessing number of PIPs from the tree. Nevertheless, by considering number of PIPs, in some case, the reconstructed time series may be constructed in distorted-wave shape because of the connecting line between the bottom important points or between the peak important points. This is shown in figure 2. To eliminate these effects, we introduce the method of time series dimensionality reduction by considering pointimportance order of wave-like shape preservation(pwp). The PWP method is very important to preserve the reconstructed shape of time series in the wave-like form. The idea of PWP is come from the number of retrieved PIPs cannot preserve the wave-like shape of the dimension reduced time series 2. 0.1 0 0 50 100 150 200 250 300 350 400 450 Figure 2. Distorted-wave shape dimensionality reduction.. The algorithm of PWP can be sequentially presented as follow. (1) For the time series S ={s 1, s 2,, s m }, consider the first PIP on the first iteration including retrieval of the first and the last point of S. Let s p1 is the first PIP, thus the time series is divided into 2 segments; s 1 s p1 and s p1 s m,then PIPs are recorded into PIPList. (2) For each sub-segment from step 1, the next iteration of PIP retrieval is considered. When PIPs are retrieved from all sub-segments, at this point, the peak-to-peak connecting and bottom-to-bottom connecting are determined. (3) If the peak-to-peak connecting or bottom-to-bottom connecting exists, retrieval the next PIP of the segment is determined. Otherwise, remove PIPs which are the end points of the segment. Finally, all PIPs are recorded to the PIPList. (4) Follow step 1-4 until the threshold is reached. The threshold used for considering in step 4 is determined by the period of trading. If a stock trader trades once a week(5 business days) the threshold is set to be 5. The result from this algorithm is the list of PIPs series in different levels. 3.2 Identification of Elliott Waves To identify the existing of Elliott waves, the point-to-point matching is provided. This method matches the time series and the pattern templates. However, since the varieties of amplitude of waves and points distances the matching point-to-point directly is not proper. By the method of pattern based matching proposed by Fu et al.(2007)[22], the amplitude distance and temporal distance measures are applied in this research. Suppose P and Q are lists of points in the time series and templates, thus the amplitude distance can be determined as follow., (1)
Here, SP and sp k denote the PIPs found in P. However, the measure in Eq. (1) has not yet taken the horizontal scale (time dimension) into considerations. Therefore, it is preferred to consider the horizontal distortion of the pattern against the pattern templates. The temporal distance (TD) between P and Q is defined as:, (2) where and denote the time coordinate of the sequence points and, respectively. To take both horizontal and vertical distortion into consideration in the similarity measure, the distance (or similarity) measure could be modified as:,, 1, (3) where w 1 denotes the weighing among the AD and TD and can be specified by the users. In this paper w 1 =0.5 is applied[22]. 4. EXPERIMENTAL RESULTS 5. CONCLUSION 6. REFERENCES [1] Person, J.L., A complete guide to technical trading tactics : how to profit using pivot points, candlesticks & other indicators. 2004, Canada: John Wiley & Sons. [2] Baba, N., et al., Utilization of AI & GAs to Improve the Traditional Technical Analysis in the Financial Markets, in Knowledge-Based Intelligent Information and Engineering Systems. 2003. p. 1095-1099. [3] Badawy, F.A., H.Y. Abdelazim, and M.G. Darwish. Genetic Algorithms for Predicting the Egyptian Stock Market. in Information and Communications Technology, 2005. Enabling Technologies for the New Knowledge Society: ITI 3rd International Conference on. 2005. [4] Ming Dong, X.-S.Z., Exploring the fuzzy nature of technical patterns of US stock market.. Proc. ICONIP 02-SEAL 02- FSKD 02, 2002: p. 6. [5] J. T. Yao, C. L. Tan and H.-L. Poh, "Neural Networks for Technical Analysis: A Study on KLCI", International Journal of Theoretical and Applied Finance, Vol. 2, No.2, 1999, pp221-241. [6] Chen, T.-L., C.-H. Cheng, and H. Jong Teoh, Fuzzy timeseries based on Fibonacci sequence for stock price forecasting. Physica A: Statistical Mechanics and its Applications, 2007. 380: p. 377-390. [7] Kirkpatrick, C.D., Dahlquist, J.R., Technical analysis. 2007: Financial times press. [8] Frost and R.R. Prechter, Elliott Wave Principle: Key to Stock Market Profits. 1985: New Classics Library. [9] R. Agrawal, C. Faloutsos, and A. Swami: Efficient Similarity Search in Sequence Databases, Proc. Int l Conf. Foundations of Data Organiz ations and Algorithms, pp. 69-84, Oct, 1993. [10] Korn, F., Jagadish, H & Faloutsos. C.: Efficiently supporting ad hoc queries in large datasets of time sequences. Proc. of SIGMOD 97, Tucson, AZ, pp 289-300, 1997. [11] Chan, K.& Fu, W.: Efficient time series matching by wavelets. Proc. of the 15th IEEE International Conference on Data Engineering, 1999. [12] Keogh, E., Chakrabarti, K., Pazzani, M., Mehrotra, S., 2000. Dimensionality reduction for fast similarity Search in large time series databases. Journal of Knowledge and Information Systems 3 (3), 263 286. [13] Lin J., Keogh E., Lonardi S., Chiu B. A Symbolic Representation of Time Series, with Implications for Streaming Algorithms. In proceedings of the 8th ACM SIGMOD Workshop on Research Issues in Data Mining and Knowledge Discovery. (2003). [14] Battuguldur Lkhagva, Yu Suzuki, Kyoji Kawagoe: New Time Series Data Representation ESAX for Financial Applications. ICDE Workshops 2006. [15] Chung, F-L., Fu, T-C., Luk, R., Ng, V. Flexible time series pattern matching based on perceptually important points. In: International Joint Conference on Artificial Intelligence Workshop on Learning from Temporal and Spatial Data, pp. 1 7. [16] Fu T-C., Chung F-L., Luk R. and Ng C-M., Representing financial time series based on data point importance., Engineering Applications of Artificial IntelligenceVolume 21, 2,March 2008, pp.277-300. [17] Fink, E., K.B. Pratt, and H.S. Gandhi. Indexing of time series by major minima and maxima. in Systems, Man and Cybernetics, 2003. IEEE International Conference on. 2003. [18] Bao D. A generalized model for financial time series representation and prediction. Applied Intelligence, DOI:10.1007/s10489-007-0104-9. [19] Elliott, R.N. 1938.
[20] Nelson,S. The A B C of stock speculation, 1902. Burlington, VT: Fraser Publishing Co., 1964 reprint. [21] Douglas, D., Peucker, T., 1973. Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. The Canadian Cartographer 10 (2), 112 122. [22] Fu, T.-C, Chung, F.-L., Luk R., Ng C.-M., Stock time series pattern matching: Template-based vs. rule-based approaches. Engineering Applications of Artificial Intelligence 20,2007, pp.347-364.