Paper 6
Paper 6
Abstract— For last few years, there has been significant stock and company. The trader needs to analyze the data
research on application of AI/ML algorithms in stock andpattern to reap maximum returns.
prediction and stock market. Prediction in stock market is There are primarily three ways to analyze a stock and its
challenging as it is affected by various factors related to data. The trader can use either of these three ways or
global markets, domestic markets, company related and
combine them before executing the trade.
overall sentiments of people. Stock market prediction can be
done based on three aspects that is fundamental analysis,
technical analysis, and sentimental analysis. In this paper, we 1. Fundamental Analysis:
have reviewed various AI/ML algorithms that can be used in
predicting stock markets. We have covered all the three Fundamental analysis is about analysing the
aspects of prediction and AI/ML algorithms applied in economic reports like balance sheet, profit and loss
eachone of them. After reviewing some research papers, we
report and cash flow report of the company and deriving
have implemented a model which has given us 85% accuracy,
we have achieved 10.28% return from our model portfolio, financial ratios from these reports. Then we need to look
in last three months and 175% return in last one year. at historical financial performances and ratios of the
company before investing in it. We also need to do
Keywords—Stock Prediction, Artificial Intelligence, management and promoter analysis. Value investing and
MachineLearning, Technical Analysis, Fundamental Analysis,
growth investing are two types of strategies used in
Sentimental Analysis
important investigation.
2. Technical Analysis:
INTRODUCTION In technical analysis, we try to predict future price
Purchasing and selling shares of corporations movement based on past price movements. We need
with public markets is known as stock trading. It is the understanding of important price levels, chart patterns
fundamental idea at the centre of every financial and and indicators. Data about price and volume plays
commercial activity. With the establishment of joint stock important rolein technical analysis.
corporations in Europe, stock trading was born and played
a crucial part in European imperialism. 3. Sentimental Analysis:
In India, the first stock exchange was established in 1875
known as Bombay Stock Exchange. It was also the first In sentimental analysis, we try to take
stock exchange in Asia. India has two main exchanges advantage of market sentiments driven by news,
namely Bombay Stock Exchange (BSE) and National economic factors, or emotions. To analyse sentiments,
Stock Exchange (NSE). we must take help of social media platforms, news,
websites, prominent investors,and companies.
A. Understanding the mindset of trader/investor
While taking a position in the stock market, a trader
must have information and knowledge about that
978-1-6654-9414-4/23/$31.00 ©2023 IEEE
Authorized licensed use limited to: SIDDAGANGA INSTITUTE OF TECHNOLOGY. Downloaded on September 13,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
Algorithm Datasets Inference Accuracy Limitations
Convolutional Korean News Word vectors created 0.3034 Nature of Korean Language reduce
neural Articles and from this neural correlation accuracy
networks Stock Data network, allow value
sentimental analysis, in
different languages
Naïve Bayes Twitter and Stock volume is 0.59 Despite a company's high closing
news correlated with trading accuracy prices, investing in it would not be a
headlines volume, mood indicators score with wise move given its sentence score.
are correlated with Microsoft
extraordinary returns.
Sentiment A news The news-poor stocks 0.38 with The selection approach based on
feature vector archive from can use new-rich stock Yahoo sector categorization is insufficient
analysis FINET2 data stocks because commerce contains a
variety of enterprises, even though
they are all part of the same sector.
Table 1. Comparison of AI/ML algorithms on sentimental analysis
B. Role of AI/ML in stock trading and investing 2. To understand and determine the factors and data
thataffect the stock market index and sectors.
In past few years, stock prediction using AI/ML
algorithms have got lot of popularity. We can apply AI/ML 3. To understand various machine learning algorithms
algorithms in all the three aspects of prediction i.e. used for sentimental analysis for stock market news.
Fundamental, technical, and sentimental analysis.
Researchers have said no to the theory of random walk and 4. To analyse literature on AI/ML on stock prediction.
agreed that historical data do tend to take importance while
predicting stock price. They also concur that mood alsotends II. LITERATURE REVIEW
to play a part in deciding stock price during evaluation[6].
A. Sentimental Analysis
The stock market behaves as a highly complicated non- A text analysis approach called sentiment analysis,
parametric dynamic system and is non-linear in nature. It is commonly referred to as opinion mining, finds polarity
influenced by many factors like interest rates, foreign (such as a positive or negative view) in stock news,
exchange, politics, policies, psychology, economy, etc. [6]. twitter feeds, and popular websites.
The Indian stock market is influenced by RBI policies,
company related factors, political events, investor’s Understanding people's emotions is crucial for investors
expectations, global markets etc. [4]. since, in the age of social media, everyone who invests
The big data strategy, which tries to gain insights from a expresses themselves more honestly than ever before.
substantial amount of publicly available data and analyses this Brokers and applications can listen carefully to investor
data on platforms like Hadoop, is one method for forecasting input and customise suggestions and services to suit
stock values [3]. Performing calculations based on neural their needs by automatically assessing investor
networks is the fundamental idea behind the deep learning feedback, such as comments in survey replies and social
approach [4]. Long-term dependencies are a challenge, media chats.
however the Long Short-Term Memory (LSTM) [5] kind of Previous studies have shown the need for personalized
Recurrent Neural Network (RNN) is employed to solve this sentiment dictionary. Students from School of Electrical
issue. Analyzing the sentiments on social media data [6] or Engineering at Korea University [1] employed deep
news stories that assist in understanding the general trend that learning techniques such Convolutional Neural
a particular company's or sectors' shares may take based on a Networks (CNN) and Long Short-Term Memory, as
collective view is another technique to forecast stock prices. well as word tagging done by hand and positive indexing
Since the value of a stock is sometimes viewed as a time series (LSTM) [2]. The model was created on the correlation
model, time series analysis [7] is another well-liked method of the positive index and the reoccurrence worth of the
for predicting stock values. stock the next day. Since this was only for a Korean
In this research paper, we have discussed and Stock news, we will be creating our own sentiment
compared different AI/ML algorithms to predict stock dictionary for Indian news.
price movement based on fundamental, technical, and
sentimentalanalysis. We can also use Artificial Neural Networks for
sentiment analysis [8]. Data for the study was gathered
C. Objectives of study from stock-specific websites like Stock Twits.
Sentiment analysis was done on every tweet that was
1. To determine various machine learning algorithms that taken from TweePy. The market information came from
arecurrently used to predict stock market movement and Yahoo. The neural network was trained on thisdata to
price. predict a closing price, but this was also correlated with
Authorized licensed use limited to: SIDDAGANGA INSTITUTE OF TECHNOLOGY. Downloaded on September 13,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
the sentence score of the stock in question [16], to predict Company Analysis was also done using indicators such as
if the price might go down. The training of this network extra pay-outs ratio, P/E ratio, Debt-Equity ratio. She studied
was by the Levenberg-Marquardt algorithm finds error the intrinsic value with market value and analyzed through
using mean square error. The log sigmoid [8] function this company whether stocks of a company were
was used as the activation function for theneural network. undervalued or overvalued.
Although for this project, the dataset was only used for 5 Joseph D Piotroski et. al. [14] evaluated whether a
important companies and not all sectors. Now since we basic accounting-based approach could provide significant
are including all sectors, we willalso be including news- returns when used on a single firm. He demonstrates how the
poor stocks [9]. Stocks such as MRF tires and Ramco market's incapacity to perceive these predictable patterns
cements that do not have much movement in stocks. For contrasts with strategy's ability to forecast future corporate
this we will use the stocks of news-rich in sector to make performance. This study provides new information about the
our model substitute it for the news- poor stocks. Stocks profits made by small, financially struggling businesses and
such as Apollo tires and Shree cements can help with the the relationship between those profits and past performance.
sentiment analysis for the news poor stocks. This is
possible The words in news stories, for instance, are Yuxuan Huang et. al. [15] compared artificial neural
searched up in the emotion dictionary and associated with networks for stock prediction utilizing fundamental financial
other sentimental dimensions if they contain any affective ratios in comparative research that was presented. The goal of
elements with the aid of sentimental transfer learning [9]. the study was to compare the relative returns of the chosen
Each word can be represented by an emotion feature portfolios to each architecture's performance while also
vector of the same length because the sentimental taking the benchmark stock index into account. The findings
dimensions are predetermined in the dictionary. demonstrate that one can sample winners and losers from a
sample universe of stocks separately.
B. Fundamental Analysis
Investors are compelled to heavily rely on basic
aspects in their investing decisions due to the significant
They help in forecasting future stock prices while feature of capital market instruments. The goal of
combining various factors such as industry, economic and fundamental research is to identify and evaluate the variables
company’s value to help gain insights about the intrinsic that affect the price of securities and various indicators and
value of the company. parameters needs to be taken into consideration while
conducting fundamental analysis.
The study of fundamental elements includes
looking at everything that can have an impact on a C. Technical Analysis
security's stock price, from macroeconomic factors like the In this type of analysis, Indicators and historical data
nation's economy and market conditions to play an important part. Predictions are typically solely backed
microeconomic factors like the efficiency of the by probability based on past trends and data [3]. Data
company's management. A lot of information on the past comprises details regarding the stock's opening price, closing
performance and anticipated future performance of price, high, and low points for a certain time period. Along
businesses, industries, and the economy as a whole must with that we also look at volatility and volume of the stock.
be evaluated by an investor before making an investment With help of different ML algorithms (Regression,
decision if they want to be objective and scientific. classification), Deep learning algorithm we can derive
various information. Out of all parameters, date and closing
The impact of fundamental analysis using price are most important. Using the closing value of a stock
different measures on the success of the index has been we calculate two more parameters –Momentum’ and
examined in earlier studies. These research took into ‘Volatility' [7]. Apart from this, we can extract important
account numerous stock markets and fundamental and structures grounded on Candlestick Pattern by means of
technical indicators from different countries. Unsupervised Learning like K-means clustering. The
production can be used as input for other machine learning
Prakash K. Aithal et. al. [11] examined how algorithms [10].
macroeconomic parameters affected India's National
Stock Exchange (NSE) and Bombay Stock Exchange Indicators include moving averages, Bollinger
(BSE). The suggested approach determines the correlation bands, VWAP, Stochastics, RSI etc. Let us understand
matrix of each macroeconomic statistic taken into different AI/ML algorithms that can be applied to technical
consideration. Using validation methods such the Kaiser- analysis data to predict stock movement [13]. In the table
Meyer-Olkin and Bartlett tests, it is demonstrated that below, lists of algorithms and the datasets used are described
dimensionality reduction is required and multicollinearity that can be used in technical analysis.
exists. These macroeconomic metrics are utilised to
forecast stock market movement using an artificial neural
network.
Authorized licensed use limited to: SIDDAGANGA INSTITUTE OF TECHNOLOGY. Downloaded on September 13,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
Algorithms Dataset Inference Accuracy
Random forest and Indicators like Daily stock prices for various stocks during the previous 68% accuracy was achieved
J48 bagging MACD, Stochastics, five years are recorded, and based on price movement, when applied on 1000
algorithm [17] RSI, Bollinger bands values for the RSI, MACD, Bollinger Bands, and stocks with minimum
Stochastic (KDJ) are created. These values form the basis Reward: Risk ratio of 3:1.
of the buy, sell, or hold decisions.
The J48 Algorithm can handle qualities that are discrete
and continuous.
Bagging works because it uses many copies of a same
model that have been trained on various datasets to
increase accuracy.
Fuzzy logic, Fuzzy Opening and closing Candlestick data and Bollinger bands data was used to After 36 evaluations system
inference system [18] price based on determine strength of Buy, Hold and Sell call. provided 94.44% of
candlestick, Bollinger Total of 9 functions were created to generate strength and accuracy.
bands data type of the call.
The fuzzy inference system provided 48 rules to evaluate
these functions.
Recurrent Neural Historical data of the Used MinMaxScaler to apply normalization on the data for For Infosys, 97.64%
Network, Deep stock that includes feature scaling. accuracy was achieved
Learning, Long short- Open, Low, High, RNN computation is done in three steps i.e., from input using 60-time steps and
term memory [20] Close and Date stage to hidden stage, first hidden to next hidden stage and RMSprop as optimizer
from last hidden stage to output stage.
.
SVM, Random Date Open, High, For the purpose of predicting stock price, the supervised 73% accuracy was achieved
Forest, K-Nearest Close, and Volume. machine learning algorithms SVM, Random Forest, KNN, using SVM algorithm
Neighbor, and Twelve technical and SoftMax have been used.
SoftMax [19] indicators have been The outcomes demonstrate that the Random Forest method
used for the model beats all other algorithms in terms of accuracy for huge
prediction. datasets.
When we use fewer technical indicators, each algorithm's
ability to forecast stock market developments performs
less accurately.
Naïve Bayes Date Open, High, The Nave Bayes algorithm exhibits the best accuracy 81% accuracy achieved
Algorithm [21] Close, and Volume results when the size of the dataset is decreased. with Naïve Bayes.
and Twelve technical
indicators
Authorized licensed use limited to: SIDDAGANGA INSTITUTE OF TECHNOLOGY. Downloaded on September 13,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
able to shortlist companies that performed financially well C. Sentimental Analysis
incurrent financial year and recent quarters. We used web scraping to get news articles for the
stocks in question. We also have added a binary feature
The main parameters considered were: which sets to 1 if the close value of the stock increased
1) ROE the next day and0 if the close value of the stock decreased
2) ROCE the next day, this allowed us to compare the test and train
3) Debt/ Equity sets to find out how accurate our sentiment model was,
4) Cash flow generation which came out to be 85% with the Dow Jones stock we
5)Profit generation QoQ, used for testing. We also calculate the subjectivity and
polarity of the score to give a proper score to the stock in
YoY.
comparison to the others. We used the Vader Sentiment
Library for the sentiment dictionary.
Authorized licensed use limited to: SIDDAGANGA INSTITUTE OF TECHNOLOGY. Downloaded on September 13,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.
Total Return 155.23% 1.38% 160.77% on Big Data and Smart Computing (BigComp),Jeju,2017,pp.451-
CAGR 158.71% 1.38% 160.09% 1 452,doi: 10.1109/BIGCOMP.2017.7881754.
Figure 4. One Year return from model [10] [S. Sangsawad and C. C. Fung, "Extracting significant
portfolio features based on candlestick patterns using unsupervised
approach," 2017 2nd International Conference on
For the same Time frame Nifty 50 Index fund gained Information Technology (INCIT), Nakhonpathom, 2017,
pp. 1-5, doi: 10.1109/INCIT.2017.8257862.
76.9%. Therefore, the model successfully outran the [11] P. K. Aithal, A. U. Dinesh and M. Geetha, "Identifying
market returns achieving the desired goal. Significant Macroeconomic Indicators for Indian Stock
Markets," in IEEE Access, vol. 7, pp. 143829-143840,
VI. CONCLUSION AND FUTURE WORK 2019, doi: 10.1109/ACCESS.2019.2945603. P. K. Aithal,
Fundamental Analysis allows us to filter out financially A. U. Dinesh and M. Geetha, "Identifying Significant
strong companies that have generated free cash flow on Macroeconomic Indicators for Indian Stock Markets," in
IEEE Access, vol. 7, pp. 143829-
YoY basis by evaluating net cash flow, ROCE, ROE and 143840,2019,doi:10.1109/ACCESS.2019.2945603.
Profit Growth Rate. Technical Analysis provides us with [12] Silpa, K.S. & Mol, J. & Ambily, A.s. (2017). A study on
proper buy/sell signals with help of combination of fundamental analysis of selected IT companies listed at
moving averages, oscillators and indicators. Sentimental NSE. Journal of Advanced Research in Dynamical and
Analysis allows us to analyze the opinions of people for a Control Systems. 9. 1-10.
particular product or for a company and give us a [13] R. A. Kamble, "Short and long term stock trend prediction
using decision tree," 2017 International Conference on
subjectivity and a polarity score to help in comparison. So,
Intelligent Computing and Control Systems (ICICCS),
instead of investing in a stock based on its closing prices, Madurai, 2017, pp. 1371-1375, doi:
we would recommend that you analyze the stock on the 10.1109/ICCONS.2017.8250694.
basis of these three factors, to get better returns. It is [14] Piotroski, Joseph. (2001). Value Investing: The Use of
required to identify combinations of moving averages, Historical Financial Statement Information to Separate
which may give one better accuracy and increase their Winners from Losers. Journal of Accounting Research. 38.
10.2307/2672906.
sentimental model score by using a specific sentiment
[15] Huang, Yuxuan, "Machine Learning for Stock Prediction
dictionary for the Indian stock market. One can also apply Basedon Fundamental Analysis" (2019). Electronic Thesis
value investing principles to get better results from and Dissertation Repository. Huang, Yuxuan, "Machine
fundamental analysis. Learning for Stock Prediction Based on Fundamental
Analysis" (2019). Electronic Thesis and Dissertation
REFERENCES Repository.
[16] Y. Kara, M. A. Boyacioglu and Ö. K. Baykan, “Predicting
[1] J. Kim, J. Seo, M. Lee and J. Seok, "Stock Price Prediction Through the direction of stock price index movement using artificial
Sentimental Analysis of News Articles," 2019 Eleventh International neural networks and support vector machines: The sample
Conference on Ubiquitous and Future Networks (ICUFN), Zagreb, of the Istanbul Stock Exchange”, Published in Expert
Croatia, 2019, pp. 700-702, doi: 10.1109/ICUFN.2019.8806182. Systems with Applications, vol. 38(5), May1, 2011
[2] M. Cliché, “BB_twtr at SemEval-2017 Task 4: Twitter [17] Jose, J., Mana, S. and Samhitha, B.K., 2019. An efficient
Sentiment Analysis with CNNs and LSTMs”, Proceedings of SemEval- system to predict and analyze stock data using Hadoop
2017, 20 April 2017 techniques. International Journal of Recent Technology
[3] S. Lauguico et al., "A Fuzzy Logic-Based Stock Market and Engineering (IJRTE), 8(2), pp.2277-3878.
Trading Algorithm Using Bollinger Bands," 2019 IEEE 11th [18] Hu, Z., Zhao, Y. and Khushi, M., 2021. A survey of forex
International Conference on Humanoid, Nanotechnology, Information and stock price prediction using deep learning. Applied
Technology, Communication and Control, Environment, and System Innovation, 4(1), p.9.
Management ( HNICEM ), Laoag, Philippines, 2019,pp.1-6, [19] Obthong, M., Tantisantiwong, N., Jeamwatthanachai, W.
doi:10.1109/HNICEM48295.2019.9072734. and Wills, G., 2020. A survey on machine learning for
[4] A. Sachdeva, G. Jethwani, C. Manjunath, M. Balamurugan and stock price prediction: algorithms and techniques.
V. N. Krishna, "An Effective Time Series Analysis for Equity [20] Yadav, A. and Vishwakarma, D.K., 2020. Sentiment
Market Prediction Using Deep Learning Model," 2019 International analysis using deep learning architectures: a review.
Conference on Data Science and Communication (IconDSC), Artificial Intelligence Review, 53(6), pp.4335-4385.
Bangalore, India, 2019, pp. 1-5, doi: 10.1109/IconDSC.2019.8817035.
[21] Sulandari, W., Suhartono, Subanar and Rodrigues, P.C.,
[5] Kumar, K. Dogra, C. Utreja and P. Yadav, "A Comparative Study of
2021. Exponential Smoothing on Modeling and
Supervised Machine Learning Algorithms for Stock Market Trend
Forecasting Multiple Seasonal Time Series: An Overview.
Prediction," 2018 Second International Conference on Inventive
Communication and Computational Technologies (ICICCT), Fluctuation and Noise Letters, p.2130003.
Coimbatore, 2018, pp. 1003-1007, doi: 10.1109/ICICCT.2018.8473214.
[6] M. Usmani, S. H. Adil, K. Raza and S. S. A. Ali, "Stock market
prediction using machine learning techniques," 2016 3rd International
Conference on Computer and Information Sciences (ICCOINS), Kuala
Lumpur, 2016, pp. 322-327, doi: 10.1109/ICCOINS.2016.7783235.
[7] S. Ravikumar and P. Saraf, "Prediction of Stock Prices using Machine
Learning (Regression, Classification) Algorithms," 2020 International
Conference for Emerging Technology (INCET), Belgaum, India, 2020,
pp. 1-5, doi: 10.1109/INCET49848.2020.9154061.
[8] S. K. Khatri and A. Srivastava, "Using sentimental analysis in
prediction of stock market investment," 2016 5th International
Conference on Reliability, Infocom Technologies and Optimization
(Trends and Future Directions) (ICRITO), Noida, 2016, pp. 566-569,
doi: 10.1109/ICRITO.2016.7785019.
[9] X. Li, H. Xie, Tak-Lam Wong and F. L. Wang, "Market impact analysis
via sentimental transfer learning," 2017 IEEE International Conference
Authorized licensed use limited to: SIDDAGANGA INSTITUTE OF TECHNOLOGY. Downloaded on September 13,2024 at [Link] UTC from IEEE Xplore. Restrictions apply.