A simple Bitcoin price prediction app built with Python and Dash, using linear regression to forecast future BTC prices.
Check here for live demo: https://cryplot-0714.onrender.com/
- historical Bitcoin data
- Future price predictor for fun
- Upper and lower bond for price
- If current price is close to upper or lower bond, show it on top banner
This predictor is for educational and entertainment purposes only. Do NOT use this for actual financial decisions or investment advice. Cryptocurrency markets are highly volatile and unpredictable. Past performance does not guarantee future results.
This app uses simple linear regression to predict Bitcoin prices based on historical data:
- X-axis: Day number (1st day, 2nd day, 3rd day, etc.)
- Y-axis: Bitcoin prices (in USD) or log₂ transformed prices
- Model: Linear regression to find the best-fit line through historical data points
In original price data, recent prices change looks more obvious than early period data. It is quite misleading. Using log₂ (logarithm base 2) transformation will allow us easily compare early period's price data's change, or growth rate, with recent data.:
Meaningful Interpretation: Each unit increase in log₂ price represents a doubling of the original price. For example:
- If log₂(price) increases by 1, the actual price doubled
- If log₂(price) increases by 2, the actual price quadrupled
- Clone the repository:
git clone https://github.com/ZurichParis/cryplot-0714.git
cd cryplot-0714- Build the Docker image:
docker build -t cryplot .- Run the container:
docker run -p 8050:8050 cryplot- Access the app:
Open your browser and navigate to
http://localhost:8050
- Clone the repository:
git clone https://github.com/ZurichParis/cryplot-0714.git
cd cryplot-0714- Create a virtual environment:
python -m venv venv- Activate the virtual environment:
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run the application:
python app.py-
Access the app: Open your browser and navigate to
http://localhost:8050 -
Deactivate virtual environment (when done):
deactivateMake sure your requirements.txt includes:
dash==2.16.1
yfinance==0.2.65
pandas==2.2.1
plotly==5.19.0
numpy==1.26.4
scikit-learn==1.5.1
- Check that the app is running on
http://localhost:8050 - Look at the terminal output for any error messages
- Make sure no firewall is blocking the connection
This is an educational project. Feel free to fork and experiment, but remember: never use this for actual trading decisions!
This project is made by DL LIU for educational purposes only. Use at your own risk.
Remember: This is a toy model for learning purposes. Real financial markets are complex and cannot be predicted with simple linear regression. Always consult with qualified financial advisors for investment decisions.