Technical analysis of Stocks listed on NSE using Machine Learning Abhishek Rai, Manas Shukla, Ankur Chokhani, Kiran Gawande Department of Computer Engineering Sardar Patel Institute of Technology, Mumbai, India - 400058 Email: abhishek.rai@spit.ac.in, manas.shukla@spit.ac.in, ankur.chokhani@spit.ac.in, kiran gawande@spit.ac.in Abstract—The authors of this paper have proposed the technical analysis of various stock prices as listed on National Stock Exchange (NSE) of India. Various prediction models have been tried and built using different analytical techniques. The openly available historical stock data has been used and various models have been trained with it. Various parameters were explored, which affect the prediction models. This paper also tries to explore various machine learning techniques available and compares their results to understand which one is better and to what extent. In totality, the authors have analysed the stock prices of Tata Steel, Bank of Baroda and Tata Consultancy Services (TCS) using 4 different models, which are the Moving Average model, Linear Regression model, K-nearest neighbours (KNN) model, and the Long Short Term Memory (LSTM) model. The performances of these prediction models have been compared by calculating the Root Mean Square Error (RMSE) values of each model, which gives us an idea about how accurate are the predictions made by each model. Index Terms—Stock prediction, Machine Learning, Artificial Intelligence, Moving Average, Linear Regression, KNN, LSTM. I. I NTRODUCTION Stock market prediction has been a topic of great interest and research since a very long time, due to its ability of generating huge monetary profits in a much smaller period of time. The volume of trading that takes place throughout the globe daily indicates that this is a field of study that would be area of research for many more years to come. There have been numerous attempts to find different and better ways to predict the stock prices with higher accuracy. In general, there are broadly 3 ways through which we can analyse and predict the future stock values, that are - Fundamental, Sentimental and Technical Analysis. Fundamental Analysis refers to analyzing the fundamentals of a business in order to predict, primarily, the tangible estimates like revenue and earning potential. The factors considered while analysing a business fundamentally include studying the existing market scenario for the business, business model, competitors analysis, industry P/E ratio, scope of business expansion etc. It mainly deals with how viable a business will be, and the scope of being able to generate appropriate return on the investment being made. Fundamental Analysis helps an investor to understand whether it is a good idea to invest in a particular business or not in the long term, and also speaks about the pros and cons of the business, and the possible headwinds that the business might face in the future. Sentiment Analysis refers to gauging the latest trend about the business, its industry, and the continual reaction of the people to the business. Sentiment Analysis is majorly done by identifying words that can be classified as either positive, negative, or neutral. It will depict the general perception or outlook towards the business, giving weightage to the social aspect of the opinion about a business. Sentiment Analysis helps in analysing the short-term outlook of the business, and can be triggered by any adverse happening affecting the business, provided it attracts peoples attention. It can help gauge a business from a short-term as well as a long-term perspective. Technical Analysis refers to analysing the various charts of stock price movement in order to predict how the future stock price variation would be. There are different types of graphs that can be used in technical analysis, including chart patterns as well as statistical indicators. However, technical analysis is based entirely upon the historical data of the stock price, and does not factor in the external influences on the business, like the effects of market sentiment and fundamentals of the business. Technical analysis is mainly about identifying trends in the price movement, and the estimation of the trigger point for these trends to replicate themselves and also the intensity with which the trends shall be replicated. Trends can be both short term or long term. Technical Analysis is extensively used by traders, majorly the ones who trade in short-terms. The authors have chosen to do Technical analysis among these 3 techniques, so as to explore the features and parameters that affect the stock prices, which is possible by analysing the historical data that is openly available on the internet. The authors also wanted to understand how different machine learning tools and techniques can affect the accuracy of prediction, and thus help in obtaining better throughput for the stock market. II. I MPLEMENTATION This paper discussed the implementation of 4 different models to predict the stock prices, which are - Moving Average model, Linear Regression model, KNN model, and the LSTM model. The moving average model uses the Simple Moving Average (SMA) of a given window size to calculate the future stock price. The other 3 models are basically machine learning techniques/algorithms, that use the historical dataset to train the model and then predict