A stock prediction application in Python using Streamlit to create the interactive web app, with various tools such as Yahoo Finance to fetch stock data and Facebook Prophet to predict prospect stock

Overview

KrystalZhang-StockForecast App

A stock prediction application in Python using Streamlit to create the interactive web app, with various tools such as Yahoo Finance to fetch stock data and Facebook Prophet to predict prospect stock. The App also allows users to view the stock by specifying years, and using Plotly to generate plot graphs, charts and tables.

Copyright and Commercial Use Disclaimer

Please carefully read LICENSE.md about the Open Source restrictions and the personal use policy of this project under GPL-3.0 license, any commericial uses on this project by other than the owner @KrystalZhang612 or the authorized users and organizations, including unauthorized modifications, forks, pull requests, and other commercial-related uses will be subjected to copyright violation with sebsequent legal concerns.

StockForecast App Overview:

Screenshot
Screenshot
Screenshot
Screenshot
Screenshot
Screenshot

Build

Method to Run & Test the Project Locally
Prerequisites & Setups
Debugging&Troubleshooting
Synchronous Developing Notes
Testing Result
Tags and Topics

Contribution

Author

Functionalities/Demo

  • The user can select the stocks they would like to predict by different stock names.
  • The user can also specify certain years to inspect the previous stocks infos.
  • Raw data as charts, graphs and plottings for users to analyze the stock datas and trends.
  • The plot charts are interactive for users to zoom in/out.
  • A thorough forecast stock data for user to predict and analyze the daily/yearly trends of stocks.

Compatibility

Browsers Supported
Apple Safari
Google Chrome
Microsoft Edge
FireFox
Opera
DuckDuckGo

Method to Run & Test the Project Locally

Install the entire StockForecast App to the local directory

In local Console, install StreamLit using pip install streamlit

Run to initiate the App on web server by using streamlit run main.py

Test the App in http://localhost:8501

NOTE: The App is not fully compatible with Apple Safari

Have fun viewing stock prediction data

🛠️ Developing Languages, Tools, and Techniques Needed

Vscode 1.73
StreamLit
Facebook Prophet
Yahoo Finance
Plotly
Python3
PyStan 2.19

Vscode  Python3  Streamlit  Facebook Prophet  Yahoo Finance  Plotly 

Prerequisites & Setups

Install the modules in local Console at local directory:
Navigate to the project’s directory.
Install Facebook Prophet, StreamLit, YahooFinance, Plotly:
pip install streamlit fbprophet yfinance plotly
Create main.py with touch command.

Debugging&Troubleshooting

Module installation error: Failed to install Facebook Prophet in virtual environment (VENV).
DEBUGGING: Install PyStan 2.19: pip install pystan==2.19.
Then install Facebook Prophet: pip install fbprophet

Synchronous Developing Notes

Import data in main.py:

import streamlit as st
from datetime import date
import yfinance as yf
from fbprophet import Prophet
from fbprophet.plot import plot_plotly 
from plotly import graph_objs as go

Run the app by web server using Streamlit:

streamlit run main.py

Now the app runs on http://localhost:8501:
app runs on streamlit localhost.PNG

Load stock data from Yahoo Finance:

 def load_data(ticker):
    data = yf.download(ticker, START, TODAY)
    data.reset_index(inplace = True)
    return data
  data_load_state = st.text("Load data...") 
  data = load_data(selected_stock) 
  data_load_state.text("Loading data....done!")

start loading out data.PNG

Cache data:

st.subheader('Raw data') 
st.write(data.tail())

Now we got the raw data:
raw data table fetched.PNG

Plot data:

def plot_raw_data():
    fig = go.Figure()
    fig.add_trace(go.Scatter(x=data['Date'], y = data['Open'], name
='stock_open'))
    fig.add_trace(go.Scatter(x=data['Date'], y = data['Close'], name
='stock_close'))
    fig.layout.update(title_text="Time Series Data",
xaxis_rangeslider_visible=True)
    st.plotly_chart(fig)
plot_raw_data()

raw plot data fetched.PNG

Forecasting:

#Forecasting
df_train = data[['Date', 'Close']]
df_train = df_train.rename(columns = {"Date": "ds", "Close": "y"}) m = Prophet()
m.fit(df_train)
future = m.make_future_dataframe(periods=period)
forecast = m.predict(future)
st.subheader('Forecast date')
st.write(forecast.tail())

Now we have forecasting datas:
forecasting data.PNG
Fetch forecast data and forecast components as well:

st.write('forecast data')
fig1 = plot_plotly(m, forecast)
st.plotly_chart(fig1)
st.write('forecast components')
fig2 = m.plot_components(forecast)
st.write(fig2)

forecast data.PNG
forecast components.PNG

Testing Result

app runs on streamlit localhost.PNG
start loading out data.PNG
raw data table fetched.PNG
raw plot data fetched.PNG
forecasting data.PNG
forecast data.PNG
forecast components.PNG

Tags and Topics

python, python3, frontend, backend, fullstack-development, api, stock-prediction, vscode, streamlit, facebook-prophet, yahoo-finance, plotly, pystan.

Author

Krystal Zhang https://github.com/KrystalZhang612


This file was generated by StockForecastApp-readme, on October 31th, 2022

You might also like...

YOLOv5 Object Tracking + Detection + Object Blurring + Streamlit Dashboard Using OpenCV, PyTorch and Streamlit

YOLOv5 Object Tracking + Detection + Object Blurring + Streamlit Dashboard Using OpenCV, PyTorch and Streamlit

