NSE Stock Prices Dashboard

Siddhant Kadam
3 min readJul 7, 2021

Creating a dashboard to visualize NSE stocks and predict their future price with ARIMA.

Introduction:

Here we have created a dashboard for reference and to share an idea of how we can build interactive dashboards for predicting models.

There are multiple services which require these kind of interactive dashboards for a better understanding of data and for quick insights.

Dash:

Dash is a Python framework built on top of React, a JavaScript library. But Dash also works for R, and most recently supports Julia, and while still described a Python framework, Python isn’t used for the other languages, “describing Dash as a Python framework misses a key feature of its design: the Python side (the back end/server) of Dash was built to be lightweight and stateless [allowing] multiple back-end languages to coexist on an equal footing”.It is possible to integrate D3.js charts as Dash components. Dash provides the default CSS (and HTML and JavaScript, and you can add your own), but for custom styling Dash applications CSS can be added, or Dash Enterprise used.

All the necessary libraries are listed

pip install dash
pip install dash-renderer
pip install dash-html-components
pip install dash-core-components
pip install plotly

Please feel free to visit my Github repository to make more advanced version of dashboards.

First we need to create a file named app.py. Here we will write the code for dashboard.

We can then set-up our App and its layout using the code shown below. The layout is stored in app.layout, and all the desired HTML components such as Div, H1, H2, P, etc have been added using the dash_html_components (html) library. Finally, we can add interactive components to our dashboard (eg. tabs, dropdowns, radio buttons) using the dash_core_components (dcc) library.

This function will show the graph below:

Finaly we can start our local server using the code below:

Now that our app is ready, we can simply lunch it by opening our computer terminal in our current working directory and typing python app.py. This will start a web server at http://127.0.0.1:8050/, going at this link we will see our final Python App running.

Conclusion

This Dashboard can be further developed by adding additional features such as:

  • Use a web-scraping mechanism to fetch new Stock Market data in real-time to update all the related graphs.
  • Add more Data Visualisation charts.
  • Create Machine Learning models to make predictions (eg. ARIMA, LSTM).
  • Improve the Dashboard overall design.

Bibliography

[1] Dash operationalizes Python & R models at scale, Plotly. Accessed at: https://plot.ly/dash

--

--