This repository contains a predictive model for Bitcoin pricing, focusing on periods near historical all-time highs (ATH), particularly in the context of the Bitcoin halving events. The code implements a structured approach to estimate future Bitcoin prices by analyzing patterns of average volatility during near-ATH periods and applying a consistent, small, optimistic growth assumption to simulate potential price trajectories. The model utilizes historical Bitcoin data to identify these near-ATH periods, calculates the average volatility, and defines increments for future price estimation. The prediction spans from the last recorded date in the data to a future date calculated over several years.
- Halving Events Analysis: Analyzes Bitcoin halving events as significant market indicators.
- Visualization: Provides intuitive plots for comparing actual and predicted prices.
- Average Volatility The methodology presented in the document focuses on using historical Bitcoin data, specifically when the price is near its all-time high, to predict future prices. By calculating the average volatility during these periods and assuming a consistent, small positive growth based on this volatility, the approach aims to estimate future Bitcoin prices systematically. Using a threshold to define 'near all-time high' periods and the specific formulae for calculation offer a structured predictive model.
To predict future Bitcoin prices, follow these steps:
Let:
P_t
: Bitcoin price at timet
t
: time in dayst_0
: last recorded date in the historical datat_f
: future date(t_f = t_0 + 1, 2, ..., 365 * 7 days)
P_max
: maximum historical Bitcoin priceThreshold
: threshold for 'near all-time high' periods,Threshold = 0.05 * P_max
The estimation process is as follows:
-
Calculate the maximum historical Bitcoin price:
P_max = max(BTC Data)
-
Filter data to include periods near the all-time high:
NearATH Data = BTC Data[P_t >= (P_max - Threshold)]
-
Calculate the average volatility during these near all-time high periods:
ATH Average Volatility = mean(Volatility(NearATH Data))
-
Assume a small positive increment for consistent growth:
Increment = 0.1 * ATH Average Volatility
-
Estimate future prices using the increment:
P_t = P_{t-1} + Increment
fort = t_0 + 1, ..., t_f
- Not Financial Advice: The predictions generated by this code are for educational purposes only and should not be construed as financial or investment advice. The author and contributors to this repository are not responsible for any financial losses incurred from decisions made based on the code's outputs.
- No Responsibility: The creators of this project bear no responsibility for any financial losses.
- Accuracy Not Guaranteed: There is no guarantee of the predictive performance of these models.
- Independent Research: Users should conduct their research and consult professionals.
- Compliance with Laws: Ensure compliance with all applicable laws and regulations in your jurisdiction.
- Python 3.11
- Git
First, create and activate a virtual environment:
python -m venv .venv # Create a virtual environment
source .venv/bin/activate # Activate on macOS and Linux
.venv\Scripts\activate # Activate on Windows
Install the required dependencies:
pip install -r requirements.txt # Install Python dependencies
npm install dukascopy-node --save # Install Node.js dependencies
chmod +x data-download.sh
./data-download.sh
- Use PowerShell or Git Bash for shell commands.
- Ensure Docker Desktop for Windows is set to Linux containers.
- Python commands may require using
py
instead ofpython
orpython3
.
To get started, clone the repository:
git clone git@github.com:SMARTSHEEP-IO/bitcoin-price-prediction-analysis-simulating-growth-near-ath-halving.git
Execute the main.py
script to start the data processing and model training/prediction process:
python main.py
- Farsi Channel: Dr. Samizadeh
- English Channel: Programming in 10 Minutes
Contributions to improve the project are welcome. Please adhere to standard open-source contribution guidelines.
If you use this project in your research or in any project, please cite it using the following:
Samizadeh, Iman. (2024). BITCOIN PRICE PREDICTION AND ANALYSIS BY SIMULATING CONSISTENT GROWTH NEAR ALL-TIME HIGH. Version 1.0. SMARTSHEEP-IO. [Online]. Available: https://github.com/SMARTSHEEP-IO/bitcoin-price-prediction-analysis-simulating-growth-near-ath-halving
@misc{Samizadeh2024Bitcoin,
author = {Samizadeh, Iman},
title = {{BITCOIN PRICE PREDICTION AND ANALYSIS BY SIMULATING CONSISTENT GROWTH NEAR ALL-TIME HIGH}},
year = {2024},
howpublished = {\url{https://github.com/SMARTSHEEP-IO/bitcoin-price-prediction-analysis-simulating-growth-near-ath-halving}}
}
Credit: https://github.com/Leo4815162342/dukascopy-node
Keywords: Bitcoin, Halving, Prediction, Volatility, Growth, ATH, Cryptocurrency, Analysis, Financial Modeling