yolov5-object-tracking New Features YOLOv5 Object Tracking Using Sort Tracker Added Object blurring Option Added Support of Streamlit Dashboard Code c

Nov 17, 2022

🚕 Self-contained demo using Redpanda, Materialize, River, Redis, and Streamlit to predict taxi trip durations

🚕 Self-contained demo using Redpanda, Materialize, River, Redis, and Streamlit to predict taxi trip durations

Predicting (and learning) taxi trip durations in real-time This is a self-contained demo using Redpanda, Materialize, River, Redis, and Streamlit to p

Nov 17, 2022

SQLAlchemy-file is a SQLAlchemy extension for attaching files to SQLAlchemy model and uploading them to various storage such as Amazon S3, Rackspace CloudFiles, Google Storage and others using Apache Libcloud.

sqlalchemy-file SQLAlchemy-file is a SQLAlchemy extension for attaching files to SQLAlchemy model and uploading them to various storage such as Amazon

Nov 23, 2022

This project is done using Tesseract OCR in python. Tesseract is an optical character recognition (OCR) engine for various operating systems. Using this project one can do various text recognition operations

Text-Recognition-OCR This project is done using Tesseract OCR in python. Tesseract is an optical character recognition (OCR) engine for various operat

Jul 5, 2022

Fraud detection using Catboost, Shap & with real-time interactive dashboard made by Streamlit

Fraud detection using Catboost, Shap & with real-time interactive dashboard made by Streamlit if a dealer returns a product or service after get commi

Nov 18, 2022

Fraud detection using Catboost, Shap & with real-time interactive dashboard made by Streamlit

Fraud detection using Catboost, Shap & with real-time interactive dashboard made by Streamlit if a dealer returns a product or service after get commi

Aug 17, 2022

Python repository that uses time-series data from the S&P 500 to train a RandomForestClassifier to predict the probability of a stock price increasing or decreasing

Python repository that uses time-series data from the S&P 500 to train a RandomForestClassifier to predict the probability of a stock price increasing or decreasing

Python repository that uses time-series data from the S&P 500 to train a RandomForestClassifier to predict the probability of a stock price increasing or decreasing. This script is meant for educational purposes only - this is not financial advice. Consult with your financial adviser before making any investments.

Jul 21, 2022

A streamlit web app visualizing global surface water datasets.

A streamlit web app visualizing global surface water datasets.

streamlit-multipage-template A streamlit multipage app template for geospatial applications. It can be deployed to Streamlit Cloud, Heroku, or MyBinde

Oct 8, 2022

📌Stock Price Prediction App

📌Stock Price Prediction App

Stock Price Prediction App Stock Price Prediction App. 🟠 Built With: Software/ Language Version Python 3 STREAMLIT 0.8.9 Google Chrome Browser 87.0.4

Sep 10, 2022
Owner
Krystal Zhang
Software Developer | Software Engineer UC Davis B.S. Computer Science 22'
Krystal Zhang
Downloads data from Yahoo Finance, generates features, trains a model and submits the predictions to the tournament.

Numerai Signals Pipeline Downloads data from Yahoo Finance, generates features, trains a model and submits the predictions to the tournament. Running

Marc Sturlese 16 Nov 8, 2022
Simple CLI application using the Prophet library and financial APIs to provide stock price forecasts.

Stock Forecasting CLI Simple CLI application using Prophet library and Alpaca API to provide stock forecasts and trend data. This application was desi

Majid 2 Aug 14, 2022
Zen is a currently Free To Use Multi-Purpose-Multi-Tool which contains many different features and tools, Such as: Discord Tools, DDoS tools, Multi-Purpose Tools and more!

Zen VIP v.1.0.0 ?? About Zen : ?? Currently as we I am in the early stages of development Zen VIP is a free to use tool. ⚡ Zen Multi Tool has many dif

null 1 Sep 4, 2022
Web application to automatically scrape images from Google, Bing, Baidu and Yahoo.

Easy Image Scraping from Google, Bing, Yahoo and Baidu Automatically scrape images with your query from the popular search engines Google Bing Baidu Y

Alex Naumann 5 Nov 28, 2022
Prospect Pruning: Finding Trainable Weights at Initialization Using Meta-Gradients

Prospect Pruning (ProsPr) The code for "Prospect Pruning: Finding Trainable Weights at Initialization Using Meta-Gradients" Installation 1️⃣ Reproduci

Milad Alizadeh 21 Nov 25, 2022
Web app to provide Finance news via a dashboard/API or email subscription

FinanceCurationWebApp Web app to provide Finance news via a dashboard/API or email subscription How to use Clone repository A clone is a copy of all t

Kaylyn Ashton Reddy 1 Oct 9, 2022
this software can find facebook account with email address by using facebook forgot password feature.

EmailToFacebook this software can find facebook account with email address by using facebook forgot password feature. How to use it pip3 install -r re

ENDLEPH 1 Sep 17, 2022
A Stock Trend Prediction Web Application in Python

A Stock Trend Prediction Web Application in Python. Here we will use Streamlit, an open-source Python library, that makes it easy to build custom web apps for Machine Learning and Data Science.

Ganesh Jainarain 1 Feb 24, 2022
Multi Brute Force Facebook - Crack Facebook With Login - Free For Now

✭ SAKERA CRACK Made With ❤️ By Denventa, Araya, Dapunta Author: - Denventa - Araya Dev - Dapunta Khurayra X ⇨ Fitur Login [✯] Login Cookies ⇨ Ins

Dapunta ID 24 Sep 30, 2022