Skip to content

tommasograndi/StockPredDashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Financial dashboard for stock selection, analysis and price prediction.

If any error occures while viewing the notebook report.ipynb you can view it at https://nbviewer.org/github/tommasograndi/StockPredDashboard/blob/main/Report.ipynb

Structure of the repository

For the project of the second module of IT coding I chose the Stock Price Prediction, but I also decided to extend this prediction and implement it into a web dashboard that could allow the user to select a stock, visualize informations and request a prediction based on two main models: ARIMA and XGBOOST.

For this reason the code consists of two parts:

  1. The notebook called report.ipynb represents an in depth explanation and thougt process of the stages of data gathering, processing, analysis and the creation of the predicting techniques. In the notebook there is also the explanation of the functions created to display the data and the outcome of the predictions inside a web app DashBoard created through the Streamlit Library.
  2. Additionally there is a script called dashboard.py that contains synthetically the most important parts presented in the notebook, the functions that are used to manipulate the data and the whole interface of the dashboard. This script is the one to be runned by streamlit in order to access the dashboard and interact with it.

Access the dashboard.

In order to access the dashboard, is fundamental first to install all the required libraries. See requirements.txt for details. After this, you'll have to activate the Python environment (in my case is called ITproject) with the necessary libraries installed. I used Anaconda to create and manage it and I can access it from the terminal with:

conda activate ITproject

Secondly, you have to save the script in a local folder and locate from the terminal into the same directory ('foldername') of the script with the command

cd foldername

You can also clone this repository and access it from the relative GitHub folder.

Finally, you can run:

streamlit run dashboard.py

and wait for the browser to open a new page.

Dashboard previews and main functionalities

Screenshot 2023-06-09 at 16 23 27

The dashboard is organized in the following way:

  1. User input
    First, we have two selectboxes and one textbox in which we can choose between 3 markets () and pick a stock in the list of stocks traded in the selected market (we can also write the name of the stock and search for it).
    After choosing the stock, on the right side there is an input textbox in which we can put the initial date from which we want to download the data.
    Every time the user interact with this upper boxes will change the inpput parameters for all the functions that download the data to be fed to the rest of the script and to the following functions that display the informations and calculate the predictions.
image
  1. Content output
    After the user has interacted with the input boxes, the script will execute the functions and will display the following informations:

    • Price chart. This tab will show the Company stock price plot and below the downloaded data. The user can interact with the chart thanks to the plotly renderer. Screen Recording 2023-06-09 at 15 18 33

    • Technical analysis. This tab will display the original stock price with some technical indicators plotted along with it. The three technical indicators are Simple Moving Average, Exponential Moving Average and RSI (that is plotted in a separate figure). image

    • Prediction. This is the most important tab of the dashboard, the one with the two models studied and created according to the process explained in the report.ipynb notebook. As we know, the two models are ARIMA and XGBOOST.
      ARIMA:
    image

    XGBOOST: image


    • Statistics. This tab simply display some statistics of the stock scrape with yahoo_fin package from Yahoo Finance. image

    • Analysts' estimates. As the previous tab, this one is printing analysts predictions and forecast for the company main figures. The informations are obtained through a yahoo_fin function. image




For more informations about the library Streamlit you can check the documentation at https://docs.streamlit.io

Releases

No releases published

Packages

No packages published