A Novel Cryptocurrency Price Prediction Model Using GRU, LSTM and bi-LSTM Machine Learning Algorithms

: Cryptocurrency is a new sort of asset that has emerged as a result of the advancement of ﬁnancial technology and it has created a big opportunity for researches. Cryptocurrency price forecasting is difﬁcult due to price volatility and dynamism. Around the world, there are hundreds of cryptocurrencies that are used. This paper proposes three types of recurrent neural network (RNN) algorithms used to predict the prices of three types of cryptocurrencies, namely Bitcoin (BTC), Litecoin (LTC), and Ethereum (ETH). The models show excellent predictions depending on the mean absolute percentage error (MAPE). Results obtained from these models show that the gated recurrent unit (GRU) performed better in prediction for all types of cryptocurrency than the long short-term memory (LSTM) and bidirectional LSTM (bi-LSTM) models. Therefore, it can be considered the best algorithm. GRU presents the most accurate prediction for LTC with MAPE percentages of 0.2454%, 0.8267%, and 0.2116% for BTC, ETH, and LTC, respectively. The bi-LSTM algorithm presents the lowest prediction result compared with the other two algorithms as the MAPE percentages are: 5.990%, 6.85%, and 2.332% for BTC, ETH, and LTC, respectively. Overall, the prediction models in this paper represent accurate results close to the actual prices of cryptocurrencies. The importance of having these models is that they can have signiﬁcant economic ramiﬁcations by helping investors and traders to pinpoint cryptocurrency sales and purchasing. As a plan for future work, a recommendation is made to investigate other factors that might affect the prices of cryptocurrency market such as social media, tweets, and trading volume.


Introduction
Cryptocurrency is a virtual or digital currency used in financial systems [1,2]. It is secured by cryptography that makes it impossible to be counterfeited or double-spent. Furthermore, it is not issued from a central authority or central banks, and it is decentralized virtual currencies that can be converted via cryptographic procedures [3] and this make it distinguishable from traditional currencies. The other feature is that it is created by technology called blockchain [4], which is an extremely complex, and aims to storing data that makes it difficult or impossible to alter, hack, or defraud the system. Bitcoin has begun to carve out a niche for itself, which may either help cryptocurrencies to gain widespread acceptance or be the major cause of their demise. Cryptocurrencies are still in their infancy, and it is difficult to predict whether they will ever be widely used in global markets or not [5]. The most prominent cryptocurrency, Bitcoin, was established in 2009 and for more than two years was the sole Blockchain-based cryptocurrency. Today, however, there are over 5000 cryptocurrencies and 5.8 million active users in the cryptocurrency industry [6]. Because of its intrinsic nature of mixing encryption technology with monetary units, Bitcoin has recently gotten a lot of attention in the disciplines of economics, cryptography, and computer science [7].
Blockchain (BC), the technology that underpins the Bitcoin cryptocurrency system, is widely seen as critical in providing the backbone for assuring greater security and privacy AI 2021, 2 478 in a variety of other fields, including the Internet of Things (IoT) ecosystem. It is mainly a digital ledger of transactions that is distributed across the entire network of computer systems on the blockchain [8,9]. The blockchain consists of two fundamental components; the first one is a transaction, and the second is a block. The transaction represents the action triggered by the participant, and the block is a data collection that records the transaction and additional details such as the correct sequence and creation timestamp. Blockchain have a signaling system (BloSS) of multi-domain, blockchain-based, cooperative DDoS defense system in which each autonomous system (AS) joins the defensive alliance [10]. Reference [11] reveals that the effects of networks on competition in the nascent cryptocurrency market over a period of time regarding exchange rates among cryptocurrencies depends on two aspects: (1) competition among different currencies and (2) competition among exchanges. There are hundreds of cryptocurrencies, but Bitcoin is the most popular one as it is a stubborn competitor and did not emerge out of the cryptocurrency competition track. As a result, it has become the dominant cryptocurrency. The authors of [12] describe the competition between cryptocurrency as "healthy competition" and suggests that new technology and security innovation. The authors of [13] reveal that Bitcoin and national currencies show volatility shock transmission, while economic policy uncertainty has little effect. The authors of [14] investigate the interaction between big data and cryptocurrency. One of the most appealing marketplaces for financial speculation is the cryptocurrency market, which means that deceptive activities have flourished via social media. Many people have reaped a lot of profits through speculation in the digital markets, but every investment process suffers from many hidden risks and some investors, particularly those with a high risk tolerance, are interested in investing in cryptocurrency. Therefore, market analysts and speculators rely on prediction [15,16]. With variations in predictive power per cryptocurrency, machine learning and artificial intelligence algorithms are moderately appealing [17]. Low-volatility cryptocurrencies are more predictable than high-volatility ones. There is evidence that the usefulness of different information sets varies between machine learning algorithms, implying that prediction is likely to be much more complicated when a set of machine learning algorithms is used [18]. Despite the widespread use of cryptocurrencies for various types of purchases and transactions around the world, there is no consistent opinion on the definition of cryptocurrency or its legal status [19]. Furthermore, the aforementioned situation exacerbates challenges in criminal investigations of cryptocurrency-based money laundering. As a result, law enforcement organizations are having difficulty pinpointing criminals' identities and proving that they have committed a crime [20]. Focusing on Bitcoin pricing is similar to stock pricing: none of the risk variables that explain stock price movements apply to cryptocurrencies. Furthermore, traditional macroeconomic variables such as currency rates, commodity prices, and macroeconomic factors that affect other assets have little to no impact on most cryptocurrencies [21]. As a result of the cryptocurrency market's surge in 2017 [22], various governments across the world have begun to move toward standardizing and overseeing digital money. Because of the security of blockchain technology and their economic environment, people have become more confident in using Bitcoin [22]. Although the blockchain provides a high security ecosystem, the research area surrounding the legality of cryptocurrency cannot be isolated from the people who utilize cryptocurrencies for illicit purposes. The legality of cryptocurrencies has been the subject of numerous debates. The authors of [23] discuss the perspectives and the nature of cryptocurrencies in terms of monetary features, legal considerations, economic considerations, and Sharia considerations. Based on the perspective and characteristics of traditional currency, cryptocurrency does not satisfy the characteristics of a currency from an economic standpoint.
There are hundreds of cryptocurrencies in digital markets, but Bitcoin is the most popular and is affected and interacted with by external influences such as the news, social media, and small cryptocurrencies that have a limited market share, which are often not taked into account from investors and traders. Due to the strong relationships between cryptocurrencies, the smaller ones have become a source of shocks that can positively or negatively affect other cryptocurrencies. The authors of [24] reveal that gold as an independent currency can be used as a good hedging instrument to decrease the risk related to unexpected movement in the cryptocurrency market.
Cryptocurrency prices are difficult to forecast due to price volatility and dynamism. Around the world there are hundreds of cryptocurrencies that clients use. In this paper, we focus on three of the most popular ones. As a result, the paper aims to achieve the following by using deep leaning algorithms, which can discover hidden patterns from data, integrate them, and create far more efficient predictions:

