Stock Market Analysis and Prediction
Stock Market Analysis and Prediction
I hereby recommend that this report has been prepared under my supervision by
Devendra Adhikari (TU Exam Roll No. 7685/072) ,Diwash Subedi (TU Exam Roll No.
7687/072), Jeevan Pokhrel (TU Exam Roll No. 7688/072) and Utsav Adhikari (TU
Exam Roll No. 7710/072) entitled “Stock Market Analysis and Prediction” in partial
fulfillment of the requirements for the degree of B.Sc. in Computer Science and
Information Technology be processed for evaluation.
………………………………
Mr. Ramesh Singh Saud
Project Supervisor
Nagarjuna College of Information Technology
Hariharbhawan,Lalitpur
ii
LETTER OF APPROVAL
This is to certified that this project prepared by Mr Devendra Adhikari, Mr Diwash Subedi,
Mr Jeevan Pokhrel, Mr Utsav Adhikari entitled "Stock Market Analysis and Prediction
Using Time Series Algorithm" in partial fulfillment of the requirements for the degree of
B.Sc. in Computer Science and Information Technology has been well studied. In our opinion
it is satisfaction in the scope and quality as a project for the required degree.
___________________________ ___________________________
MR. Ramesh Singh Saud External Supervisor
Project Supervisor
Department of Computer Science
and Information Technology
Nagarjuna College of Information
Technology
Pulchowk, Lalitpur
Nepal
iii
ACKNOWLEDGEMENTS
The completion of this project would not have been possible without the support and
guidance of many individuals.
We are grateful to Nagarjuna College of Information Technology for guidance and
supervision, as well as providing all the necessary support and friendly environment for
the successful completion of the project.
We would like to express our gratitude to our project supervisors Ramesh Sing Saud who
took an interest in our project and guided us through the project by providing necessary
ideas, information and knowledge for developing an Stock market Analysis And
Prediction . We would like to thank Ramesh Sing Saud and Dilli Adhikari for their
encouragement and guidance towards the making of this report as per the standard.
We are thankful and fortunate enough to get constant support from our colleagues and
teaching staff of B.Sc. CSIT department, which helped us, complete our project. We would
also like to extend our regards to all the non-teaching staff of B.Sc. CSIT department for
their timely support.
iv
ABSTRACT
Stock Market Analysis and Prediction (SMAP) is a web based application able to predict
the stock prices of companies based on their market values and news sentiments
surrounding the company. It is a portal where; general stock market enthusiast can keep
track of their invested companies and are also able to instantly contact their brokers for
purchase or sales of the stocks. The main application of this system however would be to
predict the market values. Along with that it has the features of news portal and general
stock related chatbot.
ARIMA (AutoRegressive Integrated Moving Average) ,used for stock market analysis and
prediction. The algorithm’s main goal is to learn the market trends by training with the
past data and predicting the future value. The calculated values of the computational
analysis i.e. prediction is used to display nearly accurate result .
v
TABLE OF CONTENTS
SUPERVISOR’S RECOMMENDATION .........................................................................ii
LETTER OF APPROVAL ................................................................................................ iii
ACKNOWLEDGEMENTS ................................................................................................ iv
ABSTRACT ......................................................................................................................... v
TABLE OF CONTENTS ................................................................................................... vi
LIST OF FIGURES ......................................................................................................... viii
LIST OF ABBREVIATIONS ............................................................................................ ix
CHAPTER 1 INTRODUCTION ........................................................................................ 1
1.1 Introduction .......................................................................................................................... 1
1.2 Problem Statement ............................................................................................................... 2
1.3 Objectives.............................................................................................................................. 2
1.4 Scope of the Project.............................................................................................................. 2
1.5 Limitations ............................................................................................................................ 3
1.6 Report Organization ............................................................................................................ 3
CHAPTER 2 SYSTEM ANALYSIS ................................................................................... 4
2.1 Literature Review ................................................................................................................ 4
2.2 Requirement Collection and Analysis ................................................................................ 5
2.2.1 Functional Requirements .............................................................................................................. 5
2.2.2 User Requirements ........................................................................................................................ 9
2.2.3 System Requirements .................................................................................................................. 10
2.2.4 Data Requirements ...................................................................................................................... 10
2.2.5 Non-Functional Requirements .................................................................................................... 10
2.2.6 Software Requirement................................................................................................................. 11
2.3 Feasibility Study ................................................................................................................. 11
2.3.1 Technical Feasibility: .................................................................................................................. 12
2.3.2 Operational Feasibility ................................................................................................................ 12
2.3.3 Schedule Feasibility .................................................................................................................... 12
CHAPTER 3 SYSTEM DESIGN ..................................................................................... 13
3.1 System Design ..................................................................................................................... 13
3.1.1 User Interface .............................................................................................................................. 13
3.1.2 System Flow Diagram ................................................................................................................. 14
3.1.3 Class Diagram ............................................................................................................................. 15
3.1.4 Sequence Diagram ...................................................................................................................... 17
3.1.5 Gantt Chart .................................................................................................................................. 18
CHAPTER 4 IMPLEMENTATION AND TESTING ..................................................... 19
4.1 Implementation .................................................................................................................. 19
4.1.1 Algorithm Design........................................................................................................................ 19
4.1.2 ARIMA ....................................................................................................................................... 20
4.1.3 Model Description: ..................................................................................................................... 23
4.1.4 Implementation Tools ................................................................................................................. 30
4.1.5 Other Tools and Platforms .......................................................................................................... 31
4.2 Testing ................................................................................................................................. 32
vi
4.2.1 Test Case ..................................................................................................................................... 32
4.2.2 Test Scripts.................................................................................................................................. 33
CHAPTER 5 CONCLUSION & FUTURE ENHANCEMENTS ................................... 35
5.1 Conclusion........................................................................................................................... 35
5.2 Future Enhancement ......................................................................................................... 35
REFERENCES ................................................................................................................. 37
APPENDIX
vii
LIST OF FIGURES
Fig 2.1: Use Case Diagram of stock market analysis and prediction system………. 6
Fig 2.3: DFD Level-0 for stock market analysis and prediction system………......... 8
Fig 2.4: DFD Level-1 for stock market analysis and prediction system………......... 9
viii
LIST OF ABBREVIATIONS
ix
CHAPTER 1 INTRODUCTION
1.1 Introduction
The project is targeted to companies where stock is traded in order to predict and analysis
the financial status and future of company. Along with companies general individual to
understand the pattern of stock market and invest the money.
The Closing Value is the price at which the most recent trade occurred. When the stock
market is open -- the Nepal Stock Exchange is open Sunday through Friday 11:00 a.m. to
15:00 p.m. and are closed on public holidays -- the closing value provides the most up-to-
date value of a stock. Odd lot trading is done on Fridays. Once the stock market closes, the
closing price is the best gauge of value until the stock market opens the next business day.
1
1.2 Problem Statement
Prediction of stocks, however, has not been an easy job since the concept started dating
back to the development of New York Stock Exchange in 1817, major approaches of
prediction of the stocks have been made with and without the use of computing systems.
The condition of the market is said to be unpredictable and none is ever to benefit from the
analysis that is made based on the data. The construct of the market and its environment
constrain the investors from windfall gains as the information about the system is publicly
available and the chances that the same investor may attain the best prices in stocks is
paradoxical.
Stock values are changing depending on the market conditions day by day. The challenge
is to guide the investors for the right time to buy and sell the shares. There are many
regression and classifiers available for the prediction. Effort is to need for determining the
best technique that provide better result in predicting the stock prices and give accurate
trends.
1.3 Objectives
The main objectives of the Stock Market Analysis and Prediction project are:
To predict future value of company stock
To analyze the current state of the market
To identify factors affecting stock market
To make analysis easy for all general people
To visualize the share market with the help of interactive charts
To implement machine learning models
2
1.5 Limitations
Chapter 2 focuses on the analysis part. It contains literature review section where the
research works done in the field of disease prediction system are discussed in brief. This
chapter also includes requirement analysis, feasibility study and system structure.
Chapter 3 discusses in detail about the design of the system. It provides information about
database schema . The chapter also discusses about process design, input output design.
Chapter 4 gives information about implementation and testing process. It discusses about
how the system is implemented and what tools and software are used to implement this
system. The testing process is also included in detail in this chapter.
3
CHAPTER 2 SYSTEM ANALYSIS
The review of literature is without a doubt incomplete with Burton G. Malkiel's theory of
Random walk of stock market. According to the author stock market moves in a random
fashion and any kind of previous or historical data cannot be used to predict its future
values. According to the author the market is efficient and will remove any kind of bias or
patterns. But we will observe that many research has provided enough evidence that such
prediction not only works but beats the traditional methods by a long shot.[2]
Aishwarya Singh forecast on time series data using time series analysis models. She have
implemented different models like MA, AR, ARIMA, LSTM etc. According to her LSTM
is best for large number of data and ARIMA is suitable for less (avg 800) data.[3]
Hirotaka Mizuno, Michitaka Kosaka, Hiroshi Yajima demonstrated the use of artificial
neural network on TOPIX (Tokyo Stock Exchange Prices Index). They used moving
average, Deviation of price from moving average, Psychological line, Relative strength
index as inputs for the ANN. Output of the ANN was buy, hold and sell signals. Their
results demonstrated their system could achieve from 9-10% of average return, which was
lower than traditional buy and hold strategy.
However Marijana Zekic has pointed out that many author ignore the possible structure of
ANN which could benefit certain situations. The demonstrates that certain type of ANN
structure perform better than others like 10-20-1 structure with back propagation
learning.[4]
4
2.2 Requirement Collection and Analysis
The step of requirement collection plays a vital role in the management and development
of any project. Having a clear idea about what the project is supposed to deliver, at the end
of the term, makes project managers and developers of the project aware of steps to be
taken for the completion of the job. Here in this project we collect the stock data of the
different company from merolagani.com which is used to analyze and predict the current
and future values. Our project mainly focus on forecasting the future value in which the
user(customer) can invest the money. For this project, we took under account two major
requirement criteria, functional requirements and non-functional requirements
Actor 2: Admin
Description: Admin are responsible for verifying user registration and are capable of user
management in the system. Market information are updated in the system by the user. All
the information about the stock are handled by admin.
5
FIG 2.1: USE CASE DIAGRAM OF STOCK MARKET ANALYSIS AND PREDICTION
6
FIG 2.2: E-R DIAGRAM OF STOCK MARKET ANALYSIS AND PREDICTION
7
5. Predictive Model Generation Algorithm
6. ARIMA algorithm is used to generate a model to predict the value.
7. Charts Generation
8. Predicted Trend are illustrated in chat for better understanding and
representation.
9. Training of Data and Prediction
10. Using test data and algorithm data are trained and are made capable to
predict the stock price.
11. Data Validation and Results Generation
12. The results are tested for error i.e. validation process is carried out and
afterwards result are generated.
FIG 2.3: DFD LEVEL-0 FOR STOCK MARKET ANALYSIS AND PREDICTION SYSTEM
8
FIG 2.4: DFD LEVEL-1 FOR STOCK MARKET ANALYSIS AND PREDICTION
The user shall be able to Register, Login and Logout in the system.
The user shall be able to view the stock market’s daily data and historical data.
The user shall be able to search for a specific company listed in the Merolagani.
The user shall be able to view market data of a specific company.
The user shall be able to send feedback.
The user shall view the latest financial news about stock market.
The user shall be able to analyze different company’s market condition through the
help of the historical data and financial news.
The user shall be able to view all the listed company shares he/she owns.
9
2.2.3 System Requirements
The system will display the information about daily market data of each company listed in
the Merolagani.
The system shall display historical market data of each company. This data will be
represented both in numerical and chart format. Similarly, the system will also display the
current and historical financial news related to Stock Market.
The financial news obtained shall be tagged based on their positive or negative polarity,
the date of announcement of the news and the company the news relates to.
The system will build a prediction model on the basis of the historical market data. This
prediction model will be used to predict the rise or fall of market of specific company in
the future.
To predict tomorrow’s market data of a company, the prediction model developed will take
today’s market data of that company as input. The output of the model will be indication
of either rise or fall of the market of that company.
The predicted indication shall be displayed to the users.
The predicted indication of rise or fall of market data will be stored in the database before
display.
10
opening and closing figures. Also, the stock data used in the training would determine the
reliability of the software.
Security: The user will only be able to access the website for inserting the stock prices
using his login details and will not be able to access the computations happening at the back
end.
Maintainability: The maintenance of the product would require training of the software
by recent data so that the recommendations are up to date. The database has to be updated
with recent values.
11
2.3.1 Technical Feasibility:
The user requirements are easily met by the system and the system is technically feasible
to work upon. The system uses, DJANGO as the web framework coupled with MySQl as
the database server.
12
CHAPTER 3 SYSTEM DESIGN
3.1 System Design
System design is simply the overall design of the system. The readily set system design
parameters are especially useful for the micro process of system development, converting
the product from blueprint to actual application. This document contains the overall design
of the system. The system will be constructed in 3-Tier Architecture as:
13
FIG 3.3: USER SIGNUP
14
FIG 3.4: SYSTEM FLOW CHART FIG 3.5: ARIMA ALGORITHM FLOW CHART
15
Different operations like adding stock, deleting stock and viewing stock can be performed.
Certain company differs in its stock prices. Company has attributes like id, company_name,
email and symbol. Different operations like adding company and extracting company
information operations are carried out. One company can have multiple company data
where company data can have attributes like id, close, obs_data and date. Users can view
data and date of company. One company can have several news where news can have
attributes like id, title, image, detail, date and author where operation like viewing news
can be performed.
16
3.1.4 Sequence Diagram
A sequence diagram shows object interactions arranged in time sequence. It depicts the
objects and classes involved in the scenario and the sequence of messages exchanged
between the objects needed to carry out the functionality of the scenario. In figure bellow
we have drawn the sequence diagram for our system. Admin are logged in to the system
where admin info are stored in database and after that admin are allowed to add market
information. User first register to the system where user information are checked by admin
and are stored to the database. Registration successful acknowledgement is send to the user.
User can now login to the system and system access is provided to user after login details
are validate. After user are logged in the system they can add owned stock data and store it
in the database. They can view today’s market by sending a query to the system. Query is
accepted and market information are displayed to the users. Users can view prediction and
are also capable of calculation to predict the certain market stock.Users are allowed to
logout through system after the use of the system
17
3.1.5 Gantt Chart
Gantt chart is a type of chart that illustrates a project schedule. It is a similar to activity
diagram as it shows the scheduled duration for the task to finish the project. From figure
bellow we can see that it illustrates an chart for our system. We have started our project in
02/24/2019 and continued different process to finish up the project. The chart shows that it
has taken 10 days for requirement gathering, 20 days for analysis, 15 days for design, 32
days for coding, 13 days for testing, 33 days for implementation and documentation is
carried out through every process.
18
CHAPTER 4 IMPLEMENTATION AND TESTING
4.1 Implementation
The main purpose of implementation of this system is to predict the stock prices based on
the previous stock prices
Data Collection
In the first phase, a number of scraping scripts to collect data from the sources mentioned
previously in the project. The data is composed of market data of companies
19
FIG 4.1: COMPANY DATA
4.1.2 ARIMA
One of the most common methods used in time series forecasting is known as the ARIMA
model, which stands for Autoregessive Integrated Moving Average. ARIMA is a model that
can be fitted to time series data in order to better understand or predict future points in the
series.
There are three distinct integers (p, d, q) that are used to parametrize ARIMA models.
Because of that, ARIMA models are denoted with the notation ARIMA(p, d, q). Together
these three parameters account for seasonality, trend, and noise in datasets:
p is the auto-regressive part of the model. It allows us to incorporate the effect of past values
into our model. Intuitively, this would be similar to stating that it is likely to be warm
tomorrow if it has been warm the past 3 days.
d is the integrated part of the model. This includes terms in the model that incorporate the
amount of differencing (i.e. the number of past time points to subtract from the current
value) to apply to the time series. Intuitively, this would be similar to stating that it is likely
to be same temperature tomorrow if the difference in temperature in the last three days has
been very small.
20
q is the moving average part of the model. This allows us to set the error of our model as a
linear combination of the error values observed at previous time points in the past.
In our project y is the observed value of different time stamp t of stock and value of p,d,q
is provided as per necessary to obtain high accuracy.
Step 1: Check Stationary:- If a time series has a trend or seasonality component, it must be
made stationary before we can use ARIMA to forecast.
Step 2: Difference:-If the time series is not stationary, it needs to be stationarized through
differencing. Take the first difference, then check for stationarity. Take as many differences
as it takes. Make sure you check seasonal differencing as well.
If d=0: yt = Yt
If d=1: yt = Yt - Yt-1
Here, yt is the differenced value that is calculated to make the data stationary.
Step 3:- Filter out a validation sample:-This will be used to validate how accurate our
model is. Use train test validation split to achieve this.
Step 4:- Select AR and MA terms:-Use the ACF and PACF to decide whether to include an
AR term(s), MA term(s), or both.
Step 6 — Validate model:- Compare the predicted values to the actual in the validation
sample.
So,we have to deal with either trend or seasonal. When dealing with seasonal effects, we
make use of the seasonal ARIMA, which is denoted as ARIMA(p,d,q)(P,D,Q)s. Here, (p,
d, q) are the non-seasonal parameters described above, while (P, D, Q) follow the same
21
definition but are applied to the seasonal component of the time series. The term s is the
periodicity of the time series (4 for quarterly periods, 12 for yearly periods, etc.).
Parameter Selection for the ARIMA Time Series Model, looking to fit time series data with
a ARIMA model, our first goal is to find the values of ARIMA(p,d,q) that optimize a metric
of interest. In this section, we will resolve this issue by writing Python code to
programmatically select the optimal parameter values for our ARIMA(p,d,q) time series
model. Along with those parameters we use CLOSING value of the time series stock data
as a feature to predict the future value. Similar, in case of seasonal ARIMA.
We will use a "grid search" to iteratively explore different combinations of parameters. For
each combination of parameters, we fit a new ARIMA model with the SARIMAX()
function from the statsmodels and assess its overall quality. Once we have explored the
entire landscape of parameters, our optimal set of parameters will be the one that yields the
best performance for our criteria of interest. In Statistics and Machine Learning, this
process is known as grid search (or hyperparameter optimization) for model selection.
When evaluating and comparing statistical models fitted with different parameters, each
can be ranked against one another based on how well it fits the data or its ability to
accurately predict future data points.
We will use MAPE or RMSE error calculation mechanism, which is conveniently returned
with ARIMA models fitted using statsmodels. The MAPE measures how well a model fits
the data while taking into account the overall complexity of the model same in case of
RMSE. A model that fits the data very well while using lots of features will be assigned a
lower MAPE score than a model that uses fewer features to achieve the same goodness-of-
fit. Therefore, we are interested in finding the model that yields the lowest MAPE value or
RMSE. The ARIMA order and seasonal order with lowest MAPE value is used with
SARIMAX model for seasonal case but only ARIMA order for trend case to fit and predict
the future value passing history value together.
Along with the plot for prediction we will plot diagnontics plots to ensure non of the
assumptions made by model are violates.
22
4.1.3 Module Description:
There is various presence of designing tools to create figures and diagrams like entity-
relationship diagram, flow chart, use case diagram and other diagrams. In this project
Microsoft Visio, Professional software was used for diagrammatic design of the proposed
system.
def home(request):
file_path = settings.BASE_DIR + '/files_system/'
df = pd.read_csv(
file_path + settings.FILE_TO_USE[0], parse_dates=['Date'], index_col='Date')
n_df = df[['Close']]
series = pd.Series(n_df.Close, index=n_df.index)
date = n_df.index
X = series.values
company = Company.objects.last()
# inserting closing value to Data table in database
for i in range(len(X)):
_ = Data.objects.create(obs_data=X[i], date=date[i], company=company)
# selecting test and train data
size = int(len(series) * 0.98)
train, test = series[0:size], series[size:len(X)]
predn_date = test.index
history = [x for x in train]
predictions = list()
23
a = list()
# preparing models
for t in range(len(test)):
p_values = d_values = q_values = range(0, 2)
# warnings.filterwarnings("ignore")
# call function evaluate_models to get order that best fit
order = evaluate_models(series.values, p_values, d_values, q_values)
# passing data and order to model
model = SARIMAX(history, order=order)
model_fit = model.fit(disp=0)
output = model_fit.forecast()
yhat = output[0]
predictions.append(yhat)
obs = test[t]
history.append(obs)
a.append(obs)
class Category(models.Model):
title = models.CharField(max_length=200)
25
image = models.ImageField(upload_to="category")
def __str__(self):
return self.title
class News(models.Model):
title = models.CharField(max_length=200)
category = models.ForeignKey(
Category, on_delete=models.CASCADE)
image = models.ImageField(upload_to="news")
detail = models.TextField()
date = models.DateTimeField(auto_now_add=True)
author = models.CharField(max_length=200, null=True, blank=True)
def __str__(self):
return self.title
The news posted by admin were presented to users with views script given below:-
class CategoryListView(ListView):
template_name = "minor/news.html"
queryset = Category.objects.all().order_by('-id')
context_object_name = "allcategories"
class NewsDetailView(DetailView):
template_name = "minor/newsdetail.html"
model = News
context_object_name = "newsobject"
4.1.3.3.Admin dashboard:
Dashboard is implemented with the extension feature of django admin model. With the use
of django admin-LTE theme, dashboard is customised. The dashboard contains all the
CRUD features along with user management. Script for admin dashboard customization is
given below:-
26
class CompanyAdmin(admin.ModelAdmin):
model = Company
list_display = ['company_name', 'email', 'symbol']
search_fields = ('company_name', 'email', 'symbol',)
admin.site.register(Company, CompanyAdmin)
class ResultAdmin(admin.ModelAdmin):
model = Result
list_display = ['obs', 'pre', 'date', 'company']
search_fields = ('obs', 'pre', 'date', 'company',)
admin.site.register(Result, ResultAdmin)
class DataAdmin(admin.ModelAdmin):
model = Data
list_display = ['obs_data', 'date', 'company']
search_fields = ('obs_data', 'date', 'company',)
admin.site.register(Data, DataAdmin)
4.1.3.5. StockBot :
Stock Bot is AIML based stock related chatbot that facilitate chatting for users. It is
implemented using AIML in flask mini framework.The ruled based chatbot consist of
markup language with basic tags like <aiml>, <patterns>,<category>,<template>.It
29
involves creating standard startup files, creating AILM files and including response in
AIML files. The basic script is given below:-
<?xml version="1.0" encoding="ISO-8859-1"?>
<aiml version="1.0">
<meta name="author" content="Dr. Deven"/>
<meta name="language" content="en"/>
<category>
<pattern>WHAT IS YOUR NAME</pattern>
<template>
I am stockbot and you?<think><set name="it"><set name="topic">STOCK
EXCHANGE</set></set></think>
</template>
</category>
<category>
<pattern>WHO INVENT YOU?</pattern>
<template>
I am invented by Programmer Deven<think><set name="it"><set
name="topic">INVENT</set></set></think>
</template>
</category>
</aiml>
Startup file script is like:-
<aiml version="1.0">
<!-- This category works with the standard AIML Set -->
<category>
<pattern>LOAD AIML B</pattern>
<template>
<!-- Load standard AIML set -->
<learn>aiml/stock..aiml</learn>
</aiml>
30
Back end of the system is developed with python using DJANGO web development
framework along with
31
High charts are a SVG-based, multi-platform charting library that has been actively
developed since 2009. It makes it easy to add interactive, mobile-optimized charts to your
web and mobile projects. It features robust documentation, advanced responsiveness and
industry-leading accessibility support.
4.2 Testing
32
TC_03: Any Authentic The user 1 . Navigate to A message of
Login and authorized should be login page . successful
Success user should be registered . 2 . Enter the login and
able to login to authentic dashboard for
the system by username and the user should
providing their password . be displayed .
username and 3 . Press ’Login’
password . button .
TC_04: Analysis is Historical data 1 . Historical 1 . Above 90%
Analysis done with the should be data should be of accurate
and test data i.e the present . divided into two prediction is
prediction historical data part. obtained .
is divided into 2 . Test data are
two part train analyze using
and test data. the ARIMA
And future model .
prediction is 3 . Error is
generated . generated using
the test data and
predicted data.
33
#Check 'Log in' in response self.assertTrue('Log in' in response.content)
#Log the user in
self.client.login(username='XXX', password="XXX")
# Check response code
response = self.client.get('/admin/')
self.assertEquals(response.status_code, 200)
#Check 'Log out' in response self.assertTrue('Log out' in response.content)
def test_logout(self):
# Log in
self.client.login(username='XXX', password="XXX")
# Check response code
response = self.client.get('/admin/')
self.assertEquals(response.status_code, 200)
#Check 'Log out' in response self.assertTrue('Log out' in response.content)
#Log out
self.client.logout()
# Check response code
response = self.client.get('/admin/')
self.assertEquals(response.status_code,200)
34
CHAPTER 5 CONCLUSION & FUTURE ENHANCEMENTS
5.1 Conclusion
The stock analysis itself is a cumbersome task to undertake. By using the comprehension
of both algorithms, a sustainable prediction level has been achieved. Successfully scraping,
then cleaning and then storing the data, our system is able to predict the future values of
the stocks.
The final system is a web based application, which is able to visualize the historic time
series data and future prediction, along with news and chat bot features. The web based
application in DJANGO, with the implementation of database and visualization tools is
able to show the interactive plots of the scores. Finally we were able to achieve our
objectives through the build system. System can predict the value of company stock
according to the data provided to the system to train it. We can analyze the current state of
the current market. Simple interface and interactive charts of the system has made easy
analysis of stock for the system users. Time series stat model ARIMA has been
implemented & achieved high accuracy rate. Our system is able to predict all the company
stock values taking the closing value only. Besides reaching our main objective to predict
the value we are able to add different features to our system. We have managed to add the
news features to the system where users are given access to view different stock news.
Features of chatbot is also added where user can interact with chatbot to get info about the
stock market.
Although we have reached our objectives but we are not fully able to get the accuracy
completely. We are able to achieve accuracy upto 95% maximum and 90% minimum. We
will be adding other feature in future to increase accuracy.
The proposed system is to be developed with inclusion of more companies in the future
along with multiple news sources.
35
The current system is build using the Auto regressive integrated model to increase the
accuracy, different combination of ARIMA order were generated. By selecting best
ARIMA order we are able to obtain accuracy up to 90% or higher. A system is never fully
completed as we can enhance the system in future using different methods.
Some of the future enhancement that can be done to the system are:
1. We can predict the stock value based on additional parameters such as opening values,
turnover etc.
2. We can add different additional features like alerting the user about price rise/fall of
different company’s stock.
3. We can further integrate different algorithm to enhance the accuracy of the system.
36
REFERENCES
[1]James,Chain.(August 5,2018). StockAnalysis
https://www.investopedia.com/terms/s/stock-analysis.asp
[2] Nicola W Burton (January 2018).Random walk down wall street. Retrived from
https://www.researchgate.net/publication/325247657_Burton_G_Malkiel's_A_random_w
alk_down_wall_street.
[3] Singh, Aishwarya.(October 25, 2018). Stock Prices Prediction Using Machine Learning
and Deep Learning Techniques. Retrieved from
https://www.analyticsvidhya.com/blog/2018/10/predicting-stock-price machine-
learningnd-deep-learning-techniques-python/
[6] Josef Perktold, Skipper Seabold, Jonathan Taylor(2009-2019).Time series analysis tsa.
http://www.statsmodels.org/dev/tsa.html
37