0% found this document useful (0 votes)
44 views22 pages

Electronics 11 02349 v2

Uploaded by

alperen.unal89
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)
44 views22 pages

Electronics 11 02349 v2

Uploaded by

alperen.unal89
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/ 22

electronics

Article
Deep Learning Algorithm to Predict Cryptocurrency
Fluctuation Prices: Increasing Investment Awareness
Mohammed Abdullah Ammer 1,2 and Theyazn H. H. Aldhyani 1,3, *

1 The Saudi Investment Bank Chair for Investment Awareness Studies, The Deanship of Scientific Research,
The Vice Presidency for Graduate Studies and Scientific Research, King Faisal University,
Al-Ahsa 31982, Saudi Arabia; [email protected]
2 Department of Finance, School of Business, King Faisal University, Al-Ahsa 31982, Saudi Arabia
3 Applied College in Abqaiq, King Faisal University, P.O. Box 400, Al-Ahsa 31982, Saudi Arabia
* Correspondence: [email protected]

Abstract: Digital currencies such as Ethereum and XRP allow for all transactions to be carried out
online. To emphasize the decentralized nature of fiat currency, we can refer, for example, to the fact
that all virtual currency users may access services without third-party involvement. Cryptocurrency
price swings are non-stationary and highly erratic, similarly to the price changes of conventional
stocks. Owing to the appeal of cryptocurrencies, both investors and researchers have paid more
attention to cryptocurrency price forecasts. With the rise of deep learning, cryptocurrency forecasting
has gained great importance. In this study, we present a long short-term memory (LSTM) algorithm
that can be used to forecast the values of four types of cryptocurrencies: AMP, Ethereum, Electro-
Optical System, and XRP. Mean square error (MSE), root mean square error (RMSE), and normalize
root mean square error (NRMSE) analyses were used to evaluate the LSTM model. The findings
obtained from these models showed that the LSTM algorithm had superior performance in predicting
all forms of cryptocurrencies. Thus, it can be regarded as the most effective algorithm. The LSTM
model provided promising and accurate forecasts for all cryptocurrencies. The model was applied
Citation: Ammer, M.A.; Aldhyani, to forecast the future closing prices of cryptocurrencies over a period of 180 days. The Pearson
T.H.H. Deep Learning Algorithm to correlation metric was applied to assess the correlation between the prediction and target values in
Predict Cryptocurrency Fluctuation
the training and testing processes. The LSTM algorithm achieved the highest correlation values in
Prices: Increasing Investment
training (R = 96.73%) and in testing (96.09%) in predicting XRP currency prices. Cryptocurrency prices
Awareness. Electronics 2022, 11, 2349.
could be accurately predicted using the established LSTM model, which displayed highly efficient
https://doi.org/10.3390/
electronics11152349
performance. The relevance of applying these models is that they may have huge repercussions for
the economy by assisting investors and traders in identifying trends in the sales and purchases of
Academic Editor: Amir Mosavi
different types of cryptocurrencies. The results of the LSTM model were compared with those of
Received: 5 July 2022 existing systems. The results of this study demonstrate that the proposed model showed superior
Accepted: 24 July 2022 accuracy based on the low prediction errors of the proposed system.
Published: 28 July 2022
Keywords: cryptocurrency; artificial intelligence; deep learning; prediction model
Publisher’s Note: MDPI stays neutral
with regard to jurisdictional claims in
published maps and institutional affil-
iations.
1. Introduction
Several cryptocurrencies, such as Ethereum, have emerged since Satoshi Nakamoto
originally created the cryptocurrency known as Bitcoin in 2008 [1]. Currently, cryptocur-
Copyright: © 2022 by the authors. rency significantly influences the world’s financial markets and is becoming more com-
Licensee MDPI, Basel, Switzerland. monplace in daily life. Cryptocurrencies have grown in popularity as a means of making
This article is an open access article speculative investments and day-to-day purchases of goods and services. Forgery and
distributed under the terms and
falsification may be prevented using decentralized ledgers with blockchain technology,
conditions of the Creative Commons
which has received much interest [2,3]. In addition to the Internet of Things, blockchain
Attribution (CC BY) license (https://
technology has been used in a wide range of industries because of its high security and
creativecommons.org/licenses/by/
simplicity of administration. Cryptocurrency does not have a central authority, which
4.0/).

Electronics 2022, 11, 2349. https://doi.org/10.3390/electronics11152349 https://www.mdpi.com/journal/electronics


Electronics 2022, 11, 2349 2 of 22

removes central banks from the money supply management process. In contrast to more
stable financial assets, the cryptocurrency price has an unusually wide range of movement
(e.g., in relation to gold, stock indexes, and commodities).
Price movement and transaction volume are important factors that determine the
value of each cryptocurrency. Furthermore, each cryptocurrency has its own characteristics
(i.e., value deviations, transaction speed, usages, ecosystem, and unpredictability). Owing
to the independence of cryptocurrencies, forecasting their prices is a challenging task. For
example, the price of the most well-known cryptocurrency, Bitcoin, during the period from
2009 to 2017 climbed from practically nothing to approximately USD 20,000, attracting the
attention of both investors and policymakers. This significant gain in its price was followed
by a continuous expansion of the Bitcoin market. As of December 2019, the average daily
market volume was roughly USD 19.45 billion, according to CoinMarketCap. When used as
money, Bitcoin has various qualities, including decentralized transactions, auditability, and
anonymity [4,5]. Despite the fact that Bitcoin has been regarded as a bubble and a danger
to the stability of the financial system [6], it continues to be pitched as an appealing and
possibly high-earning investment alternative. On the other hand, the dangers associated
with investing in Bitcoin are great. The price of Bitcoin is far more volatile than the prices
of traditional financial assets such as stocks and bonds [7,8].
Empirical asset pricing is a prominent field of financial study that has been researched
extensively. It has become relatively popular to use machine learning (ML) approaches in
this sector because of their capacity to dynamically make selections among a potentially
enormous number of characteristics and to understand complicated, high-dimensional
correlations between features and goals [9]. The pricing of shares and bonds has been the
subject of extensive studies, which have examined numerous potentially market-predictive
factors [10]. However, little attention has been dedicated to the unique stream of cryptocur-
rency pricing research. No thorough examination of the predictability of the cryptocurrency
market, particularly in the short term, has been performed to date. Furthermore, most
research studies have focused primarily on technical aspects and have not examined the
impacts of the features of ML models that have been utilized [11]. This is the context in
which we attempted to close the research gap by comparing and contrasting various ML
models for forecasting the market movements of some important cryptocurrencies at the
time of the study. Even though Bitcoin had a market valuation of approximately 170 billion
US dollars as of September 2020, accounting for approximately 58% of the cryptocurrency
market [12], we focused on other cryptocurrencies such as AMP, Ethereum, Electro-Optical
System (EOS), and XRP, as prior studies have been limited to Bitcoin.
Financial market forecasting is a well-established discipline of financial research.
Regarding the predictability and efficiency of financial markets, a contradictory body
of information exists [13,14]. Regression analysis of probable signals with the aim of
explaining asset returns is a well-established method of analyzing return-predictive signals
and it has been used for many years [15,16]. Various characteristics may be included in
linear regressions, but they are not flexible in their incorporation and they impose strict
assumptions on the functional form of how signals suggest market movements. On the
other hand, ML approaches are increasingly being used for financial market prediction
because they do not impose these limits [17]. Neuronal network-based approaches, which
have previously been characterized as the leading methods for forecasting the dynamics of
financial markets, may be especially well suited among such methods [18].
Several academics have examined the degree of market efficiency in the Bitcoin market
across various periods, and their findings have been published. Time series prediction
techniques such as the simple exponential smoothing, univariate autoregressive (AR), and
autoregressive-integrated moving average (ARIMA) methods have been used for some
time [19]. According to Kaiser [20], time series models have been utilized to investigate
the seasonality trends associated with Bitcoin trading. Time series methods were not able
to capture long-term dependencies in the face of significant volatility, which is a hallmark
of the cryptocurrency market due to the very nature of the market itself. In contrast to
Electronics 2022, 11, 2349 3 of 22