•
Presenting a comprehensive study of the various existing schemes to predict the prices of BTC, ETH, and LTC cryptocurrencies.

•
Using AI algorithms such as LSTM, bi-LSTM, and GRU to accurately predict the prices of cryptocurrencies.

•
Utilizing long short-term memory (LSTM), a deep learning algorithm, and Fbprophet, which is an auto machine learning algorithm, for prediction.

•
Evaluating the proposed hybrid models using evaluation matrices such as RMSE and MAPE for Bitcoin, Ethereum, and Litecoin.
The main idea behind these models is to achieve a reliable prediction model that investors can rely on based on historical cryptocurrency prices. Moreover, the paper aims to answer the following research questions: 'How can machine learning algorithms help investors and decision makers to predict cryptocurrency prices?' and 'What is the best model for predicting future cryptocurrency prices?' This section provides an overview of cryptocurrencies and the remainder of the paper is structured as follows: Section 2 describes the literature review and previous work in this field, Section 3 presents the modeling results and the statistical analysis of the data, Section 4 describes the used dataset, Section 5 illustrates the experimental results, Section 6 presents a comparison between the model proposed in this paper and those of other studies in the literature, and Section 7 summarizes the overall conclusions of the paper.

Literature Review
Machine learning (ML) is a type of artificial intelligence that can predict the future based on past data. ML-based models have various advantages over other forecasting models as prior research has shown that it not only delivers a result that is nearly or exactly the same as the actual result, but it also improves the accuracy of the result [25]. Examples of machine learning include neural networks (NN), support vector machines (SVM), and deep learning. The authors of [26] demonstrate that incorporating cryptocurrency into a portfolio improves its effectiveness in two ways. The first is to reduce the standard deviation, and the second is to provide investors with more allocation options. The best cryptocurrency allocation was reported to be in the range from 5% to 20%, depending on the risk tolerance of the investor. The authors of [27] focus on time series data forecasting in particular and apply two machine learning algorithms, random forests (RF) and stochastic gradient boosting machine (SGBM). The results show that the ML ensemble technique can be used to anticipate Bitcoin values.
The decision-making process needs to make the appropriate decision at the right time, reducing the risks associated with the investment process. In [28], a hybrid cryptocurrency prediction system based on LSTM and GRU is presented, focusing on two cryptocurrencies, Litecoin and Monero. The authors of [29] use minute-sampled Bitcoin returns over 3 h periods to aggregate RV data. A variety of machine learning methods, including ANN (MLP, GRU, and LSTM), SVM, and ridge regression, were used to predict future values based on past samples, which are compared to the heterogeneous auto-regressive realized volatility (HARRV) model with optimized lag parameters. The findings show that the suggested system correctly predicts prices with high accuracy, indicating that the method may be used to forecast prices for a variety of cryptocurrencies. The authors of [30] employ the traditional support vector machine and linear regression methods to forecast Bitcoin values. This research takes into account a time series prediction made up of everyday Bitcoin closing prices for the creation of Bitcoin prediction models. The authors of [31] used machine learning techniques to address both a multiple regression technique that relies on highly correlated characteristics and a deep learning mechanism that uses a conjugate gradient mechanism in conjunction with a linear search for BTC price prediction. In [32], the price movements of Bitcoin, Ethereum, and Ripple are analyzed. The authors utilize powerful artificial intelligence frameworks, including a fully linked artificial neural network (ANN) and a long short-term memory (LSTM) recurrent neural network, and they discovered that ANN relies more on long-term history, whereas LSTM relies more on shortterm dynamics, implying that LSTM is more efficient at extracting meaningful information from historical memory than ANN. The study in [33] on Bitcoin daily price prediction with high-dimensional data reveals that logistic regression and linear discriminant analysis achieve an accuracy of 66%. On the other hand, surpassing (a sophisticated machine learning algorithm) outperforms the benchmark results for daily price prediction, with statistical techniques and machine learning algorithms having the greatest accuracies of 66% and 65.3%, respectively. The study in [34] examines the use of neural networks (NN), support vector machines (SVM), and random forest (RF). The findings demonstrate that machine learning and sentiment analysis may be used to anticipate cryptocurrency markets (with Twitter data alone being able to predict specific coins) and that NN outperforms the other models. In [35], the LSTM model is used to predict and find methods for forecasting Bitcoin on the stock market through Yahoo Finance that may predict a result of more than 12,600 USD in the days after the prediction. Due to the importance of the development of a robust and reliable method for predicting cryptocurrency prices, researchers have focused on more innovative models. In [36], both linear and non-linear time-series components of the stock dataset were used for forecasting using the hybrid model. In the non-linear time series forecast, CNN and Seq2Seq LSTMs were successfully coupled for dynamic modeling of short-and long-term dependent patterns. The study in [37] focused on social factors, which are increasingly being utilized for online transactions throughout the world, by using a multi-linear regression model and that analyzes two big capital market cryptocurrencies, BTC and LTC. The authors of [37] found that the R2 scores were 44% for LTC and 59% for BTC. Ref. [38] used two different LSTM models (a standard LSTM model and an LSTM with an AR(2) model). This study presented a forecasting framework, using an LSTM model to forecast Bitcoin daily prices. The study in [38] found that the model with AR(2) was better than LSTM with an RMSE of 247.33. Researchers in [39] compared three different models (ARIMA, LSTM and GRU) for predicting BTC's price. The experimental outcomes in [39] showed that ARIMA achieved the best performance with a MAPE of 2.76% and RMSE of 302.53. The study in [40] presented two types of prediction models constructed using Bayesian optimized RNN and LSTM to predict the price of BTC. The study revealed that LSTM showed better performance and achieved an accuracy of 52% and RMSE of 8%.
The investment process mainly depends on the historical price of a cryptocurrency. One of the most important strategies that the investor depends on is building Markov chains. This strategy consists of multiple decision trees that are used to identify the cryptocurrency that is estimated to provide a greater return when sold and then comparing the estimation with the actual figure [41]. Due to the importance of prediction in the investment process that many people depend on to earn revenue, this paper focuses on three models that can predict future cryptocurrency prices using machine learning algorithms and artificial intelligence approaches to achieve accurate prediction models with the aim of helping investors.

