Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock & Crypto Analysis Dashboard Real-Time Market Data • SQL Analytics • Machine Learning (Prophet Forecasts)

This project is an end-to-end financial analytics system that collects, stores, analyzes, and visualizes stock & cryptocurrency price data using:

PostgreSQL + SQL window functions Python ETL pipelines Interactive Streamlit dashboard Machine Learning forecasting (Prophet) Plotly visualizations Secure environment variable handling (.env)

Features

  1. Real-Time Stock & Crypto Data Fetches stock data using Yahoo Finance (yfinance) Fetches crypto data via Binance API Saves data into PostgreSQL tables

  2. SQL-Based Analytics Using PostgreSQL window functions: Moving averages (SMA10, SMA30) Rolling volatility Returns Price changes

  3. Interactive Streamlit Dashboard Includes: Candlestick charts Moving average overlays Live price charts Data tables Prophet forecasts

  4. Machine Learning Forecasting (Prophet) Predicts short-term future prices Includes confidence intervals Automatically retrains on fresh data

  5. Secure Environment Variables No credentials are stored in code. Uses .env + python-dotenv. Project Structure stock-crypto-dashboard/ │── README.md │── requirements.txt │── .gitignore │── .env
    │── src/ │ ├── dashboard.py │ ├── db_utils.py │ ├── prophet_forecast.py │ ├── fetch_stocks.py │ ├── fetch_crypto.py │ ├── insert_stock_data.py │ ├── insert_crypto_data.py │── data/
    │── notebooks/
    │── venv/

🔧 Setup Instructions

  1. Clone the repo git clone https://github.com//stock-crypto-dashboard.git cd stock-crypto-dashboard

  2. Create a virtual environment python3 -m venv venv source venv/bin/activate

  3. Install dependencies pip install -r requirements.txt

  4. Create a .env file DB_NAME=myproject DB_USER=YOUR_USER DB_PASSWORD=YOUR_PASSWORD DB_HOST=localhost DB_PORT=5432

  5. Start PostgreSQL

Make sure your database is running and includes a stock_prices table.

  1. Run the ETL scripts python -m src.insert_stock_data python -m src.insert_crypto_data

  2. Run the dashboard streamlit run src/dashboard.py

Machine Learning Forecasts

The project uses Facebook Prophet: Autoregressive model Trend + seasonality Prediction intervals Suitable for financial time-series Example output: Predicted price curve Upper/lower confidence bands Next 2 hours of forecasts (default)

Technologies Used :

Python, PostgreSQL, Streamlit, Plotly, Yahoo Finance API, Binance API, Prophet (Forecasting), pandas, numpy, psycopg2, python-dotenv, virtualenv

About

Advanced Stock & Crypto Analysis: Python & PostgreSQL pipeline that fetches, cleans, and stores real-time stock and cryptocurrency data. Uses SQL for storage, pandas for analysis, and prepares data for predictive modeling and dashboards, demonstrating end-to-end data analytics and ETL skills.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages