RESEARCH PAPER
ON
STOCK MARKET PRICE PREDICTATION USING
MACHINE LEARNING
SUBMITTED BY
Devika Dakhore – 1062221655
Akanksha Hattale-1062220750
MCA-A
Sem-IV
(Academic Year 2023-24)
1
1.ABSTRACT
The convergence of machine learning algorithms and stock market prediction has
garnered substantial attention in recent years, promising novel insights and enhanced forecasting
accuracy. This paper delves into the application of various machine learning techniques for
predicting stock prices, exploring their efficacy, limitations, and implications for financial markets.
Leveraging historical stock market data, the study employs a diverse array of machine learning
algorithms, including but not limited to, support vector machines, random forests, recurrent neural
networks, and deep learning models. Through rigorous experimentation and analysis, the research
elucidates the strengths and weaknesses of each approach in capturing the intricate dynamics of stock
price movements.
Furthermore, the paper investigates the impact of feature selection, data preprocessing, and
hyperparameter tuning on the predictive performance of the models. By elucidating the significance
of these factors, the study provides valuable insights into optimizing machine learning-based stock
market prediction systems. Moreover, the research explores the role of market sentiment analysis,
news sentiment, and macroeconomic indicators as additional features to enhance prediction accuracy.
In addition to assessing predictive performance, the paper evaluates the practical feasibility
and scalability of deploying machine learning models in real-world trading scenarios. Considerations
such as latency, computational resources, and model interpretability are meticulously scrutinized to
ascertain the viability of implementing these algorithms in live trading environments. Furthermore,
the study examines the implications of incorporating machine learning predictions into investment
strategies, highlighting the potential risks and rewards associated with algorithmic trading.
Overall, this research contributes to the burgeoning field of financial technology by
providing comprehensive insights into the application of machine learning algorithms for stock
market prediction. By elucidating the capabilities and challenges of these techniques, the study
facilitates informed decision-making for investors, traders, and financial institutions seeking to
leverage cutting-edge technology for enhanced market forecasting and investment management.
2
3
2.INTRODUCTION
The stock market is a vital component of a country’s economy. It is one of the
largest opportunities for investment by companies and investors. A company can gain a considerable
amount of money by expanding its business through an Initial Public Offerings. It is a good time for
an investor to purchase new stocks and gain extra profits from dividends offered in the company’s
bonus program for shareholders. As a trader, an investor can also trade stocks in the stock market.For
traders, the stock market provides a dynamic environment to engage in buying and selling stocks for
short-term gains. By leveraging various trading strategies, such as technical analysis, fundamental
analysis, and algorithmic trading, traders aim to capitalize on price fluctuations and market trends to
generate profits.
Stock traders need to predict trends in stock market behavior for correct decision
making to either sell or hold the stock they possess or buy other stocks. To gain profits, stock traders
need to buy those stocks whose prices are expected to increase in near future and sell those stocks
whose prices are expected to decrease. If stock traders predict trends in stock prices correctly, they
can realize significant profits. Therefore, prediction of future stock market trends is very important
for decision making by stock traders.
Investors must predict the future stock value of companies in order to obtain high
profits. Various prediction techniques have been developed to do predictions on the stock market
accurately. There were two methods widely known as conventional methods at the time when there
were no computational methods for risk analysis. There are many conventional methods for
predicting stock prices (by analyzing past data).
Two methods that are widely used in general are namely Fundamental Analysis and Technical
Analysis.
Fundamental Analysis: To determine accurate product value, reliable and accurate information on
the financial report of the company, it is necessary to have competitive strength and economic
conditions in which they are interested . The above value of the product can be used to make an
investment decision. On the basis of this idea, "if the intrinsic value is higher than the market value it
holds, invest otherwise and avoid it as a bad investment". Not only are these parameters other
parameters such as book value, earnings, p/e ratio, ROI etc. should be carefully analyzed to obtain an
estimate of future business conditions. For the long-term predictions, Fundamental analysis is useful
and the advantages are due to their systematic approach and their ability to predict changes.
Technical Analysis: "The idea behind technical analysis is that investors' con- stantly changing
attributes in response to different forces/factors make stock prices trends/movements". Different
4
technical factors of quantitative parameters can be used for analysis, such as trend indicators, lowest
and highest daily values, indices, daily ups and downs, stock volume, etc. It is possible to extract
rules from the data and the investors make future decisions based on these rules.
Different analysts may derive from the same charts different rules. For both short and long term
analysis, technical analysis is used. Technical analysis data is preferable over fundamental analysis
data as input to system.
3.LITERATURE REVIEW
Financial research has looked into how stock markets are impacted on some
dimensions by data that comes from multiple sources and is diverse. The term "multi-source
heterogeneous data" refers to data from various sources, including the foreign exchange market, the
stock market, the weather system, and the structure of stock prices, trading volumes, as well as
unstructured data from social networks, announcements, and news about stocks. Specifically,
behavioural finance holds that individual trader behaviours and the motivations behind them can
explain, study, and forecast financial markets, while the efficient market hypothesis holds that
information from various sources in the stock market will influence the stock market.
The stock market is still producing a lot of multi-source heterogeneous data at different
scales due to its rapid development. It has proven challenging for the conventional approach of
depending only on specialists to assess and forecast in order to satisfy the demands of industry
development. Many studies on information technology-based stock market forecasting have been
conducted in an effort to rapidly analyse vast amounts of stock market data and help—or perhaps
entirely replace—investors in their decision-making. These studies have also aided in the quick
creation of quantitative funds, which execute and even make investment decisions entirely on their
own through automated computer analysis.
Accurate stock price projections help decision makers avoid future risks more
successfully; for regulators, they help reinforce market control, guide and regulate the stock market
in a timely manner, and support the economy's sustainable growth. Development offers solid
assurances and a sturdy sense of confidence. The so-called stock price forecast, which is based on a
substantial amount of stock market information and precise statistical survey data, uses a variety of
scientific methods to predict the development prospects of the stock market through the regularity of
the market's development and its history and status. Academics have been studying predicting
techniques for many years.
Classic time series, like stock data, can be forecasted by many academics
using models like GARCH or ARIMA. However, the assumptions of these models are very high, as
they need the series to be linear and stationary. The stock data itself is not linear and consistent,
though, because a variety of factors influence the stock price of the data.
5
4.Importance
Importance of Stock Market
Indian stock market stood at third rank
in the world. The Stock is essentially a
share in
a company’s ownership. Stocks are
partial ownership of businesses instead
of stock
tickers piece of paper, which can be
traded in the stock market [4]. If
company
ownership is divided into 100 parts, the
investor purchase one part which is
equal to
one share then we can own 1 percent of
that company. Stock exchange uses an
automated matching system driven by
order. Stock prices are defined as any
time how
6
many buyers and sellers available for
the same stock in the market. If the
number of
buyers is more than sellers then stock
price becomes high and if the number of
sellers
higher than buyers then stock price
becomes low.
The best buy and sell order are looked
into a counterparty angle. The best buy
order
is which has the highest price and best
sell order is which has the lowest price
[7]. With
this logic system can match the orders
and executes the traders’ system. SEBI
(Security
and Exchange Board of India) regulates
the stock market. In stock markets
customers
7
preferences and requirements are
different. The estimated world stock
market was at
$36.6 trillion in early October 2008 [6].
The total world market for derivatives
was
estimated at approximately $791 trillion
in face value or nominal value, 11 times
the
size of the world economy [8].
Importance of Stock Market
Indian stock market stood at third rank
in the world. The Stock is essentially a
share in
a company’s ownership. Stocks are
partial ownership of businesses instead
of stock
tickers piece of paper, which can be
traded in the stock market [4]. If
company
8
ownership is divided into 100 parts, the
investor purchase one part which is
equal to
one share then we can own 1 percent of
that company. Stock exchange uses an
automated matching system driven by
order. Stock prices are defined as any
time how
many buyers and sellers available for
the same stock in the market. If the
number of
buyers is more than sellers then stock
price becomes high and if the number of
sellers
higher than buyers then stock price
becomes low.
The best buy and sell order are looked
into a counterparty angle. The best buy
order
9
is which has the highest price and best
sell order is which has the lowest price
[7]. With
this logic system can match the orders
and executes the traders’ system. SEBI
(Security
and Exchange Board of India) regulates
the stock market. In stock markets
customers
preferences and requirements are
different. The estimated world stock
market was at
$36.6 trillion in early October 2008 [6].
The total world market for derivatives
was
estimated at approximately $791 trillion
in face value or nominal value, 11 times
the
size of the world economy [8].
Importance of Stock Market
10
Indian stock market stood at third rank
in the world. The Stock is essentially a
share in
a company’s ownership. Stocks are
partial ownership of businesses instead
of stock
tickers piece of paper, which can be
traded in the stock market [4]. If
company
ownership is divided into 100 parts, the
investor purchase one part which is
equal to
one share then we can own 1 percent of
that company. Stock exchange uses an
automated matching system driven by
order. Stock prices are defined as any
time how
many buyers and sellers available for
the same stock in the market. If the
number of
11
buyers is more than sellers then stock
price becomes high and if the number of
sellers
higher than buyers then stock price
becomes low.
The best buy and sell order are looked
into a counterparty angle. The best buy
order
is which has the highest price and best
sell order is which has the lowest price
[7]. With
this logic system can match the orders
and executes the traders’ system. SEBI
(Security
and Exchange Board of India) regulates
the stock market. In stock markets
customers
preferences and requirements are
different. The estimated world stock
market was at
12
$36.6 trillion in early October 2008 [6].
The total world market for derivatives
was
estimated at approximately $791 trillion
in face value or nominal value, 11 times
the
size of the world economy [8].
Importance of Stock MarketIndian stock market stood at third rank in the world. The
Stock is essentially a share ina company’s ownership. Stocks are partial ownership of businesses
instead of stocktickers piece of paper, which can be traded in the stock market [4]. If
companyownership is divided into 100 parts, the investor purchase one part which is equal toone
share then we can own 1 percent of that company. Stock exchange uses anautomated matching
system driven by order. Stock prices are defined as any time howmany buyers and sellers available
for the same stock in the market. If the number ofbuyers is more than sellers then stock price
becomes high and if the number of sellershigher than buyers then stock price becomes low.The best
buy and sell order are looked into a counterparty angle. The best buy orderis which has the highest
price and best sell order is which has the lowest price [7]. Withthis logic system can match the orders
and executes the traders’system. SEBI (Securityand Exchange Board of India) regulates the stock
market. In stock markets customerspreferences and requirements are different. The estimated world
stock market was at$36.6 trillion in early October 2008 [6]. The total world market for derivatives
wasestimated at approximately $791 trillion in face value or nominal value, 11 times thesize of the
world economy [8].
13
NEED
1) Data of Tech Mahindra from 2013 to 2023:
At the very beginning, the company was seen gaining popularity and in the year 2022 it was on the
peak.
2) Data of Mphasis from 2013 to 2024:
14
The data of Mphasis was seen to be increasing from 2009 and gained high popularity in 2022 and
again fell down in 2023.
3) Data of Persistent from 2013 to 2023:
Persistent was in a boom from the start of 2013 and it did not lose its price. In
the coming years various changes were seen which led to the high market value of this company.
15
4) Data of Oracle Fin Serv from 2013 to 2023:
16
Oracle Financial Services provides financial software etc. And the current price is Rs.4,529. The
company is almost debt free. High growth was seen initially but later in the 2020 the prices fell
gradually but in 2021 it achieved the peak and again with a little difference fell in 2022 and now
again gaining its position in 2024.
5) Data of Coforge limited from 2013 to 2023:
Coforge is an IT services company providing end-to-end software solutions and
services. The current price is Rs.5,545. The company has delivered good profit growth of 21.3%
CAGR over last 5 years.
17
Description:
This script analyzes historical stock price data from a CSV file, trains a linear regression model, and
predicts future stock prices for a given number of days.
Usage:
1. Ensure you have the required Python libraries installed (NumPy, scikit-learn).
2. Provide the file path to the CSV containing stock price data in the 'file_paths' list.
3. Run the script to analyze the data and make predictions.
18