0% found this document useful (0 votes)
15 views6 pages

Bitcoin-Price-Prediction Using LSTM

about bitcoin price prediction

Uploaded by

lohithjalla12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views6 pages

Bitcoin-Price-Prediction Using LSTM

about bitcoin price prediction

Uploaded by

lohithjalla12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Bitcoin price prediction using LSTM Algorithms

Bandaru.Srinadh Alaparthy.Abhiram
Department of Computer Science and Engineering Department of Computer Science and Engineering
Vignan’s Foundation for Science, Technology and Research Vignan’s Foundation for Science, Technology and Research
Vadlamudi, Guntur Vadlamudi, Guntur
Andhra Pradesh, India Andhra Pradesh, India
[email protected] [email protected]

Kandula.Kavya Sree Jalla.Lohith


Department of Computer Science and Engineering Department of Computer Science and Engineering
Vignan’s Foundation for Science, Technology and Research Vignan’s Foundation for Science, Technology and Research
Vadlamudi, Guntur Vadlamudi, Guntur
Andhra Pradesh, India Andhra Pradesh, India
[email protected] [email protected]

Syed Shareefunnisa
Asst.Professor,Department of CSE
Vignan’s Foundation for Science, Technology and Research
Vadlamudi, Guntur
Andhra Pradesh, India
[email protected]