this, ML strategies such as neural networks use iterative optimization methods such as
“gradient descent” in conjunction with hyperparameter tweaking to obtain the optimal
solution that best fits the data [21]. As a result, ML methods have been applied for asset
price/return prediction in recent years by incorporating nonlinearity [22], showing a higher
prediction accuracy than that of traditional time series models [23–25]. The difficulty is that
the published research on predicting cryptocurrency prices does not present a significant
number of examples of ML applications. Artificial intelligence allows for the capturing of
the nonlinear characteristics of the severe volatility of cryptocurrency prices, in contrast to
the standard linear statistical models such as the ARIMA approach [26]. This is possible
because artificial intelligence is capable of learning.
In the field of artificial intelligence, ML is considered a type of artificial intelligence
that can forecast future prices by analyzing present and past data. Previous research has
shown that model-based forecasting models have many advantages over other forecasting
models. They produce results that are exactly or nearly the same as the actual results, thus
improving upon the precision and accuracy of the models. Owing to these advantages,
model-based forecasting models have more advantages than other forecasting models.
Deep learning, also known as neural networks, as well as support vector machines (SVM)
and other similar approaches, are ML methods that may be utilized. A previous study [27]
demonstrated that the inclusion of cryptocurrencies in a portfolio boosts the efficiency of
the portfolio in two distinct ways, proving the authors’ assertions. The first objective in
that study was to reduce the standard deviation, and the second objective was to provide
investors with a wider range of options for asset allocation. It was hypothesized that
the optimal allocation of cryptocurrencies should lie anywhere between 5% and 20%,
depending on the investor’s level of risk tolerance. They employed two different ML
approaches, random forests (RF) and a stochastic gradient boosting machine (SGBM), in
time series data forecasting. The authors of [28] utilized an SGBM strategy based on a ML
ensemble approach to estimate Bitcoin prices.
Making the proper choice at the appropriate time is critical to reducing the risks
associated with the investment process, and this can be achieved through careful planning.
With an emphasis on two cryptocurrencies, Litecoin and Monero, the authors of [29]
offered a hybrid cryptocurrency prediction system based on the long short-term memory
(LSTM) and gated recurrent unit (GRU) approaches. In a study by Huang et al. [30],
high-dimensional technical indicators were used to predict daily Bitcoin returns using
tree-based prediction models from January 2012 to December 2017. They discovered that
technical analyses can be useful in the markets of assets with difficult-to-value fundamentals
(e.g., Bitcoin). Chen et al. [31] used various ML approaches to forecast the direction of
Bitcoin price changes. Researchers showed that relatively basic approaches (e.g., logistic
regressions) outperformed more complicated algorithms (e.g., recurrent neural networks
(RNNs)). when data were collected between February 2017 and February 2019. A class
split can be used to determine the direction of the price movement; however, an uneven
training set is likely to arise, which may lead to erroneous conclusions [32]. Unbalanced
training sets may lead classifiers to consistently forecast the majority class, especially for
financial time series, which are often noisy. In predicting the volatility of cryptocurrencies,
Peng et al. [33] used support vector regression (SVR). More recently, a few studies have
used deep learning models to estimate financial market prices, as they have shown higher
performance than their shallow learning counterparts [34,35]. For example, Altan et al. [36]
used an LSTM neural network to uncover nonlinear features of the Bitcoin price time series,
which were previously unknown.
Previous studies [37–40] have employed classic ML techniques to the forecasting of
Bitcoin prices, including random forest, XGBoost, and SVM. On the other hand, traditional
ML algorithms cannot capture the temporal dependence of time series. Deep learning
approaches [41–43] such as RNNs have recently been developed to deal with the problem of
temporal dependence. However, because of the diminishing gradient, RNNs have shown
difficulty in learning long-term relationships in the data. The LSTM and GRU versions of
Electronics 2022, 11, 2349 4 of 22

RNN, which are the most frequently used types of RNN, can solve the vanishing gradient
issue. For example, the LSTM network was employed in one study [44] to forecast the
direction of the Bitcoin price movement. According to Wu et al. [45], they used two distinct
LSTM models to anticipate Bitcoin prices. These models included a standard LSTM model
and an LSTM model that included an AR model. The authors of another study used GRU
to predict Bitcoin prices. According to their findings, GRU performed better than the RNN
and LSTM models in estimating Bitcoin prices [46]. However, all these studies merely
used the standard ML algorithms that are used in stock price prediction and applied them
to Bitcoin, and they were unsuccessful in capturing the distinctive characteristics of the
cryptocurrency. In addition, another study offered forecasts of Bitcoin prices based on the
unique characteristics of the cryptocurrency that set it apart from stocks. Other researchers
used a Bitcoin transaction graph to forecast Bitcoin prices. As all Bitcoin transactions are
recorded in a public ledger that is accessible to the public, developers have created tools
that can predict Bitcoin prices on the basis of the transaction identifier, sender, receiver,
value, and timestamp included in each transaction [47]. The authors of devised a complex
technique for forecasting future Bitcoin prices based on identifying the edges that occur
most frequently in the transaction network. This strategy obtained positive results [48].
According to the findings of another study many indicators have been utilized to forecast
the development of Bitcoin prices over time. These indicators include blockchain data (e.g.,
the number of transactions per block, median confirmation time, hash rate, and level of
difficulty) and macroeconomic variables (e.g., S&P500 and gold) [49,50].
Owing to the volatility of cryptocurrency prices, predicting them is difficult and time-
consuming. Researchers worldwide have focused only on price predictions for known
cryptocurrencies. However, other cryptocurrencies cannot be used in any way, shape, or
form either as money or as a platform. To complete the process of analysis and obtain
results for several cryptocurrencies, in this study a fully linked layer was applied to the final
hidden representation. The four most significant contributions of this study are as follows:
1. In this work, we studied and took on the challenge of predicting how the prices of
various cryptocurrencies would fluctuate. Moreover, herein, we provide a precise
explanation of the problem and discuss four distinct types of characteristics. This work
has the potential to contribute to the advancement of research on cryptocurrencies
and to supply investors with more tools for conducting investment assessments.
2. To overcome the problem of price fluctuation prediction, we propose an innovative
model known as LSTM.
3. The LSTM model is used to capture the time dependency aspects of the prices of
cryptocurrencies, and an embedding network is presented to capture the hidden repre-
sentations from linked cryptocurrencies. Both networks are employed in conjunction
with each another.
4. The developed technique was used to show the future fluctuations of the prices
of the different types of cryptocurrencies over a period of 180 days as a form of
long-term forecasting.
5. In the real-world cryptocurrency market, we experimentally demonstrated the useful-
ness of our LSTM model. In addition, LSTM showed state-of-the-art performance that
was superior to those of all other existing models.
The remainder of our study is structured as follows. In Section 2 we present the
materials and methods followed and implemented in the present study. In Section 3 we
describe the experiments and present the results. In Section 4 we discuss the results. Finally,
in Section 5 we present the conclusions.

2. Materials and Methods


Figure 1 shows the proposed framework for predicting the prices of cryptocurrencies.
To achieve the objectives of this study, we trained an LSTM model to predict the prices of
four types of cryptocurrencies using historical cryptocurrency price data. Then, to assess
Electronics 2022, 11, x FOR PEER REVIEW 5 of 24
Electronics 2022, 11, 2349 5 of 22

performances
the performances of the given
of the schemes,
given wewe
schemes, compared thethe
compared accuracy of of
accuracy ourour
proposed model
proposed to
model
those of existing models.
to those of existing models.

