This toolkit implements multiple approaches for predicting Bitcoin price movements. It includes traditional statistical methods, machine learning algorithms, and a novel visual CNN approach that uses candlestick chart images.
- Visual CNN Approach: Converts candlestick charts to images and uses convolutional neural networks to predict price movements
- LSTM Approach: Uses Long Short-Term Memory networks to capture temporal patterns in the time series data
- ARIMA Approach: Applies traditional statistical time series modeling
- XGBoost Approach: Employs gradient boosting with technical indicators
- Random Forest Approach: Utilizes ensemble learning with technical indicators and lagged features
- Python 3.7+
- pip (Python package manager)
- Clone this repository:
git clone https://github.com/yourusername/bitcoin-prediction-toolkit.git
cd bitcoin-prediction-toolkit- Install the required packages:
pip install -r requirements.txtEach model can be run independently:
# Run the Visual CNN approach
python visual_cnn/visual_cnn_approach.py
# Run the LSTM approach
python lstm/lstm_approach.py
# Run the ARIMA approach
python arima/arima_approach.py
# Run the XGBoost approach
python xgboost/xgboost_approach.py
# Run the Random Forest approach
python random_forest/random_forest_approach.pyTo run all models and compare their performance:
python compare_models.pyThis will:
- Fetch Bitcoin historical data (if not already downloaded)
- Run all five prediction approaches
- Generate comparison charts and tables
- Save the results to the 'results' directory
bitcoin-prediction-toolkit/
├── btc_prediction_toolkit.py # Common utility functions
├── compare_models.py # Script to run and compare all models
├── requirements.txt # Dependencies
├── README.md # This file
├── data/ # Directory for data files
├── models/ # Directory for saved models
├── results/ # Directory for results and visualizations
├── visual_cnn/ # Visual CNN approach
├── lstm/ # LSTM approach
├── arima/ # ARIMA approach
├── xgboost/ # XGBoost approach
└── random_forest/ # Random Forest approach
You can customize the models by modifying their parameters:
- Window Size: Number of previous days to consider (affects all models)
- Prediction Horizon: How many days ahead to predict (default is 1 day)
- Technical Indicators: Add or remove indicators in
btc_prediction_toolkit.py - Model Hyperparameters: Tune parameters in each model's script
Results will be saved in the 'results' directory, including:
- Model comparison metrics (accuracy, precision, recall, F1 score)
- Prediction visualizations for each model
- Feature importance charts for applicable models
This project is licensed under the MIT License - see the LICENSE file for details.
- Data is fetched from Yahoo Finance using the yfinance library
- Code is organized for educational purposes and can be extended for research or practical use