This project implements a full-cycle Bitcoin price prediction system using machine learning, Power BI dashboards, and Windows-based automation.
We use CoinGecko's API to pull 365-day BTC data, apply time series-based model training (Linear, Ridge, Lasso, RF, XGBoost, CatBoost, etc.), evaluate metrics (MAE, RMSE, R²), and visualize the results using Power BI Desktop.
The system is designed for automated daily updates and weekly retraining to always forecast the next 7-day BTC prices.
- Python 3.10
- Jupyter Notebook – for EDA and prototyping
- Spyder IDE – for final pipeline scripting
pandas
,numpy
– data manipulation and feature processingmatplotlib
,seaborn
– visualizations and plotsos
,datetime
,timedelta
– file and time handlingrequests
– API calls to CoinGecko
scikit-learn
– linear models, metrics, and time series splitxgboost
,lightgbm
,catboost
– gradient boosting modelspickle
– for model serialization
- Power BI Desktop – interactive dashboard
- Windows Task Scheduler – to schedule daily and weekly scripts
- CoinGecko API – for fetching historical BTC price data
This project includes data/
for input/output CSVs, diagrams/
for EDA/forecast plots, models/
for the latest trained model, and src/
for all Python scripts. The dashboard/
folder contains the Power BI .pbix
file, with dependencies in requirements.txt
and full documentation in README.md
.
btc_price_tracker_api/
├── data/
│ ├── btc_full_data.csv # Full 365-day + daily BTC data
│ ├── btc_prediction.csv # Next 7-day forecast (updated weekly)
│ ├── btc_processed_data.csv # Cleaned data used for ML modeling
│ └── btc_model_scores.csv # MAE, RMSE, R², MAPE for each model
│
├── diagrams/
│ ├── btc_price_trens.png
│ ├── btc_moving_averages.png
│ ├── btc_daily_change_pct.png
│ ├── final_forecast_plot.png
│ ├── mae_comparison.png
│ ├── rmse_comparison.png
│ ├── r2_comparison.png
│ ├── mape_comparison.png
│ └── BTC Price Forecast & Model Performance Dashboard.png
│
├── models/
│ └── Lasso_btc_best_model.pkl # Latest trained model (auto-overwritten weekly)
│
├── src/
│ ├── fetch_btc_data.py # One-time: fetch initial 365-day BTC data
│ ├── daily_update.py # Daily script to append new BTC price
│ ├── clean_and_process.ipynb # Notebook for cleaning, EDA, and exports
│ └── train_and_predict.py # Main ML training + 7-day forecasting
│
├── dashboard/
│ └── powerbi_dashboard.pbix # Final Power BI Dashboard file
│
├── requirements.txt # Python dependencies
└── README.md # Complete project documentation
The BTC Price Tracker operates in a continuous loop using a structured 4-phase pipeline:
-
Data Collection
- Pull 365 days of BTC price data using the CoinGecko API (
fetch_btc_data.py
) - Append new daily BTC price using
daily_update.py
(runs via Task Scheduler)
- Pull 365 days of BTC price data using the CoinGecko API (
-
Data Cleaning & EDA
- Run
clean_and_process.ipynb
to handle missing data, generate charts, and export cleaned datasets - Visualizations (price trend, moving averages, etc.) are saved to
/diagrams
- Run
-
Model Training & Forecasting
- Execute
train_and_predict.py
weekly to:- Train multiple models (Linear, Ridge, Lasso, RF, XGBoost, LightGBM, CatBoost)
- Select the best model based on RMSE
- Forecast BTC prices for the next 7 days
- Save the best model in
/models
and scores inbtc_model_scores.csv
- Execute
-
Dashboard & Automation
- Open
powerbi_dashboard.pbix
to visualize latest trends, model scores, and forecasts - Task Scheduler automates data update and model retraining
- Open
This project combines data visualizations created using Python (Matplotlib, Seaborn) and Power BI to offer deep insights into Bitcoin price trends, forecasting accuracy, and model performance.
These visuals are critical in transforming raw data into understandable patterns that help answer key business questions such as:
- 📉 How is BTC price behaving over time?
- 📈 What is the forecasted price for the next 7 days?
- 🧠 Which ML model is currently performing best?
- 🎯 How accurate are our predictions in real terms (MAE, RMSE, R²)?
- 🔍 Are we underfitting or overfitting any model based on error metrics?
Together, these help financial analysts, investors, or data teams track market behavior, evaluate prediction reliability, and plan investment or trading strategies based on data-driven insights.
Diagram File | Description |
---|---|
btc_price_trens.png |
BTC price trend over the last 365 days |
btc_moving_averages.png |
7-day and 14-day moving averages to detect signals |
btc_daily_change_pct.png |
Daily % change — helps identify market volatility |
final_forecast_plot.png |
Forecasted BTC prices for next 7 days |
mae_comparison.png |
MAE: absolute error comparison across models |
rmse_comparison.png |
RMSE: penalizes large prediction errors |
r2_comparison.png |
R²: how well model explains variance in price |
mape_comparison.png |
MAPE: shows % error — useful for business clarity |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Diagram File | Description |
---|---|
BTC Price Forecast & Model Performance Dashboard.png |
Combined view of trend, forecast, and scores |
🔸 Power BI File:
🔸 The dashboard is designed for **executive-level reporting** and allows easy interpretation of price trends, future projections, and model comparisons with filters and visuals.To run this project on your local machine:
# Clone the repository
git clone https://github.com/Harish-34/btc_price_tracker_api.git
# Navigate into the project folder
cd btc_price_tracker_api
# Install required dependencies
pip install -r requirements.txt
This end-to-end BTC price prediction system demonstrates how machine learning, automated pipelines, and dashboarding tools can be combined to drive financial forecasting solutions.
From data collection and modeling to daily price updates and insightful dashboards, the project is built for real-time tracking and business-oriented decision making.
It can be extended to other cryptocurrencies or asset classes by updating the source API and modeling logic.
If you liked this project or want to collaborate:
- 🔗 LinkedIn: Harish Chowdary
- 🐙 GitHub: Harish-34
Feel free to connect for ideas, feedback, or contributions!