Materials and Methods
To achieve the aims of this paper, we trained three distinct models for three different forms of cryptocurrency price prediction using historical cryptocurrency prices. Then, in order to evaluate the suggested schemes' performances, we compare the accuracy of our proposed model to that of current models by following five stages: (1) collecting historical cryptocurrency data; (2) data exploration and visualization; (3) training three types of models; (4) testing the models; and (5) extracting and comparing the results.
In this section, we present and compare three types of algorithms-long short-term memory (LSTM), gated recurrent unit (GRU), and bidirectional LSTM (bi-LSTM)-to predict the price of three types of cryptocurrency based on historical data-Bitcoin (BTC), Litecoin (LTC) and Ethereum (ETH). Figure 1 shows the methodology of processing the dataset. It starts with data collection, then the data visualization process is used to illustrate and explore the data's behavior and distribution and the relationship between the cryptocurrencies. Next, the models are trained with 80% of the collected dataset [42]. The training dataset is from 22 January 2018 until 22 October 2020 and the testing dataset (20% of the data) is form 22 October 2020 until 30 June 2021. Then, after training the models we tested them. Then, we extracted and compared the results and selected the best model depending on the daily closing price.

Materials and Methods
To achieve the aims of this paper, we trained three distinct models for three different forms of cryptocurrency price prediction using historical cryptocurrency prices. Then, in order to evaluate the suggested schemes' performances, we compare the accuracy of our proposed model to that of current models by following five stages: (1) collecting historical cryptocurrency data; (2) data exploration and visualization; (3) training three types of models; (4) testing the models; and (5) extracting and comparing the results.
In this section, we present and compare three types of algorithms-long short-term memory (LSTM), gated recurrent unit (GRU), and bidirectional LSTM (bi-LSTM)-to predict the price of three types of cryptocurrency based on historical data-Bitcoin (BTC), Litecoin (LTC) and Ethereum (ETH). Figure 1 shows the methodology of processing the dataset. It starts with data collection, then the data visualization process is used to illustrate and explore the data's behavior and distribution and the relationship between the cryptocurrencies. Next, the models are trained with 80% of the collected dataset [42]. The training dataset is from 22 January 2018 until 22 October 2020 and the testing dataset (20% of the data) is form 22 October 2020 until 30 June 2021. Then, after training the models we tested them. Then, we extracted and compared the results and selected the best model depending on the daily closing price.     Figure 2 illustrates the BTC closing price within the targeted collected dataset. It shows that the closing price increased gradually until the end of 2020, when the price   Figure 2 illustrates the BTC closing price within the targeted collected dataset. It shows that the closing price increased gradually until the end of 2020, when the price increased suddenly, it reach a high of 63,381 USD in a top of peak of time series.  Figure 3 shows the ETH closing price within the targeted collected dataset. It demonstrates that the closing price increased gradually until the end of 2020, then the price increased suddenly, reaching a high of 4140 USD.   Figure 4 shows the LTC closing price within the targeted collected dataset. It illustrates that the closing price increased gradually until the end of 2020, then the price increased suddenly, reaching a high of 373.64 USD.

