Technical Indicator Based Stock Market Prediction using Recurrent Neural Network

The Indian stock market is highly volatile and complex by nature. However, notion of stock price predictability is typical, many researchers suggest that the Buy & Sell prices are predictable and investor can make above-average profits using Stock Technical Indicator (STIs).Most of the earlier prediction models predict individual stocks and the results are mostly influenced by company’s reputation, news, sentiments and other fundamental issues. In this work, architecture of project is given. As a part of prediction model the Recurrent Neural Network (RNN) Deep Learning Algorithm is used to predict future prices of Stocks Using Technical Indicators (STIs) and also buy sell signals are generated. The project will be carried on National Stock Exchange (NSE) Stocks of India.


INTRODUCTION
The analysis and prediction of stock market data has significant role in today's economy.The prediction models are based on various algorithms and can be categorized into linear models such as Auto-Regressive Integrated Moving Average (ARIMA) and non-linear models like Machine learning, Neural Network (NN) and Deep Learning.Numerous researchers have attempted to construct an efficient model for prediction of Stock market for the individual stocks and indices.The methods of stock price prediction and buy/sell signals, are generally classified into four categories • Fundamental Analysis (FA): uses news, profits and other economic factors for forecasting.
• Technical Analysis (TA): Utilizes technical indicators like Simple Moving Averages (MA), Moving Average Convergence Divergence (MACD), and Relative Strength Index (RSI) for generating Buy Sell Signals.• Hybrid Method: Uses combination of both of the above methods.
• Time series analysis: Uses analysis of time series data.Technical analysis is a good option for indices prediction.STIs are mathematical calculations based on the price.STIs does not depend on fundamentals of a business, like earnings, revenue, or profit margins.The TA is useful while predicting the future prices of stocks.The TA anticipates what is likely to happen to prices over time, while the Artificial intelligence give strength to such anticipations by improving accuracy.Relative Strength Index (RSI) is a momentum oscillator.The RSI indicators gives traders signals about bearish and bullish price moment and it is often plotted beneath the graph of an asset's price.A stock is considered overbought when the RSI is above 70% and oversold when it is below 30%.Formula for Relative Strength Index is

PROBLEM STATEMENT
The investors usually take the decisions of buying or selling the stock by evaluating a company's performance and other unexpected global, national & social events.Although, such events affect stock prices instantaneously in a negative or positive way, these effects are not permanent most of the time.So, it is not viable to predict the stock prices and trends on the basis of Fundamental Analysis.Investors usually "buy low, sell high" but this does not provide enough context to make proper investment decisions.Investor before investing in any stock, he needs to be know how the stock market behaves.Investing in a good stock but at a bad time can have negative results, while investment in a mediocre stock at the right time can generate profits for investor.Stock investors of today are facing this problem of trading as they do not properly understand as to which stocks to buy or which stocks to sell in order to get optimum profits.Also this research predict future prices Using Price Action Using Recurrent Neural Network (RNN) Algorithm

PROBLEM DEFINITION
The objective of our project is to develop a Artificial Intelligence System Using Technical indicators to predict Stock trends.There are various technical indicators like Simple Moving Averages(SMA), Moving Average Convergence Divergence (MACD), Relative Strength Index (RSI) are calculated on basis of closing price, opening price, High price, low price.We will use this technical indicators as input to generate buy sell signal.Our DI algorithms i.e.Recurrent Neural Network (RNN), will be used to predict future prices.Our System will give buy & sell decisions, trends of the Stock, Predicted future price.On this basis trader can take decision of buying and selling of stock.

OBJECTIVES
• The system must be able to load a list of stock prices.It must calculate the STI based on the historical data.It must also provide an instantaneous visualization of the market index.As a consequence, an automated system or model, to analyses the stock market and upcoming stock trends based on historical prices and STIs, is needed.• Prediction system will be implemented Using one using Support Vector Machines and other using Recurrent Neural Network (RNN).

SUGGESTED SYSTEM ARCHITECTURE
We are proposing new model for the Stock Market Prediction.Our system will consists of different modules working together to achieve robust and more accurate system than its previous system.The stock data is captured through Yahoo APIs.The values of Stock i.e., Date, Time, stock-name, Volume, Open, High, Low and Close (OHLC) prices are extracted from the dataset.A new input features, which are known as STIs are calculated by applying stock prices and will be used to generate buy/Sell signals.Recurrent Neural Network (RNN), will be used to predict future prices.The Output to the system will be Buy/Sell Signal, Predicted future price The purpose of RNN is to process sequence data.In the traditional neural network model, from the input layer to the hidden layer to the output layer, the layers are fully connected, and the nodes between each layer are not connected.But this kind of ordinary neural network is powerless for many problems.The reason why RNN is called recurrent neural network means that the current output of a sequence is also related to the previous output.The specific form of expression is that the network will memorize the previous information and apply it to the calculation of the current output, that is, the nodes between the hidden layers are no longer unconnected but connected, and the input of the hidden layer not only includes the output of the input layer It also includes the output of the hidden layer at the previous moment.In theory, RNN can process sequence data of any length.