Figure1.1. Framework
Figure Framework of
ofthe
thesystem.
system.
2.1. Data Sets
2.1. Data Sets
The data used in this study included daily historical data from the website CoinMarketCap.
The data used
com (accessed on 20in this
Junestudy
2022).included
In thisdaily historical
study, data from the website
four cryptocurrencies, namely, CoinMar-
AMP,
ketCap.com. In this study, four cryptocurrencies, namely, AMP,
Ethereum, EOS, and XRP, were investigated. When working with cryptocurrency Ethereum, EOS, and data,
XRP,
were investigated. When working with cryptocurrency data, it is helpful
it is helpful and vital to understand the distribution and behavior of the data by using a and vital to under-
standofthe
chart distribution
steady and behavior fluctuation
and understandable of the data by using
prices of athe
chart of steady and understanda-
cryptocurrencies. All data sets
ble fluctuation
were pricesMay
collected from of the
2015cryptocurrencies.
through April All 2022data
at 1sets were collected
h intervals. fromhave
Investors Maybeen2015
through April 2022 at 1 h intervals. Investors have been engaged
engaged in active trading in 2022 with cryptocurrencies such as AMP, Ethereum, EOS, in active trading in 2022
withXRP.
and cryptocurrencies
We collected suchdata as
fromAMP,
2015Ethereum, EOS,for
for XRP, 2016 andEthereum,
XRP. We collected data from
2017 for EOS, 2015
and 2020
for XRP, 2016 for Ethereum, 2017 for EOS, and 2020 for AMP. Figure
for AMP. Figure 2 presents graphical representations of the time series for the targeted2 presents graphical
representations of distributions
cryptocurrencies’ the time seriesduring
for the targeted
differentcryptocurrencies’
periods. The figure distributions duringthat
demonstrates dif-
ferent
the periods.
price The throughout
increased figure demonstrates that the
this particular price increased
period, accordingthroughout
to the pricethis particular
at which the
period, according
transaction closed.toTable
the price at which
1 shows the transaction
the features closed. Table 1 shows
of the cryptocurrencies usedthein features
this study.of
the period
The cryptocurrencies
used for eachused in this study. is
cryptocurrency The period used
presented for each
in Table 2. cryptocurrency is pre-
sented in Table 2.
Table 1. Features of the cryptocurrencies used in this study.
Table 1. Features of the cryptocurrencies used in this study.
Description Feature Type Feature
Description Feature Type Feature
Time Date Lowest cryptocurrency price for the day
Time
Low Date
Numerical Lowest cryptocurrency
Highest price
cryptocurrency for for
price thethe
dayday
Low
High Numerical
Numerical Highest cryptocurrency
Opening price
cryptocurrency for for
price thetheday
day
Open
High Numerical
Numerical Closing cryptocurrency price for
Opening cryptocurrency price for the day the day
Close Numerical Cryptocurrency volume traded on the day
Open Numerical Closing cryptocurrency price for the day
Volume Numerical
Close Numerical Cryptocurrency volume traded on the day
Volume Numerical
Table 2. Period used for each cryptocurrency.
Table 2.Cryptocurrency
Period used for each cryptocurrency.
Start Time End Time
AMP
Cryptocurrency 9 November 2020
Start Time 3End
AprilTime
2022
Ethereum
AMP 93November
October 2016
2020 43April
April2022
2022
EOS 9 November 2017 4 April 2022
Ethereum
XRP
3 October 2016
25 May 2015
4 April 2022
4 April 2022
EOS 9 November 2017 4 April 2022
XRP 25 May 2015 4 April 2022
The proposed model has the ability to work with all cryptocurrencies but we selected
only four cryptocurrencies to examine the proposed model. The reason we chose lesser-
known cryptocurrencies was to help investors select the appropriate cryptocurrencies for
investment. Since most new investors favor new and cheap cryptocurrencies for investment,
Electronics 2022, 11, 2349 6 of 22

Electronics 2022, 11, x FOR PEER REVIEW 6 of 24


the prices of these cryptocurrencies decrease suddenly, which affects their investment value.
Finally, we believe this model can predict all cryptocurrencies successfully.

(d)

Figure 2. Cryptocurrency data sets: (a) AMP, (b) Ethereum, (c) EOS, and (d) XRP.
Figure 2. Cryptocurrency data sets: (a) AMP, (b) Ethereum, (c) EOS, and (d) XRP.

The proposed
2.2. Normalization model has the ability to work with all cryptocurrencies but we selected
Method
only four cryptocurrencies
One of the most prevalent to examine the proposed
approaches model.data
to normalizing The reason
is calledwemin-max
chose lesser-
nor-
known cryptocurrencies
malization. For each feature,wastheto minimum
help investors
valueselect the appropriate
is changed to zero, cryptocurrencies
the highest valuefor is
investment.
changed Since
to 1, and allmost
othernew investors
values favor new
are changed to a and cheap
decimal cryptocurrencies
between 0 and 1. for invest-
ment, the prices of these cryptocurrencies decrease suddenly, which affects their invest-
ment value. Finally, we believe x − xmin this model can predict all cryptocurrencies successfully.
zn = ( Newmaxx − Newminx ) + Newminx (1)
xmax− xmin
2.2. Normalization Method
where Onex_max of the x_min
andmost are theapproaches
prevalent maximum to and minimumdata
normalizing values, 1 and
is called 0, respectively.
min-max normali-
New
zation. the smallest number, whereas New
min_x For each feature, the minimum value is changed to zero, the highest value is 3
is max_x is the largest number. Figure shows
changed
thetocryptocurrency data sets after normalization. The mean
1, and all other values are changed to a decimal between 0 and 1. and standard division metrics
are presented to calculate the time series data set.
𝑧 = 𝑁𝑒𝑤 − 𝑁𝑒𝑤 + 𝑁𝑒𝑤 (1)
2.3. LSTM Algorithm
where x_max
To learn and x_min
sequences are the maximum
designed to captureand minimum
temporal values,information
contextual 1 and 0, respectively.
in time series
New min_x is the smallest number, whereas Newmax_x is the largest number. Figure 3 shows the
data, RNNs use recurrent connections between the input and the output of their neurons
orcryptocurrency
layers. Recently, data
theysets after
have normalization.
become The
popular in mean
deep and standard
learning becausedivision metrics are
of their capacity to
presented to calculate the time series data set.
Electronics 2022, 11, 2349 7 of 22

transcend the limitations of traditional neural network designs when it comes to learning
across extended data sequences. The long-term reliance problem is specifically avoided
with LSTMs. When it comes to remembering long-term knowledge, they do not have to
think twice about it. Neural networks that use an RNN structure feature a chain of neural
network modules that repeat themselves [51,52]. A single tanh layer is required for this
repeating module in ordinary RNNs. Using memory cells and a gating mechanism in place
of the RNN nodes, deep learning LSTM neural networks solve the vanishing gradient
Electronics 2022, 11, x FOR PEER REVIEW 7 of 24
problem through their ability to retain both long- and short-term temporal information.
Figure 4 shows the architecture of the LSTM model.

Figure3.3.Normalization
Figure Normalizationcryptocurrency
cryptocurrencydata
datasets:
sets: (a)
(a) AMP,
AMP,(b)
(b)Ethereum,
Ethereum,(c)
(c)EOS,
EOS,and
and(d)
(d)XRP.
XRP.

2.3. LSTM
The LSTMAlgorithm
uses a three-gate technique to store the state of the network. Memory loss
from a Toconcealed state can
learn sequences be controlled
designed to capturebytemporal
means of the forget
contextual gate ( f t ), the
information firstseries
in time gate.
When a new piece of information is received, an input gate (i =) determines
data, RNNs use recurrent connections between the input and the output of their neurons
t how much ofor
it
islayers.
to be kept in the current cell state. In the last gate, the output gate (o ),
Recently, they have become popular in deep learning because tof their capacity to the current cell’s
output value
transcend theislimitations
calculated.ofAntraditional
LSTM cellneural
has three gates,designs
network and variouswhenrelated
it comes equations
to learningare
utilized in an LSTM.
across extended data sequences. The long-term reliance problem is specifically avoided with
LSTMs. When it comes to remembering  long-term knowledge, they do not have to think
Forget gate layer : f t = σ We f Xt + We f ht−1 + Wc f Ct−1 + U f (2)
twice about it. Neural networks that use an RNN structure feature a chain of neural network
modules that repeat themselves [51,52]. A single tanh layer is required for this repeating
module in ordinaryInput gate
RNNs.layer
Using = σ (Wxi cells
: it memory Xt + and 1 + Wcimechanism
Whi hat−gating Ct−1 + Ui ) in place of the (3)
RNN nodes, deep learning LSTM neural networks solve the vanishing gradient problem
through their ability to retain both long- and short-term temporal information. Figure 4
shows the architecture of the LSTM model.
Electronics 2022, 11, 2349 8 of 22