Long Short-Term Memory (LSTM)
For various learning issues involving sequential data, recurrent neural networks with long short-term memory (LSTM) have emerged as an effective and scalable approach. They are useful for capturing long-term temporal dependencies since they are generic and effective [43]. The LSTM is an RNN-style architecture with gates that govern the flow of information between cells. The input and forget gate structures can modify information traveling along the cell state, with the ultimate output being a filtered version of the cell state based on context from the inputs [44]. The LSTM design has been criticized for being ad hoc and for having a large number of components whose purpose is not immediately clear. As a result, it is unclear whether the LSTM is the best design, and it is likely that better ones exist [45]. Figure 5 illustrates the structure of a LSTM algorithm [46].  Figure 2 illustrates the BTC closing price within the targeted collected dataset. It shows that the closing price increased gradually until the end of 2020, when the price increased suddenly, it reach a high of 63,381 USD in a top of peak of time series. Figure 3 shows the ETH closing price within the targeted collected dataset. It demonstrates that the closing price increased gradually until the end of 2020, then the price increased suddenly, reaching a high of 4140 USD. Figure 4 shows the LTC closing price within the targeted collected dataset. It illustrates that the closing price increased gradually until the end of 2020, then the price increased suddenly, reaching a high of 373.64 USD.

Long Short-Term Memory (LSTM)
For various learning issues involving sequential data, recurrent neural networks with long short-term memory (LSTM) have emerged as an effective and scalable approach. They are useful for capturing long-term temporal dependencies since they are generic and effective [43]. The LSTM is an RNN-style architecture with gates that govern the flow of information between cells. The input and forget gate structures can modify information traveling along the cell state, with the ultimate output being a filtered version of the cell state based on context from the inputs [44]. The LSTM design has been criticized for being ad hoc and for having a large number of components whose purpose is not immediately clear. As a result, it is unclear whether the LSTM is the best design, and it is likely that better ones exist [45]. Figure 5 illustrates the structure of a LSTM algorithm [46].
1 Figure 5. The structure of a long short-term memory (LSTM) algorithm.
The forward training process of the LSTM can be formulated with the following equations: where i t , o t , and f t denote the activation of the input gate, output gate, and forget gate, respectively; C t and h t denote the activation vector for each cell and memory block, respectively; and W and b denote the weight matrix and bias vector, respectively. In addition, σ( • ) denotes the sigmoid function [47].