2 .
LITERATURE REVIEW:STIs are mathematical calculations based on the price, volume.These does not depend on fundamentals of a business, like earnings, revenue, or profit margins.The stock traders and technical analysts use STI's to analyze stock movements and to identify entry and exit points.Technical indicators can be useful while predicting the Buy & Sell decisions of stocks, trends of stock.M. Nabipour[1] Collected 10 years historical data of stocks.The value predictions are created for 1, 2, 5, 10, 15, 20, 25 and 30 days in advance.Many machine learning algorithms were utilized for prediction of future values of stock market groups.He used decision tree, artificial neural networks (ANN), recurrent neural network (RNN).Technical indicators were selected as the inputs for each of the prediction models.Can Yang[2] used a deep learning algorithm to predict price movement direction based on historical information in financial time series.The framework is combination a convolutional neural network (CNN) for feature extraction with a long short-term memory (LSTM) network for prediction.Manish Agrawal[3] predicted the prices of stocks by Using Stock Technical Indicators (STIs) which in turn helps to take buy-sell decision.Two different models are made, one for future price trend prediction of stocks and other for taking buy-sell decision for that day.As a part of prediction model the optimized Long Short Term Memory model is merged with highly correlated STIs.Dongdong Lv[4], analysed large-scale stock datasets He used two datasets of 424 S&P 500 index component stocks (SPICS) and 185 CSI 300 index component stocks (CSICS) from 2011 to 2017 and compare six machine learning algorithms and six deep neural network (DNN) models on these two datasets, respectively.Hyun Sik Sim[5] developed a stock price prediction model using convolutional neural network (CNN) to validate the applicability of new learning methods in stock markets.When using CNN, technical indicators were used as predictors of the forecasting model, and the technical indicators were converted to images of the time series graph.Mojtaba Nabipour[6] compared eight machine learning models (Decision Tree, Random Forest, Adaptive Boosting (Adaboost), eXtreme Gradient Boosting (XGBoost), Support Vector Classifier (SVC), Naïve Bayes, K-Nearest Neighbors (KNN) and Artificial Neural Network (ANN) and two deep learning models (Recurrent Neural Network (RNN) and Long short-term memory (LSTM).Technical indicators from five years of historical data are our input values, and two ways are supposed for employing them.He, calculated the indicators by stock trading values as continues data, and secondly converting indicators to binary data before using.The evaluation results indicate the continues data, LSTM and RNN perform better than other prediction models with a considerable difference.
Details of TechnicalIndicators • Moving Average (MA) Moving Average (MA) are average values for a given time frame and they reflect mood of market.It's a simple average of the past closing.eg.50 day SMA is nothing but average of previous 50 days closing prices.Formula for Moving Average is Cn = Closing price of a stock at period n. n = Number of total periods.• Moving Average Convergence Divergence (MACD) Moving Average Convergence Divergence (MACD) is a trading indicator used in technical analysis.It is called as Trend indicator.MACD indicator has 3 components in it.MACD Line is blue line in the MACD indicators.It is calculation result of subtracting 26-period EMA from 12-Period EMA.Signal Line is the Red line which is plotted on the top of the MACD line.It is basically 9-Period EMA of the MACD line When MACD line crosses the signal line in upward direction it triggers a Buy signal When MACD line crossing the signal line in downward direction triggers a SELL Signal..Histogram are vertical lines/bars.Formula for Moving Average Convergence Divergence is 12 Period EMA − 26 Period EMA • Relative Strength Index (RSI)

Fig. 1
Fig.1 System Architecture of Stock Price Prediction Fig.2 SMA for Bank of Baroda

Fig. 5
Fig.5 Prediction for Bank of Baroda from 2014 Year

Fig. 6
Fig.6 Buy/Sell Signals for Bank of Baroda

Fig. 11
Fig.11 Prediction for ITC from 2020 Year

Table 1 : Stock Technical Indicators
STIs are Mathematical calculations based on the price, volume.STIs does not depend on fundamentals of a business, like earnings, revenue, or profit margins.The stock traders commonly use STIs to analyze short-term and long term price movements and to identify entry and exit points.Technical indicators are useful while predicting the Buy/Sell Signals of stocks.There are two types of technical indicators: Oscillators and Overlays.In this work, we use SMA STI as it is one among the most widely used STI.It removes out the noise which occurs due to random price variations and helps to smooth out price.It is a trend following indicator or simply lagging as it depends on past prices.Formulae for calculating the Stock Technical Indicators (STIs) is presented in Table1.