Abstract—The market’s intrinsic volatility and the influence of has gained significant importance. The ability to predict cryp-
outside variables like investor emotion and economic indicators tocurrency prices is crucial for shaping investment strategies
make it difficult to predict cryptocurrency prices. This study and navigating market behavior. However, the high volatility
investigates several data mining techniques to raise the predicting
accuracy of bitcoin prices. We use sentiment analysis, machine of cryptocurrencies, influenced by elements including market
learning methods, and time series analysis in combination to attitude, modifications to regulations, and technological devel-
model price movements more effectively. Traditional forecasting opments, presents unique challenges for accurate forecasting.
methods, including ARIMA and GARCH, are used alongside This makes reliable prediction models essential for investors
advanced neural networks and ensemble methods to capture looking to optimize their portfolios and manage risks effec-
complex, non-linear patterns in the data. Additionally, the study
highlights the critical role of feature engineering and the ap- tively.
plication of clustering strategies to enhance predictive model Despite advancements in predictive analytics, achieving
performance.The integration of these approaches demonstrates high accuracy in cryptocurrency price forecasting remains
a marked improvement in forecasting outcomes, providing not difficult due to the complex and unpredictable nature of market
only more accurate price predictions but also valuable insights forces. This paper seeks to address these challenges by offering
into market dynamics. These findings can assist investors in
developing more robust investment strategies, allowing them to a comprehensive review of current cryptocurrency prediction
better navigate the cryptocurrency market’s risks. Our findings methodologies, identifying research gaps, and introducing
highlight how hybrid models can improve predictive capabilities novel hybrid models that integrate various machine learning
and understanding market behavior in the evolving landscape of techniques. These models are evaluated against benchmark
digital assets. datasets to assess their accuracy, providing valuable insights
Keywords— Forecasting the price of cryptocurrencies, into their potential real-world trading applications. The find-
analyzing time series, machine learning, , Sentiment ings aim to contribute to improved predictive capabilities,
Analysis, ARIMA, GARCH, Neural Networks, Ensemble fostering more informed investment decisions in the volatile
Methods, Feature Engineering, Clustering Techniques, cryptocurrency market
Market Volatility
II. L ITERATURE R EVIEW
I. I NTRODUCTION Here’s the literature review with citations in pairs for all 20
Cryptocurrency price prediction has become a key focus references:
of research within the financial sector, driven by the rapid Fang et al. [1] exploredynamics, while Khaniki et al. [2]
rise of digital assets like Bitcoin and Ethereum. As both indi- focus on enhancing price prediction accuracy by employing
vidual and institutional investors flock to these decentralized a Transformer Neural Network combined with technical in-
assets, understanding the dynamics behind price movements dicators. Both studies emphasize the importance of advanced
machine learning techniques in capturing the complex depen- models to adjust to shifting market circumstances, demon-
dencies and patterns within cryptocurrency price movements, strating the usefulness of reinforcement learning in dynamic
contributing to a more profound understanding of digital asset environments.
markets. Poongodi et al. [19] apply machine learning to predict
Thumu et al. [3] introduce a multi-kernel support vector Ethereum prices in an industrial finance context, integrating
regression approach, which increases prediction precision by blockchain data for more accurate forecasts. Lastly, Chen et
handling non-linear patterns in cryptocurrency price data. Koo al. [20] use sample dimension engineering to improve Bitcoin
et al. [4] propose a centralized decomposition approach using price prediction, enhancing model performance in handling
LSTM networks, highlighting their effectiveness in capturing sparse and noisy data, thus advancing prediction reliability in
sequential cryptocurrency data, contributing to better predic- cryptocurrency markets..
tion outcomes in dynamic markets.
Zhang et al. [5] investigate the integration of hybrid deep III. M ETHODOLOGY
learning models that combine CNNs and LSTMs to predict The methodology for cryptocurrency price prediction in-
cryptocurrency prices. Similarly, to increase prediction ac- volves collecting historical price and relevant market data,
curacy and robustness, Rather et al. [6] offer an ensemble followed by data preprocessing to clean and normalize the
learning technique that integrates several model outputs.both dataset. Key features are selected through correlation analysis,
highlighting how hybrid approaches and ensemble methods and various machine learning models are trained and evalu-
enhance the prediction reliability of cryptocurrency prices. ated. Finally,Metrics like RMSE and others are used to eval-
Oyedele et al. [7] compare deep learning models and uate the model’s performance,MAE, along with visualization
boosted trees, concluding that deep learning techniques pro- and backtesting to ensure robustness.
vide better accuracy in predicting closing prices, while Akila
et al. [8] explore deep learning models that leverage time
series data, demonstrating how neural networks can effectively
process temporal information, leading to more informed price
forecasting.
Chang et al. [9] develop a ternary-frequency prediction
scheme by combining clustering techniques with intrinsic
mode function reconstruction to improve performance in
volatile markets, whereas Kim et al. [10] integrate on-chain
data into their model to improve prediction accuracy, high-
lighting the importance of blockchain-specific information for
cryptocurrency price predictions.
Patel et al. [11] provide an extensive survey on the recent
advancements in cryptocurrency price prediction, particularly
highlighting the fusion of deep learning and technical indica-
tors. Parekh et al. [12] extend this research by introducing
the DL-GuesS model, combining deep learning with senti-
ment analysis to account for emotional drivers behind price
movements, showcasing the psychological aspects influencing
market behavior.
Pai et al. [13] focus on LSTM models for time series predic-
tion, which capture the sequential dependencies in cryptocur-
rency prices, while Haryadi et al. [14] apply use support vector
regression to forecast the costs of Polkadot cryptocurrency, Fig. 1. Flowchart
expanding predictive modeling techniques beyond Bitcoin and
Ethereum. A. 1. Data Preprocessing
Khedr et al. [15] review both machine learning and conven-
tional statistical methods, providing insights into the benefits • Clean the Data:
and drawbacks of various approaches. Tanwar et al. [16] in- – Missing Values: Check for any gaps in your data. If
troduce a deep learning model that captures interdependencies there are missing entries, fill them in using methods
between cryptocurrencies, improving prediction accuracy by like averaging the surrounding values or just remov-
modeling relationships between different digital assets. ing them if they’re minimal.
Hamayel et al. [17] combine GRU, LSTM, and bi-LSTM to – Outliers: Identify any unusual spikes or drops in
create a hybrid model that performs well on sequential data, prices that don’t seem normal and decide how to
while Shahbazi et al. [18] leverage reinforcement learning handle them—either by adjusting or removing them.
helps enhance the forecasting of bitcoin prices, enabling • Transform the Data:
– Normalization: Adjust the data so that all features • Train the Models: Use your training data to teach the
are on a similar scale. This is especially important models how to predict prices, checking how well they
for models that are sensitive to the range of the data. perform on the validation data.
– Date Handling: Make sure your dates are in the right
format and create new features from them, like the D. 4. Model Evaluation and Analysis
day of the week or month, which might help the • Performance Metrics: After training, evaluate how well
model understand patterns. your model predicts prices using metrics like MAE (Mean
• Split the Data: Divide your data into three parts: training Absolute Error) and Root Mean Square Error(RMSE).
(70%), validation (15%), and testing (15%). This way, • Visualization: Create graphs to compare predicted prices
you can train the model on one set and test it on another. against actual prices. This visual inspection helps identify
how well your model is doing.
TABLE I • Backtesting: Test your model with past data to see how
ATTRIBUTE DATA well it would have performed in a real trading scenario.
Attribute Description • Comparison: Look at the results of different models to
Timestamp Date and time find out which one works best.
Open price Starting price • Robustness Check: Finally, use cross-validation tech-
Close price Ending price
High price Maximum price niques to ensure your model performs well across various
Low price Minimum price data subsets.
Volume Total traded amount
Market capitalization Total market value 1. Root Mean Square Error (RMSE)
Moving average Average price over time
Relative strength in- Momentum oscillator v
dex (RSI) u n
Sentiment score Market sentiment analysis
u1 X
RMSE = t (yi − ŷi )2 (1)
Transactions count Total transactions n i=1
Active addresses Unique user addresses
Total supply Maximum coin quantity
Where:
The dataset is split as follows: – yi = actual price
• Training set: 70% (2,259 rows) – ŷi = predicted price
• Validation set: 15% (484 rows) – n = number of observations
• Testing set: 15% (485 rows) Explanation: The average size of the discrepancies
between expected and actual values is measured by
B. 2. Feature Selection
RMSE,giving higher weight to larger errors.
• Choose Key Features: Identify the most important fac-
tors that could influence price changes, such as past prices 2. Mean Absolute Error (MAE)
and trading volume.
• Correlation Analysis: Look at how these features relate 1X
n
to the price. You can use heatmaps to visualize these MAE = |yi − ŷi | (2)
n i=1
relationships.
• Create New Features: Develop additional features that Where:
might be helpful, like calculating averages over certain
– yi = actual price
time periods or tracking social media sentiment.
– ŷi = predicted price
• Dimensionality Reduction: If you have a lot of features,
– n = number of observations
consider reducing them using techniques like PCA (Prin-
cipal Component Analysis) to make your model more Explanation: In order to provide a clear interpretation
efficient. of model accuracy, MAE computes the average absolute
disparities between predicted and actual values.
C. 3. Model Training
• Select Models: Choose which types of models you want IV. SUPERVISED LEARNING ALGORITHMS
to use for prediction. Options include: Bitcoin price prediction is a time-series forecasting prob-
– Linear Regression for straightforward relationships. lem, typically addressed using supervised learning algo-
– Decision Trees for more complex patterns. rithms, where historical data is used to predict future
– LSTM (Long Short-Term Memory) networks if you prices. Among the various approaches,Because it can
want to capture trends over time. capture temporal dependencies in sequential data, the
• Tune Hyperparameters: Adjust the settings of your Long Short-Term Memory (LSTM) model, a form of
models to improve their performance. You can do this Recurrent Neural Network (RNN), has shown itself to
through techniques like Grid Search. be quite effective.
1)Long Short-Term Memory (LSTM)
Recurrent neural networks (RNNs) of the LSTM type
are made to handle sequential data by preserving mem-
ory across lengthy sequences. Because temporal depen-
dencies are crucial in time-series prediction, like cryp-
tocurrency prices, this makes it especially appropriate.
By effectively capturing long-term dependencies, LSTM
networks help RNNs avoid the vanishing gradient issue.
The following set of equations governs the model’s gates:
Fig. 2. Predicted vs. Actual Bitcoin Prices

