Paper Title
Predicting Stock Market Using Pattern Analysis and Machine Learning Algorithms

Abstract
The Stock market is a promising area for short-term and long-term investments. The area that has attracted a great deal of attention during the past few decades, especially after several market crashes, is the stock market prediction, which is used to determine stock prices in near future. Stock prices are dependent on several factors including market news, stock value, and the rate of demand and supply. Collecting and analyzing all these affecting factors to predict the future trend of the market is very difficult. However, by analyzing market price fluctuations, we can achieve valuable insight regarding future trends. At first glance, the stock market fluctuations seem to be chaotic and unpredictable. Yet, with a closer look over a long-term period, we can find repeatable patterns because price fluctuations are the reaction of the market participants to outside factors. Experience has shown that the behavior of a crowd in certain situations is repeated and traders whether human or algorithmic traders tend to use almost the same strategy in certain conditions. The main idea of this research work is to define and isolate repeatable patterns first and then learn from the repetition of those patterns in order to predict future trends. For the first part of the research, a famous trend analysis algorithm, Elliot Wave Theory (EWT), is used to issue appropriate HOLD, SHORT, and LONG signals. HOLD is used for not trading, LONG for purchasing, and SHORT for selling. In fact, data is classified and labeled into three categories depending on the result of the EWT analysis. The EWT reflects the natural rhythm of the crowd in terms of optimism and pessimism. A complete EWT pattern is composed of two sub waves, impulsive and corrective. The impulsive wave has five subwaves that are in line with the main trend of the market and are reflective of optimism among market participants. The corrective wave has three subwaves that move against the direction of the main trend and are reflective of pessimism among market participants. After isolating the patterns, classification learning algorithms such as Decision Tree, Naïve Bayes, and Support Vector Machine (SVM) are used to learn from the repetition of the patterns. The American Stock Market daily data for DJIA, S&P500, and NASDAQ is downloaded from the CRSP (Center for Research in Security Prices) database located at the University of Chicago. The DJIA daily data is from 1/29/1985 through 5/4/2018. The data between the dates 1/29/1985 and 12/31/2007 is used for training and the rest is used for testing. The S&P500 daily data is from 1/3/1950 through 5/4/2018. The data between the dates 1/3/1950 and 12/31/2007 is used for training and the rest is used for testing. The NASDAQ daily data is from 10/11/1984 through 5/4/2018. The data between the dates 10/11/1984 and 12/31/2007 is used for training and the rest is used for testing. This time period is chosen to analyze market price fluctuations during various market crises. In the next phase, the results of the predictions are assessed by classification performance measures including accuracy, precision, recall, and F-score. In addition to that, the amount of profit and loss which result from the algorithm will be calculated. Finally, the algorithm will be implemented on the test data to investigate its performance during the market crash of May 2010 and August 2015. In this research work, a new method for predicting stock price fluctuations using pattern analysis and machine learning algorithms is proposed. The Elliot Wave Theory (EWT) as a famous pattern analysis technique is used to classify price patterns into three classes. After this step, boxes of price trends are formed. In the next step, the boxes are trained to machine learning algorithms such as decision tree, Naïve Bayes, and Support Vector Machine (SVM) to learn and predict stock prices for one day ahead. The result of the research has shown that tracing repeatable patterns can help us better predict future trends, especially those lead to market crashes. Index Terms - Classification, Machine Learning Algorithms, Stock Market Prediction