Bidirectional LSTM (bi-LSTM)
bi-LSTM was created by Schuster and Paliwal [48] to train a network utilizing past and future input data sequences. The input data are processed using two linked layers [49]. Bi-directional LSTM predicts or tags the sequence of each element using a finite sequence based on the context of elements in the past and future. This is the result of two LSTMs running in parallel, one from left to right and the other from right to left. The forecast of a given target signal is known as composite output. This method has proven to be quite beneficial. The forward function of bi-LSTM with inputs of L units and H as the number of hidden units is calculated using Equations (6) and (7), Figure 6 shows a bidirectional LSTM structure [50]. The hidden layer of the bi-directional LSTM network saves two values. A participates in the forward calculation, and A transpose is involved in the reverse calculation. The final output value, y, depends on A and A transpose [51]: AI 2021, 2, FOR PEER REVIEW 9 number of hidden units is calculated using Equations (6) and (7), Figure 6 shows a bidirectional LSTM structure [50]. The hidden layer of the bi-directional LSTM network saves two values. A participates in the forward calculation, and A transpose is involved in the reverse calculation. The final output value, y, depends on A and A transpose [51]: = ( ) (7) Figure 6. The structure of a bi-directional LSTM (bi-LSTM) algorithm.

Gated Recurrent Unit (GRU)
Gated recurrent neural networks (Gated RNNs) have demonstrated their effectiveness in a variety of applications requiring sequential or temporal data [52]. The transition functions in hidden units of GRU are given as follows [53]: where the model parameters include all W , V , and b that are shared by all time steps and learned during the training stage, (.) denotes the element-wise product, and k is a hyper-parameter that represents the dimensionality of hidden vectors. Figure 7 illustrates the GRU structure [54]:

Gated Recurrent Unit (GRU)
Gated recurrent neural networks (Gated RNNs) have demonstrated their effectiveness in a variety of applications requiring sequential or temporal data [52]. The transition functions in hidden units of GRU are given as follows [53]: where the model parameters include all W R dXd , V R dXd , and b R dXd that are shared by all time steps and learned during the training stage, (.) denotes the element-wise product, and k is a hyper-parameter that represents the dimensionality of hidden vectors. Figure 7 illustrates the GRU structure [54]:

Evaluation Matrix
The evaluation of the proposed schemes is done using the mean absolute percentage error (MAPE) and the root mean squared error (RMSE).

RMSE =
where and are the actual and forecasted cryptocurrency prices, respectively, and N is the number of samples.

Data Exploration
When dealing with data, it is useful and important to understand the data distribution and behavior using a stable and meaningful chart to extract the story that the data tells. Figure 8 illustrates the time series for targeted cryptocurrency distributed through the interval between 22 January 2018 and 30 June 2021. It shows that the price increases along with the specific interval depending on the closing price.

Evaluation Matrix
The evaluation of the proposed schemes is done using the mean absolute percentage error (MAPE) and the root mean squared error (RMSE).
where A i and F i are the actual and forecasted cryptocurrency prices, respectively, and N is the number of samples.