ft = σ(Wf · [ht−1 , xt ] + bf )
B. Training and Validation Loss
it = σ(Wi + bi ) · [ht−1 , xt ] Figure 3 illustrates the training and validation loss values
across 100 epochs during the training of the LSTM model. The
The formula is t = tanh(WC · [ht−1 , xt ] + bC ) decreasing trends of both training and validation loss indicate
It ∗ C̃t + ft ∗ Ct−1 = Ct that the model is learning effectively and generalizing well
to unseen data. The gap between the two curves is minimal,
ot = σ(Wo + bo ) · [ht−1 , xt ] suggesting that the model is not overfitting, which is crucial
for ensuring reliable predictions in real-world applications.
Ast tanh(Ct ) = ot ht ]
LSTM is highly effective in sequential data modeling, such
as price time series, allowing it to learn patterns and trends
across time.
These supervised learning algorithms are particularly effec-
tive in predicting cryptocurrency prices by analyzing histor-
ical data and identifying patterns. aining price formation in
cryptocurrency markets with machine learning. The European
Journal of Finance, 30(1), 78-100.

Algorithm 1 Bitcoin price prediction using LSTM


1) Feature Selection: Select features from the dataset.
2) Ensemble Classifiers:
3) Train the model Ci on the training dataset.
4) Generate predictions Pi for each model on the valida-
tion/test set. Fig. 3. Training and Validation Loss
5) make predictions:
6) Convert continuous predictions P to discrete labels.
7) Return the results. C. Error Distribution
Figure 4 shows how the prediction errors produced by
the LSTM model are distributed. The bulk of prediction
V. R ESULTS errors, according to the histogram, cluster closely around 0,
indicating that the model typically produces quite accurate
The outcomes of the LSTM model are shown in this
projections. This clustering suggests that the model regularly
section.For Bitcoin price prediction, including visualizations
forecasts values that are near to the actual results, reducing
and performance metrics.
significant deviations and improving the outputs’ overall de-
pendability.The smooth kernel density estimate (KDE) curve,
A. Prediction vs. Actual Price
which is superimposed on the histogram, offers additional
Figure 2 shows the comparison between the predicted information about the error distribution. The concentration of
Bitcoin prices as well as the real past prices. The orange errors around zero is reflected in the KDE curve’s noticeable
line shows the expected prices for the same time period, peak. This peak shows that the model successfully maintains
and the blue line shows the actual prices. The two lines’ low error margins over the majority of predictions, indicating
near alignment suggests that the trends are well captured by that high prediction mistakes are uncommon.demonstrates that
the LSTM model in Bitcoin pricing, providing a promising the LSTM model generates impartial, trustworthy predictions
approach for future price forecasting. with little significant deviations. Because it exhibits both
precision and consistency, this feature qualifies it for tasks effectiveness of the LSTM approach in forecasting Bitcoin
requiring high prediction accuracy and stability. prices. Overall, these metrics reflect the model’s reliability and
robustness.these performance metrics are critical because they
help evaluate the model’s real-world applicability. Given the
volatile nature of cryptocurrency markets, achieving a balance
between prediction accuracy (low RMSE/MAE) and model
reliability (high R²) is crucial. Low error rates suggest that the
model can provide providing traders and investors with useful
information so they may decide wisely with higher confidence.

