Visualising and Forecasting Stock Prices With Flask
Visualising and Forecasting Stock Prices With Flask
https://doi.org/10.22214/ijraset.2023.51207
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
Abstract: Stock price forecasting and visualisation are critical tasks for investors and traders in financial markets. In this
project, we have developed a web application that can visualise stock prices of the company in form of charts and predicts future
stock prices using machine learning algorithms. The web application is built using Flask(python), a popular web framework,
and integrates several APIs and libraries, including News API, Alpha Vantage API, Beautiful Soup (bs4), Pandas, Numpy,
Plotly, and Scikit-learn. The application provides users with a basic overview of the company, current prices of the stock, news
related to the company, and visualisations of historical stock prices in the form of charts. The historical stock prices are fetched
using Alpha Vantage API, and the charts are generated using Plotly library. The web application also includes a predictive
model built using Support Vector Regression (SVR) algorithm which forecasts the stock prices.
This paper demonstrates the potential of machine learning algorithms and web technologies in the field of stock price
forecasting and visualisation. The web application developed, provides users with valuable insights and information related to
stock prices, and it can be used as a powerful tool in financial markets.
Keywords: Flask, Support Vector Regression, Forecasting, Visualisation, Stock Market.
I. INTRODUCTION
A multifaceted and volatile system, the stock market can be affected with a variety of factors including economic factors, political
happenings, and public sentiment. Given that prices fluctuate constantly, it falls upon traders and investors to leverage available
information intelligently to optimize profit while minimizing exposure to risk. Among stock trading's foremost challenges is
forecasting future stock values accurately. Increasingly, researchers have been pursuing machine learning algorithms to predict
stock prices. Through sophisticated analyses of historical data into the patterns and trends underpinning stock price behaviors, these
algorithms provide ways to anticipate future fluctuations in those prices using multiple techniques; among them, support vector
regression (SVR), random forest regression (RFR), and cutting edge deep learning strategies employing architectures like long
short-term memory (LSTM) networks. We have developed a web application that can visualise stock prices and forecast future
prices. The historic stock-price data is pulled from Alpha Vantage API and users can utilize a range of charts to illustrate this data.
Additionally, we implemented an SVR-based model, which can predict stock prices for the upcoming week.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 4113
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
7) Price Prediction of Share Market using Artificial Neural Network: The author “Zabir Haider Khan” discusses the analyses of
various statistical models, Artificial Neural Networks are analogous to nonparametric, nonlinear, regression models. The author
used Backpropagation algorithm for training sessions and Multilayer Feedforward network as a network model for predicting
price.
8) Stock Market Prediction using Machine Learning: The author “V Kranthi Sai Reddy” uses a machine learning technique called
Support Vector Machine (SVM) to predict stock prices for the large and small capitalizations. The programming language used
to predict the stock market using machine learning is Python.
9) Stock Prediction Using Machine Learning Algorithms: The author “P.P.S. Kolhi” proposed the use of macroeconomic factors
such as commodity price, market history, and foreign exchange rate to predict the Bombay Stock exchange (BSE). The project
is implemented in Ipython Notebook.
10) Predicting Stock Market Price Using Support Vector Regression: The author “Phayung Meesad” uses Support Vector
Regression (SVR) as an machine learning algorithm in order to predict the stock market price as well as to predict stock market
trend.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 4114
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
3) Sentiment Analysis: By harnessing the power of social media analytics alongside sophisticated algorithms designed specifically
for attaining essential insights into user opinions, investors can obtain critical information in real-time. With effective sentiment
analysis techniques applied to platforms like Twitter and Facebook, unique opportunities arise for making well-informed
decisions based on current market sentiments at any given moment.
4) Advanced Machine Learning Models: To forecast stock prices, we employ a Support Vector Regression (SVR) model as the
base of our approach; nevertheless, there exist numerous additional advanced machine learning models such as Random
Forests, Gradient Boosting and Long-short term memory (LSTM), which could be useful in increasing the accuracy rate of
forecasting models.
5) Integration of Financial Statements: An integral part of evaluating a company's financial status is analyzing multiple documents
including balance sheets, income statements, and cash flow statements. Utilizing these materials provides additional depth that
may help shareholders form understanding and facilitate intelligent decision-making with regard to investments.
VI. CONCLUSION
This research paper proposes a web application as a solution to visualize and forecast stock prices using past data. By means of our
approach, we have been able to demonstrate that one can predict future price movements over a period of seven days. This system
takes into account machine learning algorithms and data visualization tools to implement such functionality.
The potential applications of our proposed work encompass various fields, among which are stock trading and portfolio
management. Enabling users with precise forecasts of stock prices, our approach presents an opportunity to inform intelligent
investment decision-making and amplify overall returns.
Investors, traders and financial analysts can benefit from the web application developed in this work. Furthermore, our approach can
be expanded to incorporate more complex machine learning models/ algorithms and data sources.
VII. ACKNOWLEDGEMENT
We are indebted to our mentor, Prof. Ashwini Yerlekar, whose exceptional guidance brought our project to fruition. Her invaluable
advice and unwavering support have empowered us to achieve our goals.
We extend our gratitude to Dr..Hemant Turkar, HOD CSE at RGCER, Dr. Sachin Mahakalkar, Dean Academics at RGCER, and Dr.
Manali M. Kshirsagar, Principal of RGCER, for their gracious assistance and unwavering encouragement.
REFERENCES
[1] Visualizing and Forecasting Stocks Using Dash by Sachin Kumar Mishra (2022). International Journal of Advanced Research in Science, Communication and
Technology (IJARSCT) Volume 2, Issue 1, May 2022. DOI: 10.48175/568
[2] Predicting Stock Market Price Using Support Vector Regression by Phayung Meesad (2013). 2013 International Conference on Informatics, Electronics and
Vision (ICIEV DOI: 10.1109/ICIEV.2013.6572570
[3] Visualizing and Forecasting Stocks Using Machine Learning by Ajitkumar Jagtap, Yash Patil, Darshan Oswa(2022). DOI:
10.22214/ijraset.2022.41846
[4] Data Visualization and Stock Market and Prediction by Ashutosh Sharma, Sanket Modak, Eashwaran Sridhar (2019)
[5] A Comparative Study On Techniques Used For Prediction Of Stock Market by Lakshmi Tharun Ponnam, Dr. V. Srinivasa Raob, BalaKrishna Reddy Gujjuc
(2016). 6th International Conference On Advances In Computing & Communications, ICACC 2016, 6-8 September 2016, Cochin, India.
[6] Using neural networks to forecast stock market prices by Ramon Lawrence (1997).
[7] Stock Market Prediction Using Machine Learning by Kranthi Sai Reddy Vanukuru (2018). DOI:10.13140/RG.2.2.12300.77448
[8] Stock Market Prediction Using Machine Learning by Himanshu Dhiman, Lokesh Chouhan (2018) DOI: 10.1109/ICSCCC.2018.8703332
[9] Prediction of Trends in Stock Market using Moving Averages and Machine Learning by Shoban Dinesh , Samhitha R, S.P. Anusha DOI:
10.1109/I2CT51068.2021.9418097
[10] Flask Documentation - flask.palletsprojects.com/en/2.2.x/
[11] Beautiful Soup Documentation - crummy.com/software/BeautifulSoup/bs4/doc
[12] Plotly Documentation - plotly.com/python/
[13] News API Documentation - newsapi.org/docs
[14] Alpha Vantage API Documentation - alphavantage.co/documentation/
[15] Scikit-learn Documentation - scikit-learn.org/0.21/documentation.html
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 4115