Data Exploration
When dealing with data, it is useful and important to understand the data distribution and behavior using a stable and meaningful chart to extract the story that the data tells. Figure 8 illustrates the time series for targeted cryptocurrency distributed through the interval between 22 January 2018 and 30 June 2021. It shows that the price increases along with the specific interval depending on the closing price. The correlation matrix in Figure 9 illustrates the correlation coefficient between the variables (closing price). The matrix shows a strong positive correlation between different currencies (BTC, LTC, and ETH). This means if one of the targeted cryptocurrencies increases or decreases, the others behave accordingly. The correlation matrix in Figure 9 illustrates the correlation coefficient between the variables (closing price). The matrix shows a strong positive correlation between different currencies (BTC, LTC, and ETH). This means if one of the targeted cryptocurrencies increases or decreases, the others behave accordingly.

Dataset
The analyzed dataset was collected from [42], an open-access website. It consists of one .csv file separated into three sheets; the first sheet for Bitcoin (BTC), the second for Litecoin (LTC), and the last sheet for Ethereum (ETH). The recorded prices in the dataset were collected on a daily basis from 1 January 2018 to 30 June 2021. In this research, we used time-series data from [19] with 1277 records. Table 1 illustrates the dataset specification of the targeted cryptocurrency and Figure 10 shows sample data from the dataset.

Dataset
The analyzed dataset was collected from [42], an open-access website. It consists of one .csv file separated into three sheets; the first sheet for Bitcoin (BTC), the second for Litecoin (LTC), and the last sheet for Ethereum (ETH). The recorded prices in the dataset were collected on a daily basis from 1 January 2018 to 30 June 2021. In this research, we used time-series data from [19] with 1277 records. Table 1 illustrates the dataset specification of the targeted cryptocurrency and Figure 10 shows sample data from the dataset. Close price on the given day Number Figure 10. Screenshot showing a sample of the data from the BTC, ETH, and LTC dataset

Results
This section shows the results obtained from long short-term memory (LSTM), gated recurrent unit (GRU), and bidirectional LSTM (bi-LSTM) algorithms using three types of popular cryptocurrency: BTC, ETH, and LTC. For each model, the results are illustrated in Tables 2-4. The model that gives the lowest RMSE and MAPE is considered the best model. Based on this criteria, all of the models applied to three types of currencies can be considered good models but the GRU was found to be the best of the three. The RMSE of the GRU model is the lowest. Thus, GRU is more capable of predicting long-term dependencies as compared to LSTM and bi-LSTM. This is due to the dependency on past prices. Figures 11-19 illustrate the comparisons between the actual and the predicted results. Simulation results from those models indicate that there are few occasions where the forecast result differs from the actual results.

Results
This section shows the results obtained from long short-term memory (LSTM), gated recurrent unit (GRU), and bidirectional LSTM (bi-LSTM) algorithms using three types of popular cryptocurrency: BTC, ETH, and LTC. For each model, the results are illustrated in Tables 2-4. The model that gives the lowest RMSE and MAPE is considered the best model. Based on this criteria, all of the models applied to three types of currencies can be considered good models but the GRU was found to be the best of the three. The RMSE of the GRU model is the lowest. Thus, GRU is more capable of predicting long-term dependencies as compared to LSTM and bi-LSTM. This is due to the dependency on past prices. Figures 11-19 illustrate the comparisons between the actual and the predicted results. Simulation results from those models indicate that there are few occasions where the forecast result differs from the actual results.   Figure 11. Actual and predicted price of BTC using the LSTM model.          . Actual and predicted price of ETH using the GRU model. Figure 15. Actual and predicted price of ETH using the GRU model.

Results for BTC
The accuracies of these models for BTC cryptocurrency are tabulated in Table 2. The MAPE of the GRU model is the lowest with a value of 0.2454 and the RMSE is 174.129. Therefore, GRU is more capable of predicting BTC trends than LSTM or bi-LSTM, with a small difference between it and the LSTM model. Figures 11-13 show a visual representation, comparing the actual and predicted values of the training dataset of the three models for BTC. Figure 11 compare the actual and LSTM-predicted price of BTC. The graph shows that the predicted and the actual price is approximately the same over the entire interval. This model is considered the second-best model. The mean absolute percentage error for the prediction model (MAPE) of BTC for LSTM is 1.1234%, and the root mean square error (RMSE) is 410.399. Statistical analysis of the data indicates that the predicted price has a mean value of 38,173.258 USD, a maximum value of 64,358.805 USD, and a minimum value of 12,775.013 USD, whereas the actual price has a mean value of 38,249.388 USD, a maximum value of 63,380.999 USD, and a minimum value of 12,941.0 USD. The mean difference between the mean values of the actual and the predicated prices is 76.13 USD. Figure 12 illustrates the comparison between the actual and the predicted price of BTC using the GRU model. The graph shows that the difference between the predicted and the actual price is virtually non-existent along the testing set, with very small differences in the top few peaks of the time series. This model is considered to be the best. The results in Figure 13 illustrate the comparison between the actual and the predicted price of BTC under the bi-LSTM model. It indicates a greater difference between the actual and the predicted price compared with the LSTM and GRU models. The mean absolute percentage error prediction model (MAPE) from bi-LSTM for BTC is 5.990% and the root mean square error (RMSE) is 2927.006. Statistical analysis of the data indicates

