Вы находитесь на странице: 1из 44

END SEMESTER PROJECT 2018-19

STOCK FREY

 Team Members:
 Sandeep Sethumadhavan (1640209)
 Sathyanarayan U Pai (1640211)
 Emmanuel M Shine (1640252)
Synopsis

An application to determine the


relationship between weather and
stock market.
1. Introduction

1.1 Overview of the system


 The aim of this project is to examine whether there is a
relationship between stock market and the weather.
 Development of a mobile application to predict the closing price
and volume of stocks taking into consideration the weather on a
particular day.
 Development of a web application to depict the discovered
relationship.
 The application can be useful to prospective buyers as well as
sellers and can play a huge role in the economy.
1.2 Problem Statement
 The product we attempted to develop is a mobile application to
predict the closing price and volume of stocks taking into
consideration the weather on a particular day.
 This will be attempted after the analysis of historical stock
market and weather data for a particular locality and will
conclude with the creation of a predictive model.
 Predicting stock market is always an advantage to traders and
companies.
 The application can be useful to prospective buyers as
well as sellers.
 The project can be built up on in the future using
different datasets or by using more variables to create a
more efficient and accurate predictive model.
 If successful, the application can play a huge role in the
economy.
2. System analysis

2.1 Literature Review


 It has been established across various studies that weather
affects the mood of people.
 It has also been established that mood affects the trading
behaviour of people.
 Subsequently, several studies have found a correlation
between various weather variables and stock market in the
area under study.
2.2 Existing System
 The following product doesn’t exist at the moment in
the market.
 However multiple studies were conducted by Mr. Olha
Zadorozhna and others on the effect of weather on stock
market in different countries.
 The study found significant relationship between
weather and stock market performances of multiple
countries.
 However, the creation of a model was not attempted in
any of the cases.
2.3 Proposed System
 The aim of this project is to collect both weather and stock
market data, analyse it and thus build a predictive model which
can determine the closing prices and volume of stocks with
respect to the changes in weather.
 Further, we are aiming to build a mobile application which
makes use of this predictive model.
 Use of RStudio to build a predictive model and also a web
application.
 Use of Android Studio to build the mobile application.
2.3.1 Advantages:
i. The mobile application provides an interface where users can
select the location and the application will display the
prediction of the stock market for the particular day.
ii. The application will predict both the closing price and volume
of stock for the particular day.
iii. The web application will provide more in-depth knowledge
about the model graphically.
3. System requirements

3.1 Requirements Specification


The software has the following hardware and software
requirements

Hardware Requirements
 Processor: Two quad core processors
 RAM: 32GB RAM
 Hard Drive: 5 x146GB RAID
 NIC: 4 x10/100mb
Software Requirements
 Operating System : Windows 7
 MS Excel
 RStudio
 Android Studio
 Internet Browser
Software Tools Specifications
1. RStudio Packages
 imputeTS
 lmtest
 tseries
 forecast
 Shiny
 ggplot2
2. API used
 OpenWeatherMap
4. Design specification

4.1 System Architecture


Following diagram depicts a full detailed diagram of the
project that describes the various stages of the project
and the functionalities at each stage.
4.2 Database Design

4.2.1 Table Design

Table Name: STOCK DATA OF NEW YORK STOCK EXCHANGE


Table Description: THE TABLE CONTAINS THE VARIABLES
BEING TAKEN INTO CONSIDERATION FOR THE PREDICTIVE
MODEL W.R.T STOCK
The dataset was obtained from Yahoo finance portal.
Column Name Data Type Size Constraints Description
STOCKNAME STRING 30 NOT NULL NAME OF THE
STOCK/EQUITY
DATE DATE UNIQUE KEY THE DATE IN
CONSIDERATION
CLOSE FLOAT 10 NOT NULL CLOSING PRICE ON
A PARTICULAR DAY

VOLUME FLOAT 10 NOT NULL NUMBER OF


STOCKS ON A
PARTICULAR DAY

VOLUME IN FLOAT 10 NOT NULL NUMBER OF


CRORES STOCKS ON A
PARTICULAR DAY
IN CRORES
4.2.1 Table Design

Table Name: WEATHER DATA OF NEW YORK COUNTY


Table Description: THE TABLE CONTAINS THE VARIABLES
BEING TAKEN INTO CONSIDERATION FOR THE PREDICTIVE
MODEL W.R.T WEATHER
The dataset was obtained from www.ncdc.noaa.gov
which is a US Government based data repository.
Column Name Data Type Size Constraints Description
WEATHERID INT 5 PRIMARY KEY IDENTIFIER FOR THE WEATHER

DATE DATE FOREIGN KEY THE DATE IN CONSIDERATION

TAVG FLOAT 5 NOT NULL AVERAGE TEMPERATURE ON A


PARTICULAR DAY

PRCP FLOAT 5 NOT NULL RAINFALL ON A PARTICULAR


DAY

AWND FLOAT 5 NOT NULL WIND ON A PARTICULAR DAY

SNOW FLOAT 5 NULL SNOWFALL

TMAX FLOAT 5 NOT NULL MAXIMUM TEMPERATURE ON A


