Research Paper SMP
Research Paper SMP
Shivam Singhal
SRM Institute of Science and Technology
Manthan Solanki
SRM Institute of Science and Technology
S. Sharanya
SRM Institute of Science and Technology
Abstract – The stock market has been a topic of great Machine Learning algorithms find its application in almos t all
deliberation due to its diverse and convoluted nature. the fields right from failure prediction in machines till
Today’s financial investors are plagued by sudden and forecasting economic growth [8]. This work deploys a hybrid
notable fluctuations in the market. They cannot easily model that integrates the prowess of Long Short Term
comprehend as to which stocks they should buy or sell in
order to get profitable outcomes. However, with rapi d Memory (LSTM) and ensemble model to forecast the trends
advancements in machine learning, stock market in stock market.
prediction has become plausible. This paper proposes a
stock price prediction system that utilizes an ensemble 1.2 Definitions
model coupled with a separate LSTM model to make
predictions. The ensemble model makes use of Random Relative Strength Index (RSI): It is a momentum oscillator
Forest (RF), K-Nearest Neighbors (KNN), and Gradient that measures the magnitude of recent price movements. It
Boosting (GB) classifiers to determine whether an oscillates between 0 and 100 and examines the overvalued
investor should buy or sell stocks on a particular day. A (above 70) or undervalued (below 30) conditions of the stock
separate LSTM model analyzes the historical stock data prices.
to predict the closing stock prices in the future. The
combined model assists the investors to make the buy/sell Moving Average Convergence Divergence (MACD):
call on a particular day with an approximation of the MACD [5] is a momentum oscillator that evaluates a trend in
closing prices for better and safer investments.
stock prices. It determines the relation between two trend-
Keywords: - stock market prediction, Random Forest, K- following indicators, the moving averages (MA), by
Nearest Neighbors, Gradient Boosting, ensemble model, subtracting the higher MA from the lower MA.
Long Short Term Memory.
Stochastic Oscillator (STOCH): It [9] is a momentum
I. INTRODUCTION oscillator that depicts the relative location of the closing price
of a stock to its range of prices over a specified period. It is
1.1. Background used to identify overbought and oversold trading signals.
Investing in the stock market has been a lucrative temptation Accumulation/Distribution Line (ADL): It is a cumulative
for both novice and expert investors alike for the past few volume-based indicator that assesses the money flow into and
decades. However, its dynamic and complex nature makes it out of a stock. It determines whether the market trend is
intricately perplexing for investors to make the right choice for inclined towards accumulation or distribution and measures
remunerative trading. Such a predicament divides the market the strength of a trend.
experts on the possibility of making calculated predictions for
the right investments at the right times. Some believe that as Average True Range (ATR): It is an indicator used for
per the efficient-market hypothesis theory, the stock market measuring the price volatility of commodities. It also
reacts by assimilating newly available information. Therefore, accounts for any gaps in the price movement.
it is not possible to make accurate predictions without Market Momentum (MOM): It is a market indicator that
possessing any prior future information of the stocks.
reflects the comparison between the current market price and
However, other analysts argue that even though movements the price ‘n’ periods ago.
might seem random, they actually are correlated, and several
statistical indicators can help establish a pattern. Based on Money Flow Index (MFI): It is a market indicator equivalent
historical stock market data, some trends can be discerned to a volume-weighted RSI. It examines overbought and
about the behaviour of stocks. This can be used to make close oversold trade signals on the basis of both magnitude and
to precise predictions. Accurate predictions using technology volume of prices.
provide investors with an opportunity to make steady financial
Rate of Change (ROC): It [5] is a simple momentum
gains. It also assists researchers in determining how different
oscillator that computes the percentage change in price from
statistical indicators together can be used to improve accuracy.
the current price to a price ‘n’ periods ago. The oscillator for the next set of outputs. Hence, it can handle long sequences
forms a graph that oscillates above (positive change) and of data better than other RNNs, which can store only a short
below (negative change) the zero-line. Overbought and series of data in memory. Thus, it is a much more suited neural
oversold zones can be adjusted as per the market conditions. network for the prediction of time-series data as compared to
others.
On Balance Flow (OBV): It is a momentum indicator that
predicts stock price changes based on the flow of volume. It II. LITERATURE SURVEY
measures the buying and selling pressure by summing
volume on up days and subtracting it on down days. Title Merits Demerits
Commodity Channel Index (CCI): It is a momentum Deep learning with Provides Requires more
oscillator that evaluates price trends and overvalued/ long short-term efficient subtle patterns
undervalued conditions. It computes the current price level memory networks predictions for of LSTM neural
relative to that of the historical average price level. for financial large-scale networks.
market predictions, financial
Ease of Movement (EMV): It [10] is an indicator that 2018 [1] markets.
quantifies the price-volume relationship to determine the ease
at which prices move upwards or downwards. Global stock Network Insufficient for
market investment indicators measuring
Vortex Indicator (VI): It is an indicator comprising of two strategies based on provide better latent factors in
oscillator lines – an uptrend (VI+) line to capture positive financial network results for complex
trends and a downtrend (VI-) line to capture negative trends. indicators using global markets. financial
It is used to examine continuations and changes in trends. machine learning markets.
techniques, 2019
Random Forest (RF): It [6] is an ensemble machine learning [2]
technique based on the bagging method. RF combines
Stock market For index The relative
multiple decision trees to provide the final output. The
index prediction predictions, the errors of high,
aggregated result of multiple uncorrelated decision trees using deep neural relative errors of low, and close
delivers more accurate results than the individual constituent network ensemble, high and low predictions are
trees. 2017 [3] are less than a higher when the
percent. market index
K-Nearest Neighbours (KNN): It is a supervised ML fluctuates
algorithm that classifies new data into different categories fiercely.
based on the similarity of available data. Thus, whenever new Predicting and At 85% At 90%
data arrives, it is placed into a category that is similar to itself. Beating the Stock confidence confidence
Market level, ML level, technical
Gradient Boosting (GBM): It is an ML boosting algorithm with Machine outperformed analysis
[7] that derives the result by ensembling multiple weak Learning and technical outperformed
learners to form a strong learner. With regression trees as the Technical analysis during ML during
weak learners, each subsequent tree in the series is built on Analysis, 2018 [4] up-market. down-market.
the residual errors of the predecessor trees thereby,
minimizing the loss function.
III. PROPOSED WORK
Voting classifier: It [3] [8] is a classification technique that
utilizes an ensemble of multiple classifiers. It makes The system proposed in this paper emphasises on using an
predictions based on their highest probability of the chosen ensemble model to make accurate predictions. While an
class as the output. The first type of voting is hard voting, individual algorithm-based model might have higher
where the output is simply the mode of individual predictions accuracy, however, an ensemble model boosts the overall
of the constituent classifiers of an ensemble. The other type of confidence and reliability of the system. The proposed system
voting is soft voting, where the class with the greatest sum of has the following characteristics:
weighted probabilities is delivered as the output.
A. Buy/sell decision for stocks
Long Short-Term Memory (LSTM): It [6] is a Recurrent
Neural Network (RNN) that showcases the ability to A combination of Random Forest classifier, K-Nearest
demarcate between recent and relatively older examples. Neighbours classifier, and Gradient Boosting classifier forms
LSTM assigns the former with higher weights and the latter an ensemble model [3] which predicts whether an investor
with lower weights while forgetting data that seem irrelevant should buy/sell stocks on a particular day.
B. Closing price prediction
IV. IMPLEMENTATION Fig 2. Data from ‘close’ Fig 3. Data from ‘close’
column before smoothing column after smoothing
4.1 Methodology
4.1.1. Data Processing and Feature Engineering
VI. CONCLUSION
[2] Lee, T ae & Cho, Joon & Kwon, Deuk & Sohn, So. (2018).
Global stock market investment strategies based on financial
network indicators using machine learning techniques. Expert
Systems with Applications. 117. 10.1016/j.eswa.2018.09.005.
[3] Yang, Bing & Gong, Zi-Jia & Yang, Wenqi. (2017). Stock
market index prediction using deep neural network ensemble.
3882-3887. 10.23919/ChiCC.2017.8027964.
[6] Pawar, Kriti & Jalem, Raj & T iwari, Vivek. (2019). Stock
Market Price Prediction Using LST M RNN: Proceedings of
ICET EAS 2018. 10.1007/978-981-13-2285-3_58.
[7] Momin, Faisal & Patel, Sunny & Shinde, Kuldeep & Sah ane,
Prof & Syed, Habeebullah Hussaini. (2020). Stock Market
Prediction System Using Machine Learning Approach . SSRN
Electronic Journal. 7. 190-194.
[10] Hu, Hongping & T ang, Li & Zhang, Shuhua & Wang, Haiyan.
(2018). Predicting the Direction of Stock Markets Using
Optimized Neural Networks with Google T rends.
Neurocomputing. 285. 10.1016/j.neucom.2018.01.038.
[11] Shastri, Malav & Roy, Sudipta & Mittal, Mamta. (2018). Stock
Price Prediction using Artificial Neural Model: An Application
of Big Data. ICST T ransactions on Scalable Information
Systems. 6. 156085. 10.4108/eai.19-12-2018.156085.
[12] Yu, Pengfei & Yan, Xuesong. (2020). Stock price prediction
based on deep neural networks. Neural Computing and
Applications. 32. 10.1007/s00521-019-04212-x.