Fig. 4. Error Distribution of Predictions

D. Feature Importance
Figure 5 showcases the importance of various features used
in the LSTM model for forecasting the price of Bitcoin.
The features are ranked in the bar plot according to how
much they contribute to the model’s predictions. The findings
show that the opening and closing prices have the greatest
influence, with other technical indicators like the Exponential
Moving Average (EMA) and Relative Strength Index (RSI)
Fig. 6. Confusion Matrix
coming in second and third, respectively.Understanding feature
importance is vital for refining the model and enhancing
its predictive capabilities.The results show that the opening TABLE II
price and closing price are the two most influential variables, P ERFORMANCE M ETRICS FOR LSTM M ODEL
emphasizing the strong predictive power of these basic price
Metric Value
indicators. RMSE 1385.08
MAE 0.03
R-squared 0.90
Training Epochs 100

VI. C ONCLUSION
The LSTM model effectively predicts Bitcoin prices, as
demonstrated by the close alignment of predicted values with
actual prices and low error metrics. the LSTM model offers
a robust and reliable approach to Bitcoin price prediction,
capable of providing valuable insights for dealers, financiers,
and investors analysts looking to navigate the highly volatile
cryptocurrency market. By leveraging historical data and tech-
nical indicators, the model achieves a strong balance between
prediction accuracy and generalization, making it An effective
Fig. 5. Feature Importance for Bitcoin Price Prediction instrument in the realm of finance forecasting.
R EFERENCES
E. Performance Metrics [1] Fang, F., Chung, W., Ventre, C., Basios, M., Kanthan, L., Li, L., Wu,
Table II summarizes the key performance metrics of the F. (2024). Ascert
[2] Khaniki, M. A. L., Manthouri, M. (2024). Enhancing Price Prediction
LSTM model. Both the Mean Absolute Error (MAE) and in Cryptocurrency Using Transformer Neural Network and Technical
Root Mean Square Error (RMSE) are low, suggesting that Indicators. arXiv preprint arXiv:2403.03606.
the model’s predictions closely match the actual data. The [3] Thumu, S. R., Nellore, G. (2024). Improving Cryptocurrency Price
Prediction Accuracy with Multi-Kernel Support Vector Regression Ap-
anticipated and actual prices have a significant association, proach. International Research Journal of Multidisciplinary Technova-
as indicated by the R-squared value of 0.90,confirming the tion, 6(4), 20-31.
[4] Koo, E., Kim, G. (2024). Centralized decomposition approach in LSTM
for Bitcoin price prediction. Expert Systems with Applications, 237,
121401.
[5] Otabek, S., Choi, J. (2024). From prediction to profit: A comprehen-
sive review of cryptocurrency trading strategies and price forecasting
techniques. IEEE Access.
[6] Rather, A. M. (2023). A new method of ensemble learning: case of
cryptocurrency price prediction. Knowledge and Information Systems,
65(3), 1179-1197.
[7] Oyedele, A. A., Ajayi, A. O., Oyedele, L. O., Bello, S. A., Jimoh,
K. O. (2023). Performance evaluation of deep learning and boosted
trees for cryptocurrency closing price prediction. Expert Systems with
Applications, 213, 119233.
[8] Akila, V., Nitin, M. V. S., Prasanth, I., Reddy, S., Kumar, A. (2023).
A Cryptocurrency Price Prediction Model using Deep Learning. In E3S
Web of Conferences (Vol. 391, p. 01112). EDP Sciences.
[9] Chang, T. J., Lee, T. S., Yang, C. T., Lu, C. J. (2023). A ternary-
frequency cryptocurrency price prediction scheme by ensemble of clus-
tering and reconstructing intrinsic mode functions based on CEEMDAN.
Expert Systems with Applications, 233, 121008.
[10] Kim, G., Shin, D. H., Choi, J. G., Lim, S. (2022). A deep learning-
based cryptocurrency price prediction model that uses on-chain data.
IEEE Access, 10, 56232-56248.
[11] Patel, N. P., Parekh, R., Thakkar, N., Gupta, R., Tanwar, S., Sharma,
G., ... Sharma, R. (2022). Fusion in cryptocurrency price prediction: A
decade survey on recent advancements, architecture, and potential future
directions. IEEE Access, 10, 34511-34538.
[12] Parekh, R., Patel, N. P., Thakkar, N., Gupta, R., Tanwar, S., Sharma, G.,
... Sharma, R. (2022). DL-GuesS: Deep learning and sentiment analysis-
based cryptocurrency price prediction. IEEE Access, 10, 35398-35409.
[13] Aditya Pai, B., Devareddy, L., Hegde, S., Ramya, B. S. (2022). A
time series cryptocurrency price prediction using LSTM. In Emerging
Research in Computing, Information, Communication and Applications:
ERCICA 2020, Volume 2 (pp. 653-662). Springer Singapore.
[14] Haryadi, D., Hakim, A. R., Atmaja, D. M. U., Yutia, S. N. (2022).
Implementation of support vector regression for polkadot cryptocurrency
price prediction. JOIV: International Journal on Informatics Visualiza-
tion, 6(1-2), 201-207.
[15] Khedr, A. M., Arif, I., El-Bannany, M., Alhashmi, S. M., Sreedharan,
M. (2021). Cryptocurrency price prediction using traditional statistical
and machine-learning techniques: A survey. Intelligent Systems in
Accounting, Finance and Management, 28(1), 3-34.
[16] Tanwar, S., Patel, N. P., Patel, S. N., Patel, J. R., Sharma, G., David-
son, I. E. (2021). Deep learning-based cryptocurrency price prediction
scheme with inter-dependent relations. IEEE Access, 9, 138633-138646.
[17] Hamayel, M. J., Owda, A. Y. (2021). A novel cryptocurrency price
prediction model using GRU, LSTM and bi-LSTM machine learning
algorithms. Ai, 2(4), 477-496.
[18] Shahbazi, Z., Byun, Y. C. (2021). Improving the cryptocurrency price
prediction performance based on reinforcement learning. IEEE Access,
9, 162651-162659.
[19] Poongodi, M., Sharma, A., Vijayakumar, V., Bhardwaj, V., Sharma, A.
P., Iqbal, R., Kumar, R. (2020). Prediction of the price of Ethereum
blockchain cryptocurrency in an industrial finance system. Computers
Electrical Engineering, 81, 106527.
[20] Chen, Z., Li, C., Sun, W. (2020). Bitcoin price prediction using machine
learning: An approach to sample dimension engineering. Journal of
Computational and Applied Mathematics, 365, 112395.

You might also like