PARTICULAR DAY

TMIN FLOAT 5 NOT NULL MINIMUM TEMPERATURE ON A


PARTICULAR DAY

SNWD FLOAT 5 NULL SNOW DEPTH


4.2.2 Dataflow Diagrams
Following image depicts the data flow diagram that explains
in detail the flow of the data under each stage and also
explains the functionalities at each stage.
4.2.2 Entity Relationship Diagrams
Following image depicts the entity relationship diagram
and also explains in detail the relationship and
functionalities of various entities in the module.
5. Methodology

Weather data, stock prices and trade volume:


 We started of by obtaining weather data of New York County
and the stock data of the New York Stock Exchange for the
time period 1 January 2016 to 25 January 2018 on a daily
basis.
 As mentioned in the objectives, we aim to understand how
weather influences stock prices.
For this purpose, we have used the following methodology:
 Collected weather data of New York County and the stock
data of the New York Stock Exchange for the time period
2016-2018 on a daily basis.
 Performed data pre processing on both sets of data.
 Combined both datasets into a single one for the purpose of
analysis using MS Excel.
 Carried out preliminary analysis- scatter plots, box plots etc-
using RStudio.
 Built a multiple regression model for the combined dataset.
 Using the regression tool, we tried to find the relationship
between the following:
1. Closing price and weather variables
2. Volume of stock(in crores) and weather variables.
 Feature Extraction and Model Selection
 Extracted residuals
 Plotted the residuals against the fitted values as a time
series plot.
 Identification of time series model of residuals.
 Forecasting the residuals of the desired time and thus using
this to build a predictive model.
 Assumptions:
1. Weather data is considered to be independent with the
following variables: TAVG, PRCP, SNOW, SNWD, AWND.
2. Stock data is considered to be dependent variable in each
case.
3. Stock Exchanges remain closed over the weekend. Hence,
all the missing values have been filled by taking the
averages of the preceding and the succeeding values of the
closing prices and volume. This is done using imputeTS
package in R.
4. We set the Null Hypothesis as there is no relationship
between the weather and stock variables and conduct
different statistical analysis to reject the null hypothesis.
6. USER INTERFACE DESIGN

6.1 Levels of Interface


6.2 Mobile App Interface
6.3 Web App Interface
7.MOBILE APP SPECIFICATION

7.1. Technical Requirements

 This application will be developed on Android platform.


 This application is intended for use on a smart phone, in
a portrait orientation.
 JSON requests are used to handle the communication
between the app and the server.
 This application works only in online mode.
7.2. Mobile Application Layout

 On the first launch of the application, the user is


presented with a screen with the location on the top
and its weather conditions in the center that allows the
user to better know and understand the weather
conditions of the location selected.
 The user is asked to select his/her preferred location.
 At the bottom of the application, there is a button
called “Predict!” which directs the user to another
page, as depicted by following image below that
displays the predicted Close Price and Volume in crores.
7.3 Constraints

 The application is available only in English.


 The application is as of now able to predict the closing
price and volume only for the New York Stock Exchange,
i.e. New York locality.
 The application predicts the closing price and volume
only for the current date.
 The application is available only on Android platform.
7.4 Test Cases

 Case 1: Network Connection is unavailable.


 Case 2: Locality other than New York is selected.
8.WEB APP SPECIFICATION

8.1. Technical Requirements

 This web app will be developed on RStudio.


 This web app is intended for use on any device in any
orientation because of the use of the fluid page
attribute.
 The web app is currently hosted on shinyapps.io.
 This web app works only in online mode.
8.2. Web Application Layout
8.3 Constraints

 The web app is available only in English.


 The web app is as of now able to showing detailed
graphs depicting the prediction model.
 The web app is as of now hosted on shinyapps.io for
only a limited time period.
9. Conclusion

 The project we have attempted and the corresponding


end product were something which weren’t available in
the market at the time of undertaking of the project.
 We managed to build a prediction model to predict
closing price and volume of the New York Stock
Exchange and created an application to make use of the
same.
 The lack of availability of real time data of certain
weather variables affected the degree of accuracy of
our model.
 The availability of data, coupled with the
implementation of a model with the use of a larger
dataset could certainly help our prediction model more.
 The application can be made more useful once
prediction models for places other than New York is
implemented.
 The application in its available first version is still a
really helpful tool, which can help traders operating
within the New York Stock Exchange make decisions
looking at the current price of the stock exchange and
the predicted closing price and buy or sell stock
accordingly.
9.1. Advantages

 Similar product isn’t available in the market.


 The model is very useful for traders to help decide their
strategies.
 The web app provides an extensive look at the
prediction model and its documentation.
9.2. Limitations

 The lack of real time data for various weather variables


affected the accuracy of the model.
 The model is available only for the New York Stock
Exchange thus far and the application is catered
towards it.
9.3. Future Enhancements

 The prediction model can be improved by using larger


datasets and more weather variables.
 The usage of a free weather API with extensive
availability of data can help make the application more
accurate.
 The prediction model can be applied to other stock
exchanges.
 The web app can be made more interactive.

Вам также может понравиться