Results for BTC
The accuracies of these models for BTC cryptocurrency are tabulated in Table 2. The MAPE of the GRU model is the lowest with a value of 0.2454 and the RMSE is 174.129. Therefore, GRU is more capable of predicting BTC trends than LSTM or bi-LSTM, with a small difference between it and the LSTM model. Figures 11-13 show a visual representation, comparing the actual and predicted values of the training dataset of the three models for BTC.
Results presented in Figure 11 compare the actual and LSTM-predicted price of BTC. The graph shows that the predicted and the actual price is approximately the same over the entire interval. This model is considered the second-best model. The mean absolute percentage error for the prediction model (MAPE) of BTC for LSTM is 1.1234%, and the root mean square error (RMSE) is 410.399. Statistical analysis of the data indicates that the predicted price has a mean value of 38,173.258 USD, a maximum value of 64,358.805 USD, and a minimum value of 12,775.013 USD, whereas the actual price has a mean value of 38,249.388 USD, a maximum value of 63,380.999 USD, and a minimum value of 12,941.0 USD. The mean difference between the mean values of the actual and the predicated prices is 76.13 USD. Figure 12 illustrates the comparison between the actual and the predicted price of BTC using the GRU model. The graph shows that the difference between the predicted and the actual price is virtually non-existent along the testing set, with very small differences in the top few peaks of the time series. This model is considered to be the best. The results in Figure 13 illustrate the comparison between the actual and the predicted price of BTC under the bi-LSTM model. It indicates a greater difference between the actual and the predicted price compared with the LSTM and GRU models. The mean absolute percentage error prediction model (MAPE) from bi-LSTM for BTC is 5.990% and the root mean square error (RMSE) is 2927.006. Statistical analysis of the data indicates that the predicted price has a mean value of 36,735.137 USD, a maximum value of 59,885.746 USD, and a minimum value of 12,941.0 USD, whereas the actual price has a mean value of 38,249.388 USD, a maximum value of 63,380.999 USD, and a minimum value of 13,655.032 USD. The mean differences between the mean values of the actual and the predicated prices is 1514.251 USD.

Results for ETH
The accuracies of these models for ETH cryptocurrency are tabulated in Table 3. The mean absolute percentage error for the GRU model is the least with a value of 0.8267 and a root mean square error of 26.59. Therefore, GRU proved to be the best predictor compared to LSTM and bi-LSTM for ETH. Figures 14-16 show the visual representation of the comparison between the actual and the predicted values of the training dataset of the three models for the ETH.
LSTM model for ETH, it represents that the difference between the predicted and the actual price is very small as red and green curves moving over each other's over the whole period of time of Figure 14. This model is considered the second-best model. The mean absolute percentage error prediction model of ETH for the LSTM model is 1.5489% and the root mean square error is 59.507. Statistical analysis of the data indicates that the predicted price has a mean value of 1663.1392 USD, a maximum value of 4399.33 USD, and a minimum value of 379.41837 USD, whereas the actual price has a mean value of 1636.7091 USD, a maximum value of 4140.0 USD, and a minimum value of 383.35 USD. The mean difference between the mean values of the actual and the predicated prices is 26.43 USD. Figure 15 illustrates the comparison between the actual and the predicted price of the GRU model for ETH. It represents a negligible difference between the predicted and the actual price along the testing set of the time series. This model is considered the best with a mean absolute percentage of 0.8267%, and root mean square error of 321.061. Statistical analysis of the data indicates that the predicted price has a mean value of 1655.4645 USD, a maximum value of 4249.46 USD, and a minimum value of 384.33 USD, whereas the actual price has a mean value of 1636.7091 USD, a maximum value of 4140.0 USD, and a minimum value of 383.35 USD. The mean difference between the mean values of the actual and the predicated prices is 18.76 USD.
The results in Figure 16 illustrate the comparison between the actual and the predicted price of the bi-LSTM model for ETH. It shows substantial differences between the actual and the predicted price compared with the LSTM and GRU models with mean absolute percentage error of 6.85% and root mean square error of 321.061. Statistical analysis of the data indicates that the predicted price has a mean value of 1733.5935 USD, a maximum value of 4576.371 USD, and a minimum value of 350.24 USD, whereas the actual price has a mean value of 1636.7091 USD, a maximum value of 4140.0 USD, and a minimum value of 383.35 USD. The mean difference between the mean values of the actual and the predicated prices is 96.88 USD.