New memory cell : Ct = σ ( f t ct−1 + it tanh(Wxc Xt + Whc ht−1 + U ) (4)


Output gate layer : ot = σ (Wxo Xt + Who ht−1 + Wco Ct−1 + Uo ), (5)
ht = Ot × tan h(Ct ) (6)
The candidate cell state (Ct−1 ) is shown in the above equations. We f , Wxi , Wxc , and
Wxo are the weights of all networks; Ui and UC are bias variables; and U f , bi , Uc , and Uo are
the bias variables of the individual networks. ht represents the current hidden state value,
whereas xt represents new information at the current cell. Xt represents new information
Electronics 2022, 11, x FOR PEER REVIEW
at the current cell. The sigmoid () and tangent hyperbolic (tanh) activation functions 8 of 24are

both used in this case. Artificial neural networks typically utilize activation functions like
this one.

Figure 4. Structure of the LSTM model.


Figure 4. Structure of the LSTM model.

The
2.4. LSTM usesMeasurement
Performance a three-gate technique to store the state of the network. Memory loss from
a concealed state can be controlled
The models’ forecasts by means
of price trendsofand the movement
forget gate (𝑓 ), the firstwere
directions gate.evaluated
When a newusing
piece of information
various measures.isIn received, an input
experiments, fourgate (𝑖 =) determines
commonly how much
used markers wereofused
it is to
to be kept inthe
measure
theperformances
current cell state.
of theInmodels:
the last RMSE,
gate, the output
MAE, gate (𝑜and
NRMSE, ), the
thecurrent
Pearsoncell’s output value
correlation is
coefficient
calculated. An LSTM cell has three gates, and various related
error criterion were employed for the evaluations of prediction outcomes. equations are utilized in an
LSTM.
1 n
n i∑
2
Forget gate layer:
MSE𝑓 == 𝜎 (𝑊 (y𝑋 + 𝑊− ℎ
i,observ + )𝑊
yi, estim 𝐶 +𝑈 ) (2)(7)
=1
Input gate layer: 𝑖 = 𝜎v(𝑊 𝑋 + 𝑊 ℎ + 𝑊 𝐶 + 𝑈 ) (3)
u n 2
New memory cell: 𝐶 = 𝜎 (𝑓 u𝑐 (+ 𝑖 tanh(
yi,observ − y𝑊 𝑋 + ) 𝑊 ℎ + 𝑈) (4)
RMSE = t ∑
i, estim
(8)
n
Output gate layer: 𝑜 = 𝜎 (𝑊 𝑋 + 𝑊 ℎ + 𝑊 𝐶 + 𝑈 ),
i = 1 (5)
ℎ = 𝑂 × tanh(𝐶 ) (6)
The candidate cell state (𝐶 ) is shown in the above equations. 𝑊 , 𝑊 , 𝑊 , and
𝑊 are the weights of all networks; Ui and UC are bias variables; and 𝑈 , 𝑏 , 𝑈 , and 𝑈
are the bias variables of the individual networks. ℎ represents the current hidden state
Electronics 2022, 11, 2349 9 of 22

q
2
1
n ∑in=1 (yi,observ − yi, estim )
NRMSE = (9)
x
n ∑in=1 yi,observ × yi,estim − ∑in=1 yi,observ ∑in=1 yi,estim
  
R% = rh × 100, (10)
2 2 ih 2 2 i
n ∑in=1 yi,observ − ∑in=1 yi,observ n ∑in=1 yi,estim − ∑in=1 yi,estim

where y(i,observ) is the experimental value of data point I, y(i,estim) is the anticipated value,
and n is the number of samples.

3. Experiments
To evaluate the models’ performance, we used them to make price predictions for the
four cryptocurrency data sets in isolation. The deep learning LSTM model was used with
the aim of accurately forecasting the prices of various cryptocurrencies in the future. To
locate errors in predictions, evaluation metrics including MSE, RMSE, and NRMES were
utilized. The data set was split into two groups—70% for training to build the model and
30% for testing to examine the model. The LSTM model was used to predict the prices
of different cryptocurrencies. The goal of this investigation was to discover whether the
model had a higher level of accuracy than other models.

3.1. Environment Developing System


The proposed system was developed in different environments, including hardware
and software environments. Tensor Flow and Keras software have been previously used
to build deep learning techniques such as LSTM models. Scikit-learn was used for the
normalization process. The software was configured with an Intel (R) Core (TM) i7-4770
processor, operating at 3.20 GHz, with 8 GB of memory, and 64-bit Windows 10.

3.2. Results
In this section, the results of the four experiments conducted to predict the prices of
the cryptocurrencies, namely AMP, Ethereum, EOS, and XRP, are presented.

3.2.1. Results of the LSTM Model for the AMP Cryptocurrency


AMP is the digital asset token used to collateralize payments in the Flexa Network,
making them quick and safe. It is based on Ethereum, in accordance with the ERC20 stan-
dard for tokens. It may be purchased and exchanged for fiat cash or other digital currencies.
The LSTM model was used to predict the fluctuation price of the AMP cryptocurrency
from 11 September 2020 to 3 April 2022. Table 3 shows the results of the LSTM model in
predicting the prices in the training and testing processes.

Table 3. Results of the LSTM model for the AMP cryptocurrency.

MSE RMSE NRMES


Training 0.00360 0.0579 0.08877
Testing 0.0999 0.04289 0.00184

Figure 5 shows a time series plot of the LSTM model’s results in predicting the price
of the AMP cryptocurrency. The prediction values were close to those of the observation
model. The prediction error of the LSTM model was MSE = 0.00360 in training and
MSE = 0.0999 in testing.
Figure 6 shows a histogram of the errors in the training and testing processes. Error
histogram metrics were investigated to find discrepancies between the expected and target
values. Negative error numbers demonstrate how the expected values deviated from the
target values. The histogram also shows differences between the predicted and target
values. The mean error in the error histogram was 0.0037622 in the training phase and
0.0088659 in the testing phase in the prediction of the price of the AMP cryptocurrency.
Electronics 2022, 11, 2349 10 of 22

Electronics 2022, 11, x FOR PEER REVIEW 11 of 24

Figure 5. Time series plot of the LSTM model for predicting the price of the AMP cryptocurrency.

Figure 6. Error histograms of the the LSTM


LSTM model
model for
forpredicting
predictingthe
theprice
priceofofthe
theAMP
AMPcryptocurrency
cryptocurrencyin
(a)(a)
in training and
training (b)(b)
and testing.
testing.

The LSTM
The LSTM model
modelwas wasproposed
proposedtotoforecast the
forecast future
the futureprices of the
prices AMP
of the cryptocurrency
AMP cryptocur-
over aover
rency period of 180ofdays,
a period fromfrom
180 days, 15 September 20222022
15 September to 1 to
October 2022.
1 October Table
2022. 4 shows
Table 4 showsthe
forecasting
the values
forecasting for the
values for last month.
the last A graphical
month. representation
A graphical of the
representation of 180-day forecast
the 180-day fore-is
presented
cast in Figure
is presented 7. It shows
in Figure the lower
7. It shows and upper
the lower forecasting
and upper values.
forecasting We investigated
values. We inves-
the time series of AMP and found that it was declining over the next 180
tigated the time series of AMP and found that it was declining over the next 180 days. days.

3.2.2. Results for the Ethereum Digital Cryptocurrency


Ethereum is essentially a worldwide decentralized software platform driven by the
aforementioned blockchain technology. Ether, abbreviated as ETH, is the cryptocurrency
developed specifically for use in this platform. Anyone can use Ethereum to construct any
type of safe digital technology. The deep leaning LSTM model was proposed to predict
the fluctuations in the price of this digital currency over a given period. Table 5 presents
the prediction results of the LSTM model for predicting the prices of the cryptocurrency,
showing that the LSTM model achieved good prediction accuracy.
Electronics 2022, 11, 2349 11 of 22

Table 4. Results of the AMP dataset for the last 15 days.

Date Yhat_Lower Yhat_Upper


15 September 2022 0.033358 0.004007
16 September 2022 0.035122 0.002405
17 September 2022 0.034185 0.004088
18 September 2022 0.035289 0.004145
19 September 2022 0.035550 0.002510
20 September 2022 0.036466 0.003886
21 September 2022 0.036169 0.003065
22 September 2022 0.037635 0.002911
Figure 6. Error histograms of the LSTM model for predicting the price of the AMP cryptocurrency
23 September
in (a) training and (b)2022
testing. 0.038176 0.002818
24 September 2022 0.038944 0.002759
25 September 2022 0.038174 0.003079
The LSTM model was proposed to 0.039046
26 September 2022
forecast the future prices of the AMP cryptocur-
0.002894
rency 27over a period of
September 2022 180 days, from 15 September
0.038900 2022 to 1 October 2022. Table 4 shows
0.001161
the forecasting values
28 September 2022for the last month.0.038788
A graphical representation of the 180-day fore-
0.003102
cast is29presented
Septemberin2022
Figure 7. It shows the lower and upper forecasting0.002595
0.039680 values. We inves-
tigated30the
September 2022of AMP and found
time series 0.039357
that it was declining over the0.003808
next 180 days.

Figure7.
Figure 7. Future
Future prices
prices of
ofthe
theAMP
AMPcryptocurrency.
cryptocurrency.

Table 5. Results of the LSTM model in predicting the prices of the Ethereum cryptocurrency.

MSE RMSE NRMES


Training 0.1616 0.1693 0.02868
Testing 0.00422 0.004250 1.807 × 100−5

A time series plot of the LSTM model is presented in Figure 8, where the x-axis
represents the time (days), and the y-axis represents the price in US dollars. The prediction
errors of the LSTM model in predicting the prices of Ethereum were MSE = 0.1616 and
0.00422 in training and testing, respectively.
An error histogram of the LSTM model’s performance in predicting the prices of the
Ethereum digital currency is presented in Figure 9. The error was 6.5079 × 10−05 in training
and 0.041537 in testing, indicating low error values.
Electronics 2022, 11, x FOR PEER REVIEW 13 of 24

Electronics
Electronics 2022,
2022, 11,11, x FOR PEER REVIEW
2349 1312ofof24
22

Figure 8. Time series plot of the LSTM for predicting the prices of the Ethereum cryptocurrency.

An error histogram of the LSTM model’s performance in predicting the prices of the
Ethereum digital currency is presented in Figure 9. The error was 6.5079 × 10−05 in training
and 0.041537
Figure
Figure 8.8.Timein
Time testing,
series
series plotindicating
plot ofthe
of theLSTM
LSTMlowforerror
for values.
predicting
predicting the prices of the Ethereum cryptocurrency.
the

An error histogram of the LSTM model’s performance in predicting the prices of the
Ethereum digital currency is presented in Figure 9. The error was 6.5079 × 10−05 in training
and 0.041537 in testing, indicating low error values.

Figure 9. Error histograms of the LSTM model’s predictions of the prices of the Ethereum cryptocur-
Figure 9. Error histograms of the LSTM model’s predictions of the prices of the Ethereum cryptocur-
rency in
rency in(a)
(a)training
trainingand
and(b)
(b)testing.
testing.

Figure 10 shows a forecast of the prices of Ethereum over 180 days. The price of this
Figure 10 shows a forecast of the prices of Ethereum over 180 days. The price of this
digital currency
Figurecurrency
9. was predicted
Error histograms to continue
of the LSTM model’stoto increase
predictions up prices
to 5619.857287 USDcryptocur-
between
digital was predicted to continue increase of
upthe of the Ethereum
to 5619.857287 USD between 15
15 September
rency 2022 and
in (a) training and(b)1 October
testing. 2022. Table 6 summarizes the lower and upper values of
September 2022 and 1 October 2022. Table 6 summarizes the lower and upper values of the
the forecasted future closing prices in the last 15 days.
forecasted future closing prices in the last 15 days.
Figure 10 shows a forecast of the prices of Ethereum over 180 days. The price of this
3.2.3. Results
digital of the
currency wasEOS Digitalto
predicted Cryptocurrency
continue to increase up to 5619.857287 USD between 15
September
EOS is 2022 and 1 October
a platform 2022. Table 6 summarizes
for the development, hosting, andthe lower and
operation upper values of
of decentralized the
appli-
forecasted
cations future
(dApps) closing
that prices in the
is underpinned bylast 15 days.technology. It was released in June 2018,
blockchain
following an initial coin offering that garnered USD 4.1 billion in cryptocurrency for the
business. Table 7 shows the results of the LSTM model for predicting the prices of the EOS
cryptocurrency. The LSTM model achieved very low prediction errors according to the
performance measurement.
A comparison between the actual outcomes and the expected results is illustrated
in Figure 11. The results of the model simulations showed few instances in which the
Electronics 2022, 11, 2349 13 of 22

Electronics 2022, 11, x FOR PEER REVIEW 14 of 24


predicted outcome did not match the actual findings. The prediction results had an MSE of
0.0525 in training and 0.0365 in testing.

Figure 10. Future prices of the Ethereum cryptocurrency.


cryptocurrency.

Table 6.
Table 6. Results
Results of
of the
the Ethereum
Ethereum data
data set
set for
for the
the last
last 15
15 days.
days.

Date
Date Yhat_Lower
Yhat_Lower Yhat_Upper
Yhat_Upper
1515 September 2022 2022
September
4677.903908
4677.903908
5609.095990
5609.095990
1616 September
September 2022 2022 4688.538587
4688.538587 5621.289890
5621.289890
1717
September 2022
September 2022 4702.770108
4702.770108 5591.677580
5591.677580
18 September 2022 4678.111597 5621.169491
1918 September
September 2022 2022 4678.111597
4693.603383 5621.169491
5617.486797
2019 September
September 2022 2022 4693.603383
4665.613444 5617.486797
5575.324879
2120
September 2022
September 2022 4710.074374
4665.613444 5597.400108
5575.324879
22 September 2022 4729.771186 5589.593962
2321 September
September 2022 2022 4710.074374
4694.120456 5597.400108
5632.626349
2422 September
September 2022 2022 4729.771186
4691.720817 5589.593962
5597.651285
25 September 2022 4688.440977 5605.991738
23 September 2022 4694.120456 5632.626349
26 September 2022 4684.430926 5620.691021
2724 September
September 2022 2022 4691.720817
4720.283419 5597.651285
5616.356363
2825 September 2022
September 2022 4714.168725
4688.440977 5619.857287
5605.991738
29 September 2022 4708.096961 5624.059944
26 September 2022 4684.430926 5620.691021
30 September 2022 4691.083387 5624.886372
1527 September
September 2022 2022 4720.283419
4711.686727 5616.356363
5620.812830
28 September 2022 4714.168725 5619.857287
29 September 2022
Table 7. Results of the LSTM model’s performance in predicting the prices of the5624.059944
4708.096961 EOS cryptocurrency.
30 September 2022 4691.083387 5624.886372
MSE RMSE NRMES
15 September 2022 4711.686727 5620.812830
Training 0.0525 0.0578 0.003345
Testing 0.0365 0.03855 0.00148
3.2.3. Results of the EOS Digital Cryptocurrency
EOS is a platform for the development, hosting, and operation of decentralized ap-
A histogram of the accuracy results obtained for the LSTM model during training and
plications (dApps) that is underpinned by blockchain technology. It was released in June
testing in predicting the prices of the EOS cryptocurrency is depicted in Figure 12. An error
2018, following an initial coin offering that garnered USD 4.1 billion in cryptocurrency for
histogram is a statistical tool that can be used to identify differences between actual and
the business. Table 7 shows the results of the LSTM model for predicting the prices of the
expected data. The predictions obtained for the prices of the EOS cryptocurrency had mean
EOS
error cryptocurrency. The0.00544,
values of 0.000094, LSTM model achieved
and 0.00025, very low
as shown prediction
in their errors
respective according to
histograms.
the performance measurement.
Training
0.0525 in training and 0.0365 in0.0525
testing. 0.0578 0.003345
Testing 0.0365 0.03855 0.00148

A comparison between the actual outcomes and the expected results is illustrated in
Figure 11. The results of the model simulations showed few instances in which the pre-
Electronics 2022, 11, 2349 14 of 22
dicted outcome did not match the actual findings. The prediction results had an MSE of
0.0525 in training and 0.0365 in testing.

Figure 11. Time series plot of the LSTM model in predicting the prices of the EOS cryptocurrency.

A histogram of the accuracy results obtained for the LSTM model during training and
testing in predicting the prices of the EOS cryptocurrency is depicted in Figure 12. An error
histogram is a statistical tool that can be used to identify differences between actual and
expected data. The predictions obtained for the prices of the EOS cryptocurrency had mean
error
Figurevalues
Figure 11. of series
11. Time
Time 0.000094,
plot0.00544,
series plot ofthe
of andmodel
theLSTM
LSTM 0.00025,
model as shownthe
inpredicting
in predicting in their
the respective
prices
prices ofthe
of EOShistograms.
theEOS cryptocurrency.
cryptocurrency.

A histogram of the accuracy results obtained for the LSTM model during training and
testing in predicting the prices of the EOS cryptocurrency is depicted in Figure 12. An error
histogram is a statistical tool that can be used to identify differences between actual and
expected data. The predictions obtained for the prices of the EOS cryptocurrency had mean
error values of 0.000094, 0.00544, and 0.00025, as shown in their respective histograms.

Figure 12. Error histograms


histograms ofofthe
theLSTM
LSTMmodel
modelininpredicting
predictingthe
theprices
pricesofof
the EOS
the cryptocurrency
EOS in
cryptocurrency
in (a)
(a) training
training andand
(b)(b) testing.
testing.

Figure 13 displays the future prices of the EOS cryptocurrency over 180 days. The plot
showed that the future prices of EOS would remain normal. The price forecast for the last
15 days, from 15 September 2022 to 1 October 2022, is presented in Table 8.
Figure 12. Error histograms of the LSTM model in predicting the prices of the EOS cryptocurrency
3.2.4. Results of the XRP Digital Cryptocurrency
in (a) training and (b) testing.
XRP is a digital asset classification standard developed by CoinDesk. It is categorized
as a currency (DACS). XRP is a cryptocurrency native to the XRP Ledger, which is an
open-source, public blockchain created to make transactions quicker and more affordable.
In this study, the XRP cryptocurrency was chosen to test the accuracy of the LSTM model
in predicting cryptocurrency prices. The results of the LSTM model in predicting the prices
of XRP are presented in Table 9.
Figure 14 shows the predicted values for the XRP digital cryptocurrency from 25 May
2015 to 4 April 2022. The plot demonstrates that the prediction values were very close to
the observed values. According to the MSE metric, the LSTM model achieved very low
prediction errors of 0.04042 in training and 0.06324 in testing.
An error histogram of the LSTM model’s performance in predicting the future prices
of the XRP cryptocurrency is presented in Figure 15. The mean error value of the prediction
and target values of the LSTM model was 0.000256 in the training phase and 0.02941 in the
testing phase.
Electronics 2022, 11, x FOR PEER REVIEW 16 of 24

Figure 13 displays the future prices of the EOS cryptocurrency over 180 days. The
Electronics 2022, 11, 2349 plot showed that the future prices of EOS would remain normal. The price forecast for the
15 of 22
last 15 days, from 15 September 2022 to 1 October 2022, is presented in Table 8.

Future prices of the EOS cryptocurrency.


Figure 13. Future

Table 8. Results of the EOS data set for the last 15 days.

Date
Date Yhat_Lower
Yhat_Lower Yhat_Upper
Yhat_Upper
1515September 2022
September 2022 0.086412
0.086412 4.678990
4.678990
16 September
16 September 2022 2022 0.085707
0.085707 4.755874
4.755874
17 September 2022 0.213080 4.694373
1718September 2022
September 2022 0.213080
0.066792 4.694373
4.649735
1819September 2022
September 2022 0.066792
0.003034 4.649735
4.635850
20 September
19 September 2022 2022 0.126749
0.003034 4.700749
4.635850
21 September 2022 0.161347 4.492018
2022September 2022
September 2022 0.126749
0.046488 4.700749
4.559961
2123September 2022
September 2022 0.161347
0.180359 4.492018
4.621102
24 September 2022 0.119862 4.652601
22 September 2022 0.046488 4.559961
25 September 2022 0.033037 4.476590
2326September 2022
September 2022 0.180359
− 0.143718 4.621102
4.640157
2427September 2022
September 2022 0.011772
0.119862 4.778431
4.652601
2528September
September 2022
2022 0.234930
0.033037 4.649232
4.476590
29 September 2022 0.068225 4.841558
2630September 2022
September 2022 −0.143718
−0.156779 4.640157
4.636795
1 October 2022
27 September 2022 − 0.058128
0.011772 4.701538
4.778431
28 September 2022 0.234930 4.649232
Table29 Results of the 2022
9. September LSTM model’s performance in
0.068225 predicting the prices of the XRP cryptocurrency.
4.841558
30 September 2022 MSE
−0.156779 RMSE
4.636795
NRMES
1 October 2022
Training 0.04042
−0.058128
0.042066
4.701538
0.001769
Testing 0.06324 0.06913 0.0478
3.2.4. Results of the XRP Digital Cryptocurrency
XRP is a digital
A forecast of theasset classification
prices of the XRPstandard developed
cryptocurrency overby CoinDesk.
180 It is
days, from 15categorized
September
as a currency (DACS). XRP is a cryptocurrency native to the XRP Ledger, which
2022 to 1 October 2022, is presented in Figure 16. The plot shows that the price of is XRP
an open-
was
predicted to continue to increase over the next 180 days. Table 10 shows a 15-day forecast
of the price of XRP obtained using the LSTM model.
Training 0.04042 0.042066 0.001769
Electronics 2022, 11, x FOR PEER REVIEW Testing 0.06324 0.06913 0.0478 18 of 24

Figure 14 shows the predicted values for the XRP digital cryptocurrency from 25 May
2015 to 4 April 2022. The plot demonstrates that the prediction values were very close to
Electronics 2022, 11, 2349 Table 10. Results of the XRP data set for the last 15 days. 16 of 22
the observed values. According to the MSE metric, the LSTM model achieved very low
prediction errors
Date of 0.04042 in trainingYhat_Lower
and 0.06324 in testing. Yhat_Upper
15 September 2022 1.030358 1.582593
16 September 2022 1.041182 1.565411
17 September 2022 1.042217 1.576260
18 September 2022 1.033677 1.569240
19 September 2022 1.042646 1.585327
20 September 2022 1.033797 1.591424
21 September 2022 1.014597 1.575083
22 September 2022 1.044477 1.570961
23 September 2022 1.036621 1.583856
24 September 2022 1.040493 1.575192
25 September 2022 1.022004 1.620774
26 September 2022 1.026047 1.575642
27 September 2022 1.037790 1.577444
28 September 2022 1.049407 1.588724
29 September 2022 1.033513 1.605739
30 September 2022 1.053632 1.607500
Figure 114.October
Figure14. Time 2022
Timeseries
seriesplot
plotof
ofthe
theLSTM
LSTM model 1.050816
model in
in predicting the prices
predicting the prices of
of the 1.602266
theXRP
XRPcryptocurrency.
cryptocurrency.

An error histogram of the LSTM model’s performance in predicting the future prices
of the XRP cryptocurrency is presented in Figure 15. The mean error value of the prediction
and target values of the LSTM model was 0.000256 in the training phase and 0.02941 in the
testing phase.
A forecast of the prices of the XRP cryptocurrency over 180 days, from 15 September
2022 to 1 October 2022, is presented in Figure 16. The plot shows that the price of XRP was
predicted to continue to increase over the next 180 days. Table 10 shows a 15-day forecast
of the price of XRP obtained using the LSTM model.

Figure15.
Figure 15.Error
Errorhistograms
histogramsof ofthe
theLSTM
LSTMmodel
modelin
inpredicting
predictingthe
theprices
prices of
ofthe
the XRP
XRP cryptocurrency
cryptocurrency in
in training
(a) (a) training
andand
(b) (b) testing.
testing.

Table 10. Results of the XRP data set for the last 15 days.

Date Yhat_Lower Yhat_Upper


15 September 2022 1.030358 1.582593
16 September 2022 1.041182 1.565411
17 September 2022 1.042217 1.576260
18 September 2022 1.033677 1.569240
19 September 2022 1.042646 1.585327
20 September 2022 1.033797 1.591424
21 September 2022 1.014597 1.575083
22 September 2022 1.044477 1.570961
Electronics 2022, 11, 2349 17 of 22

Table 10. Cont.

Date Yhat_Lower Yhat_Upper


23 September 2022 1.036621 1.583856
24 September 2022 1.040493 1.575192
25 September 2022 1.022004 1.620774
26 September 2022 1.026047 1.575642
27 September 2022 1.037790 1.577444
28 September 2022 1.049407 1.588724
29 September 2022 1.033513 1.605739
Electronics 2022, 11, x FOR PEER REVIEW 30 September 2022 1.053632 1.607500 19 of 24
1 October 2022 1.050816 1.602266

Figure 16. Future prices of the XRP cryptocurrency.


Figure 16.

4.
4. Discussion
Discussion
In
In this
this study,
study, the
the deep
deep learning
learning LSTM
LSTM model was proposed
model was proposed for
for predicting
predicting the
the prices
pricesof
of
four cryptocurrencies: AMP, Ethereum, EOS, and XRP. The data sets of these cryptocurren-
four cryptocurrencies: AMP, Ethereum, EOS, and XRP. The data sets of these cryptocurrencies
cies
werewere collected
collected from from different
different periods.
periods. The proposed
The proposed system
system was usedwas used tothe
to forecast forecast
pricesthe
of
prices of these cryptocurrencies with a time interval 180 days. According to the results of
these cryptocurrencies with a time interval 180 days. According to the results of the fore-
the forecast, in the next 180 days, the price of the AMP currency was predicted to decrease,
cast, in the next 180 days, the price of the AMP currency was predicted to decrease,
whereas the prices of the Ethereum and XRP cryptocurrencies were predicted to increase
whereas the prices of the Ethereum and XRP cryptocurrencies were predicted to increase and
and the price of the EOS currency was predicted to show normal growth.
the price of the EOS currency was predicted to show normal growth.
The relationships between the target values of the AMP, Ethereum, EOS, and XRP
The relationships between the target values of the AMP, Ethereum, EOS, and XRP cryp-
cryptocurrencies and the predicted values obtained from the LSTM model are depicted in
tocurrencies and the predicted values obtained from the LSTM model are depicted in Figure
Figure 17. During the testing and training phases, the LSTM model exhibited the highest
17. During the testing and training phases, the LSTM model exhibited the highest regression
regression scores, with R = (96.73) in training and R = (96.09) in testing, when predicting
scores, with R = (96.73) in training and R = (96.09) in testing, when predicting the prices of
the prices of the EOS currency.
the EOS currency.
The cryptocurrencies studied here, namely, AMP, Ethereum, EOS, and XRP, have
five significant features. The Pearson correlation method was applied to find correlations
between these features. Figure 18 shows the correlations between the features of each
cryptocurrency.
To approve the performance of the LSTM model in predicting the prices of different
cryptocurrencies, we compared the presented results with the results of existing systems
that used the same or different cryptocurrencies. Table 11 summarizes the results of
the LSTM model, compared with those of other existing machine learning and deep
learning models.
Electronics 2022, 11,2022,
Electronics 234911, x FOR PEER REVIEW 20 of 24 18 of 22

Electronics 2022, 11, x FOR PEER REVIEW 21 of 24


Figure 17. Regression plot of the LSTM model for (a) AMP, (b) Ethereum, (c) EOS, and (d) XRP.
Figure 17. Regression plot of the LSTM model for (a) AMP, (b) Ethereum, (c) EOS, and (d) XRP.
The cryptocurrencies studied here, namely, AMP, Ethereum, EOS, and XRP, have
five significant features. The Pearson correlation method was applied to find correlations
between these features. Figure 18 shows the correlations between the features of each
cryptocurrency.
To approve the performance of the LSTM model in predicting the prices of different
cryptocurrencies, we compared the presented results with the results of existing systems
that used the same or different cryptocurrencies. Table 11 summarizes the results of the
LSTM model, compared with those of other existing machine learning and deep learning
models.

Figure Pearson
18. 18.
Figure correlations
Pearson correlationsbetween thefeatures
between the featuresofofthe
the cryptocurrencies
cryptocurrencies (a) AMP
(a) AMP (b) Ethereum
(b) Ethereum
(c) EOS
(c) EOS (d) (d)
XRP.XRP.

Table 11. Comparison results between the proposed system and the existing models.

Reference Model Currency Results


R2 score LR: 66%
[52] Logistic regression and linear discriminant analysis LTC
Electronics 2022, 11, 2349 19 of 22

Table 11. Comparison results between the proposed system and the existing models.

Reference Model Currency Results


Logistic regression
R2 score LR: 66%
[52] and linear LTC
LDA: 65.3%
discriminant analysis
Random forests (RFs) RMSE:
[53] and support vector Ethereum and Litecoin SVM = 19.69
machines (SVMs) RF = 5.05
Proposed system MSE = 0.000745
AMP
(LSTM) RMSE = 0.042
Proposed system MSE = 0.02868
Ethereum
(LSTM) RMSE = 0.042
Proposed system MSE = 0.003345
EOS
(LSTM) RMSE = 0.0385
Proposed system MSE = 0.001769
XRP
(LSTM) RMSE = 0.069

5. Conclusions
During the pandemic and the Russia–Ukraine conflict, daily returns and volatility
spillover significantly increased, making accurate forecasting difficult. An innovative
artificial intelligence methodology was used instead of the standard time series models to
estimate the returns of cryptocurrencies. We found that this new method provided accurate
forecasting results for the categorization of returns. On the basis of the promising outcomes
of the present research, the following conclusions can be derived:
1. The first step in preprocessing each cryptocurrency data set was data imputation,
which was performed to account for missing values. The step was followed by data
reshaping, which was performed so that the LSTM algorithms could be applied to
the data.
2. The data set was normalized using the MinMax transformation approach and then
reorganized so that it could be used in a multivariate model. The following stage
involved separating the data into training and testing sets. For every coin, we used a
70% success rate in training and a 20% success rate in testing.
3. The Pearson correlation approach was used to find any relationships between the vari-
ous characteristics of the cryptocurrencies. In the course of this inquiry, a multivariate
prediction model, as opposed to one that was based solely on a single variable, was
constructed using Close, Open, High/Low, and Volume as variables.
4. In the forecasts of the future prices of cryptocurrencies for a period of 180 days,
Ethereum and XRP showed increasing prices, whereas AMP showed a decreas-
ing price.
5. The results of the experiments demonstrated that the defined features were appro-
priate for the problem that we presented, and a state-of-the-art performance level,
higher than all baseline values, could be attained by our suggested LSTM model. In
addition, we analyzed the effects of various parameters on the issues we presented.
This research has the potential to provide the groundwork for a genuine trading
environment for investors to utilize in the near future.
6. One contribution of this study is that it provides investors and policymakers with a
solid understanding of the volatility of the most widely used cryptocurrencies. The
LSTM model was utilized in this investigation, in which we examined the volatility of
four cryptocurrencies, namelym AMP, Ethereum, EOS, and XRP. The data sets were
collected at different time intervals.
7. One limitation of this study was the use of four cryptocurrencies for the testing of the
proposed prediction model.
Electronics 2022, 11, 2349 20 of 22

8. In the future, one of our goals is to create accurate prediction models that can be used
to make forecasts for all cryptocurrencies, as well as to conduct an evaluation of the
proposed model using data for all cryptocurrencies.

Author Contributions: Conceptualization, M.A.A. and T.H.H.A.; methodology, T.H.H.A. and M.A.A.;
software, T.H.H.A.; validation, T.H.H.A. and M.A.A.; formal analysis, T.H.H.A. and M.A.A.; inves-
tigation, T.H.H.A. and M.A.A.; resources, T.H.H.A.; data curation, T.H.H.A. and M.A.A.; writing—
original draft preparation, T.H.H.A. and M.A.A.; writing—review and editing, M.A.A.; visualization,
T.H.H.A. and M.A.A.; supervision, T.H.H.A.; project administration, T.H.H.A.; funding acquisition,
T.H.H.A. and M.A.A. All authors have read and agreed to the published version of the manuscript.
Funding: This research and the APC were funded by the Saudi Investment Bank Chair for Investment
Awareness Studies, the Deanship of Scientific Research, The vice Presidency for Graduate Studies
and Scientific Research, King Faisal University, Al Ahsa, Saudi Arabia (Grant No. 22).
Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.
Data Availability Statement: The data presented in this study are available here: CoinMarketCap.
com (accessed on 20 June 2022).
Conflicts of Interest: The authors declare that they have no conflict of interest.

References
1. Nakamoto, S. Bitcoin: A Peer-To-Peer Electronic Cash System. Bitcoin. 2008. Available online: https://git.dhimmel.com/bitcoin-
whitepaper/ (accessed on 5 May 2022).
2. Corbet, S.; Lucey, B.; Urquhart, A.; Yarovaya, L. Cryptocurrencies as a financial asset: A systematic analysis. Int. Rev. Financ. Anal.
2019, 62, 182–199. [CrossRef]
3. Zheng, Z.; Xie, S.; Dai, H.; Chen, X.; Wang, H. An overview of blockchain technology: Architecture, Consensus, and Future Trends.
In Proceedings of the 2017 IEEE 6th International Congress on Big Data (BigData Congress), Honolulu, HI, USA, 25–30 June 2017.
4. Zheng, Z.; Xie, S.; Dai, H.N.; Chen, X.; Wang, H. Blockchain challenges and opportunities: A survey. Int. J. Web Grid Serv. 2018,
14, 352–375. [CrossRef]
5. Li, L.; Liu, J.; Chang, X.; Liu, T.; Liu, J. Toward conditionally anonymous Bitcoin transactions: A lightweight-script approach. Inf.
Sci. 2020, 509, 290–303. [CrossRef]
6. Böhme, R.; Christin, N.; Edelman, B.; Moore, T. Bitcoin: Economics, technology, and governance. J. Econ. Perspect. 2015, 29, 213–238.
[CrossRef]
7. Garcia, D.; Tessone, C.J.; Mavrodiev, P.; Perony, N. The digital traces of bubbles: Feedback cycles between socio-economic signals
in the Bitcoin economy. J. R. Soc. Interface 2014, 11, 20140623. [CrossRef] [PubMed]
8. Yu, J.H.; Kang, J.; Park, S. Information availability and return volatility in the bitcoin Market: Analyzing diferences of user
opinion and interest. Inf. Processing Manag. 2019, 56, 721–732. [CrossRef]
9. Gu, S.; Kelly, B.; Xiu, D. Empirical asset pricing via machine learning. Rev. Financ. Stud. 2020, 33, 2223–2273. [CrossRef]
10. Feng, G.; Giglio, S.; Xiu, D. Taming the factor zoo: A test of new factors. J. Financ. 2020, 75, 1327–1370. [CrossRef]
11. Jaquart, P.; Dann, D.; Martin, C. Machine learning for bitcoin pricing—A structured literature review WI 2020 Proceedings. In
Wirtschaftsinformatik (Zentrale Tracks); GITO Verlag: Berlin, Germany, 2020; pp. 174–188.
12. Coinmarketcap. Available online: https://coinmarketcap.com (accessed on 15 September 2020).
13. Fama, E.F. Efficient capital markets: A review of theory and empirical work. J. Financ. 1970, 25, 383–417. [CrossRef]
14. Lo, A.W. The Adaptive Markets Hypothesis Adaptive Markets; Princeton University Press: Princeton, NJ, USA, 2019; Volume 30,
pp. 176–221.
15. Fama, E.F.; MacBeth, J.D. Risk, return, and equilibrium: Empirical tests. J. Polit. Econ. 1973, 81, 607–636. [CrossRef]
16. Fama, E.F.; French, K.R. Dissecting anomalies. J. Financ. 2007, 63, 1653–1678. [CrossRef]
17. Fischer, T.; Krauss, C. Deep learning with long short-term memory networks for financial market predictions. Eur. J. Oper. Res.
2018, 270, 654–669. [CrossRef]
18. Krollner, B.; Vanstone, B.; Finnie, G. Financial time series forecasting with machine learning techniques: A survey. In Proceedings
of the 18th European Symposium on Artificial Neural Networks: Computational and Machine Learning, Bruges, Belgium, 28–30
April 2010; Springer: Berlin/Heidelberg, Germany, 2010; pp. 1–7.
19. Siami-Namini, S.; Namin, A.S. Forecasting Economics and Financial Time Series: ARIMA vs. LSTM. arXiv 2018, arXiv:1803.06386.
Available online: https://arxiv.org/abs/1803.06386v1 (accessed on 2 February 2020).
20. Kaiser, L. Seasonality in cryptocurrencies. Financ. Res. Lett. 2019, 31, 232–238. [CrossRef]
21. Aldhyani, T.H.H.; Alkahtani, H. A Bidirectional Long Short-Term Memory Model Algorithm for Predicting COVID-19 in Gulf
Countries. Life 2021, 11, 1118. [CrossRef] [PubMed]
Electronics 2022, 11, 2349 21 of 22

22. Enke, D.; Thawornwong, S. The use of data mining and neural networks for forecasting stock market returns. Expert Syst. Appl.
2005, 29, 927–940. [CrossRef]
23. Huang, W.; Nakamori, Y.; Wang, S.-Y. Forecasting stock market movement direction with support vector machine. Comput. Oper.
Res. 2005, 32, 2513–2522. [CrossRef]
24. Sheta, A.F.; Ahmed, S.E.M.; Faris, H. A comparison between regression, artificial neural networks and support vector machines
for predicting stock market index. Soft Comput. 2015, 7, 8.
25. McNally, S.; Roche, J.; Caton, S. Predicting the Price of Bitcoin Using Machine Learning. In Proceedings of the 26th Euromicro
International Conference on Parallel, Distributed and Network-Based Processing (PDP), Cambridge, UK, 21–23 March 2018.
26. Andrianto, Y. The Effect of Cryptocurrency on Investment Portfolio Effectiveness. J. Financ. Account. 2017, 5, 229–238. [CrossRef]
27. Derbentsev, V.; Babenko, V.; Khrustalev, K.; Obruch, H.; Khrustalova, S. Comparative Performance of Machine Learning Ensemble
Algorithms for Forecasting Cryptocurrency Prices. Int. J. Eng. Trans. A Basics 2021, 34, 140–148.
28. Patel, M.M.; Tanwar, S.; Gupta, R.; Kumar, N. A Deep Learning-based Cryptocurrency Price Prediction Scheme for Financial
Institutions. J. Inf. Secur. Appl. 2020, 55, 102583. [CrossRef]
29. Miura, R.; Pichl, L.; Kaizoji, T. Artificial Neural Networks for Realized Volatility Prediction in Cryptocurrency Time Series. In
Advances in Neural Networks—ISNN 2019; Lu, H., Tang, H., Wang, Z., Eds.; Lecture Notes in Computer Science; Springer: Cham,
Switzerland, 2019; Volume 11554.
30. Huang, J.-Z.; Huang, W.; Ni, J. Predicting bitcoin returns using high-dimensional technical indicators. J. Financ. Data Sci. 2019,
5, 140–155. [CrossRef]
31. Chen, Z.; Li, C.; Sun, W. Bitcoin price prediction using machine learning: An approach to sample dimension engineering.
J. Comput. Appl. Math. 2020, 365, 112395. [CrossRef]
32. Kubat, M.; Matwin, S. Addressing the curse of imbalanced training sets: One-sided selection. In Proceedings of the 14th
International Conference on Machine Learning, Nashville, TN, USA, 8–12 July 1997; Citeseer, Morgan Kaufmann: San Francisco,
CA, USA, 1997; pp. 179–186.
33. Peng, Y.; Albuquerque, P.H.M.; de Sá, J.M.C.; Padula, A.J.A.; Montenegro, M.R. The best of two worlds: Forecasting high
frequency volatility for cryptocurrencies and traditional currencies with Support Vector Regression. Expert Syst. Appl. 2018,
97, 177–192. [CrossRef]
34. Thakkar, A.; Chaudhari, K. A comprehensive survey on portfolio optimization, stock price and trend prediction using particle
swarm optimization. Arch. Comput. Methods Eng. 2020, 28, 2133–2164. [CrossRef]
35. Chaudhari, K.; Thakkar, A. iCREST: International cross-reference to exchange-based stock trend prediction using long short-term
memory. In Applied Soft Computing and Communication Networks; Springer: Singapore, 2021; pp. 323–338.
36. Altan, A.; Karasu, S.; Bekiros, S. Digital currency forecasting with chaotic meta-heuristic bio-inspired signal processing techniques.
Chaos Solitons Fractals 2019, 126, 325–336. [CrossRef]
37. Zhang, S.; Li, M.; Yan, C. The Empirical Analysis of Bitcoin Price Prediction Based on Deep Learning Integration Method. Comput.
Intell. Neurosci. 2022, 2022, 1265837. [CrossRef] [PubMed]
38. Alessandretti, L.; ElBahrawy, A.; Aiello, L.M.; Baronchelli, A. Anticipating cryptocurrency prices using machine learning.
Complexity 2018, 2018, 8983590. [CrossRef]
39. Jain, A.; Tripathi, S.; DharDwivedi, H.; Saxena, P. Forecasting Price of Cryptocurrencies Using Tweets Sentiment Analysis. In
Proceedings of the 2018 Eleventh International Conference on Contemporary Computing (IC3), Noida, India, 2–4 August 2018;
pp. 1–7.
40. Kumar, D.; Rath, S. Predicting the Trends of Price for Ethereum Using Deep Learning Techniques. In Artificial Intelligence and
Evolutionary Computations in Engineering Systems; Springer: Berlin/Heidelberg, Germany, 2020; pp. 103–114.
41. Livieris, I.E.; Pintelas, E.; Stavroyiannis, S.; Pintelas, P. Ensemble Deep Learning Models for Forecasting Cryptocurrency Time-
Series. Algorithms 2020, 13, 121. [CrossRef]
42. Ji, S.; Kim, J.; Im, H. A comparative study of Bitcoin price prediction using deep learning. Mathematics 2019, 7, 898. [CrossRef]
43. Huisu, J.; Lee, J.; Ko, H.; Lee, W. Predicting bitcoin prices by using rolling window lstm model. In Proceedings of the KDD Data
Science in Fintech Workshop, London, UK, 19–23 August 2018.
44. Alkahtani, H.; Aldhyani, T.H.H. Artificial Intelligence Algorithms for Malware Detection in Android-Operated Mobile Devices.
Sensors 2022, 22, 2268. [CrossRef]
45. Wu, C.H.; Lu, C.C.; Ma, Y.F.; Lu, R.S. A new forecasting framework for bitcoin price with LSTM. In Proceedings of the 2018 IEEE
International Conference on Data Mining Workshops (ICDMW), Singapore, 17–20 November 2018; pp. 168–175.
46. Dutta, A.; Kumar, S.; Basu, M. A Gated Recurrent Unit Approach to Bitcoin Price Prediction. J. Risk Financ. Manag. 2020, 13, 23.
[CrossRef]
47. Greaves, A.; Au, B. Using the Bitcoin Transaction Graph to Predict the Price of Bitcoin; Stanford University: Stanford, CA, USA, 2015.
48. Kurbucz, M.T. Predicting the price of Bitcoin by the most frequent edges of its transaction network. Econ. Lett. 2019, 184, 108655.
[CrossRef]
49. Jang, H.; Lee, J. An empirical study on modeling and prediction of bitcoin prices with bayesian neural networks based on
blockchain information. IEEE Access 2017, 6, 5427–5437. [CrossRef]
50. Aldhyani, T.H.H.; Alkahtani, H. Attacks to Automatous Vehicles: A Deep Learning Algorithm for Cybersecurity. Sensors 2022,
22, 360. [CrossRef]
Electronics 2022, 11, 2349 22 of 22

51. Alkahtani, H.; Aldhyani, T.; Al-Yaari, M. Adaptive anomaly detection framework model objects in cyberspace. Appl. Bionics
Biomech. 2020, 2020, 6660489. [CrossRef]
52. Yamak, P.T.; Yujian, L.; Gadosey, P.K. A Comparison between ARIMA, LSTM, and GRU for Time Series Forecasting. In Proceedings
of the 2nd International Conference on Algorithms, Computing and Artificial Intelligence, Sanya, China, 20–22 December 2019;
pp. 49–55.
53. Sebastião, H.; Godinho, P. Forecasting and trading cryptocurrencies with machine learning under changing market conditions.
Financ. Innov. 2021, 7, 3. [CrossRef]

You might also like