An LSTM model to predict BTC price
This project explores Bitcoin price using an LSTM model and technical analysis indicators.
Tensorflow and Keras frameworks are adopted for the implementation.
pip install tensorflow
The historical data can be accessed by installing yfinance library (https://pypi.org/project/yfinance/).
pip install yfinance
With the help of an LSTM network, we will try to predict the future prices of Bitcoin. In order to do this, we used data a based on its price of the past 11 years and calculated technical analysis indicators. We also included the traded volume as an explanatory variable. The historical data can be accessed by installing yfinance library (https://pypi.org/project/yfinance/).
In time series problems, we have to predict (forecast) a value at day (time) T, based on the data from N days before, starting at day T-N. We will try predicting the adjusted close stock price of BTC based on the past N=60 days. One could try different values of N and see how precision of the forecasting algorithm changes with the length of the interval.
We start feature exploration with a simple univariate model, then gradually add more predictors into the model. The RSI did not improve the performance, but the volume did. We use RMSE test score and validation error to compare different models and their performance.
We chose the RMSE metric to assess how well the estimated model fits the data–how close the observed actual is to the predicted values. RMSE can be interpreted as the standard deviation of the unexplained variance. Lower values of RMSE indicate better fit.
The model should improve significantly if other variables that capture the most recent volatility were included. The Global Liquidity Index could be an option.
- "Time Series Forecasting with LSTMs and Prophet", Maximilian Strauß https://tinyurl.com/62vbrx3m
- Chapter 6, "Deep Learning with Python",Francois Chollet
- Chapter 15, "Hands-on Machine Learning with Sciki-Learn & TensorFlow", Aurélien Géron, O'Reilly 2019
- Fork this project
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request