Results for LTC
The accuracy of the models for the LTC cryptocurrency are shown in Table 4. The mean absolute percentage error of the GRU model is the lowest with a value of 0.2116 and a root mean square error of 0.825. Therefore, GRU proved to be most capable for prediction as compared to LSTM and bi-LSTM for LTC. Figures 17-19 show the visual representation of the data by comparing the actual and the predicted values of training dataset of the three models for LTC.
The results in Figure 17 show the comparison between the actual and the predicted price of the LSTM model for LTC. They show that the difference between the predicted and the actual price is very small with a mean absolute percentage error of 0.8474%, and a root mean square error of 3.069. Statistical analysis of the data indicates that the predicted price has a mean value of 166.16 USD, a maximum value of 388.59 USD, and a minimum value of 53.95 USD, whereas the actual price has a mean value of 165.68 USD, a maximum value of 373.64 USD, and a minimum value of 53.64 USD. The mean difference between the mean values of the actual and the predicated prices is 0.48 USD. Figure 18 shows the comparison between the actual and the predicted price of the GRU model for LTC. It represents similar trends for both actual and predicted price with a mean absolute percentage error of 0.2116% and a root mean square error of 0.825. This model is considered the best model. Statistical analysis of the data indicates that the predicted price has a mean value of 165.93 USD, a maximum value of 378.10 USD, and a minimum value of 53.84 USD, whereas the actual price has a mean value of 165.68 USD, a maximum value of 373.64 USD, and a minimum value of 53.64 USD. The mean difference between the mean values of the actual and the predicated prices is 0.25 USD. Figure 19 illustrates the comparison between the actual and the predicted price of the bi-LSTM model for LTC. It represents a small difference between the actual and the predicted price with mean absolute percentage error of 2.332% and a root mean square error of 4.307. Statistical analysis of the data indicates that the predicted price has a mean value of 176.75 USD, a maximum value of 378.10 USD, and a minimum value of 51.12 USD, whereas the actual price has a mean value of 165.68 USD, a maximum value of 397.57 USD, and a minimum value of 53.64 USD. The mean difference between the mean values of the actual and the predicated prices is 11.07 USD.

Discussion
The proposed model in this research can be considered a reliable and acceptable model for cryptocurrency prediction. Table 5 presents a comparison between the proposed model in this paper and other models in the literature. Table 5 shows a comparison between the proposed model in this paper and other models in the literature [45,51,53]. The MAPES values of the proposed model in this paper for GRU predicting LTC represents the best performance compared to all other models as the predicted results are very close to the actual results. Results obtained from this paper show that the GRU performed better when predicting the price of all types of cryptocurrency than the LSTM and the bi-LSTM models.

Conclusions
In this paper, three types of machine learning algorithm are constructed and used for predicting the prices of three types of cryptocurrency-BTC, ETH, and LTC. Performance measures were conducted to test the accuracy of different models as shown in Tables 2-4. Then, we compared the actual and predicted prices. The results show that GRU outperformed the other algorithms with a MAPE of 0.2454%, 0.8267%, and 0.2116% for BTC, ETH, and LTC, respectively. The RMSE for the GRU model was found to be 174.129, 26.59, and 0.825 for BTC, ETH, and LTC, respectively. Based on these outcomes, the GRU model for the targeted cryptocurrencies can be considered efficient and reliable. This model is considered the best model. However, bi-LSTM represents less accuracy than GRU and LSTM with substantial differences between the actual and the predicted prices for both BTC and ETH. The experimental results show that:

•
The AI algorithm is reliable and acceptable for cryptocurrency prediction. • GRU can predict cryptocurrency prices better than LSTM and bi-LSTM but overall all algorithms represent excellent predictive results.
In future work, we will investigate other factors that might affect the prices of the cryptocurrency market, and we will focus on the effect that social media in general and tweets in particular can have on the price and trading volume of cryptocurrencies by analyzing tweets using natural language processing techniques and sentiment analysis.