The Prediction of Short-Term Bitcoin Dollar Rate (BTC/USDT) Using Deep and Hybrid Deep Learning Techniques
The Prediction of Short-Term Bitcoin Dollar Rate (BTC/USDT) Using Deep and Hybrid Deep Learning Techniques
ir
https://www.tarjomano.com https://www.tarjomano.com
Abstract—Bitcoin as a digital cryptocurrency interests the convolutional neural networks (CNNs) [4-7], long short-term
scientists substantially in the areas of computer science, memory networks (LSTMs) [8-10], deep neural networks
cryptography and economics. In this work, we propose to (DNNs) [11-13], etc.
forecast the last price of Bitcoin Dollar rate in short-term or
frequent trading transactions known as day-trading. In addition In this study, we focus on deep and hybrid deep learning
to statistical indicators such as maximum, minimum, and methodologies to analyze time series in terms of evaluating
average prices, technical indicators such as Bollinger band (BB), the short-term price of Bitcoin in dollars (BTC/USD). To
hour-based moving average (MA), Relative Strength Index analyze, feature set is constructed with both statistical and
(RSI) are also evaluated as a feature set. In order to estimate the technical indicators such as volume, maximum, minimum,
price of Bitcoin, different deep and hybrid deep learning and average prices, Bollinger band (BB), hour-based moving
methodologies are employed, namely convolutional neural average (MA), Relative Strength Index (RSI). The data is
networks (CNNs), long short-term memory networks (LSTMs), gathered in 5-minute periods using a free API offered by the
convolutional long short-term memory networks (ConvLSTM), Binance cryptocurrency exchange between March 2021 and
CNN Long Short-Term Memory Network (CNN-LSTM). May 2021. In order to estimate the price of Bitcoin, deep and
Extensive experiment results exhibit that the usage of hybrid deep learning methodologies are evaluated, namely
ConvLSTM hybrid deep learning model is capable to estimate convolutional neural networks (CNNs), long short-term
the price of Bitcoin with 2.4076 of MAPE result.
memory networks (LSTMs), convolutional long short-term
Keywords—Bitcoin dollar rate, bitcoin price prediction,
memory networks (ConvLSTM), CNN Long Short-Term
convolutional neural networks, day trading, deep learning, short- Memory Network (CNN-LSTM). Comprehensive
term prediction experiments show that the utilization of deep learning
methodology remarkably improves the price prediction of
I. INTRODUCTION Bitcoin.
Bitcoin is a virtual currency that is designed for The rest of paper is presented as follows: In Section 2,
disbursements performed completely independent from banks state-of-the-art studies related to price or direction forecasting
and governments. The technique used in Bitcoin of Bitcoin and different cryptocurrencies are explained.
disbursements is far beyond the traditional one. In this way, Section 3 covers brief introduction of employed models in the
Bitcoin ensures to users many advantages such as lower study. Section 4 mentions the proposed framework. Section 5
rapidity, costs, etc. when compared to the conventional and 6 present the experiment details, results and conclusions.
methods. For this reason, Bitcoin has taken an attention
significantly by most of the countries in the world recently. II. RELATED WORK
However, attitude of users is cautious against Bitcoin This section provides an overview of time series analysis
inasmuch as it is not straightly included by the laws. This research and methodologies for estimating the price or
causes weak protection of customers by laws, to be movement of various financial instruments. Various studies in
manipulative of the price of it, difficult to apply not to be financial markets aim to approximate the price of
accepted by consumers and mostly countries. However, due to cryptocurrencies, commodities, stocks, and other products.
the increasing request and curiosity, Bitcoin is in incredible
demand by both investors, researchers, and scientists. In this Patel et al. [14] propose an LSTM and gated recurrent unit
work, we focus on forecasting short-term price of Bitcoin in (GRU) based hybrid scheme to predict the prices of two well-
dollars using proposed deep and hybrid deep learning known cryptocurrencies, Litecoin and Monero. In [15],
techniques. authors focus on a comparative study having deep learning
methods including deep neural network (DNN), LSTM, CNN,
Deep learning is a subfield of machine learning. The main deep residual network and their combinations to predict
applications of deep learning include various domains such as Bitcoin price. Authors conclude that the performance of
computer vision, natural language processing, image LSTM-based prediction models are better than the other
processing, speech recognition, etc. Deep learning prediction models. In [16], authors concentrate on sentiment-
methodology facilitates both feature extraction and driven price prediction of Bitcoin via statistical method called
classification tasks in many research fields. The popular deep Auto-Regressive Integrated Moving Average with eXogenous
learning methods are recurrent neural networks (RNNs) [1-3], input (ARIMAX) and LSTM. Results show that both
Authorized licensed use limited to: The University of Toronto. Downloaded on September 21,2022 at 03:33:53 UTC from IEEE Xplore. Restrictions apply.
Downloaded from https://iranpaper.ir
https://www.tarjomano.com https://www.tarjomano.com
ARIMAX and LSTM have achieved optimal price prediction C. Convolutional Long Short-Term Memory Network
outputs due to addition of studied sentiment feature. In [17], (ConvLSTM)
authors aim to implement Bitcoin closing price prediction by Convolutional Long Short-Term Memory Network
a novel approach called MRC-LSTM. Multi-scale Residual (ConvLSTM) [19] is a type of recurrent neural network for
Convolutional neural network (MRC) and a Long Short-Term space-time prediction that has convolutional structures in both
Memory (LSTM) are mixed and used together to acquire input-to-state and state-to-state transitions. ConvLSTM
effective features to learn trends and interaction of time series. determines the future state of a given cell in convolution by
Moreover, authors perform additional experiments on other the inputs and past states of its local neighbors. This can be
two well-known cryptocurrencies Ethereum and Litecoin. It is easily achieved by using a convolution operator on state-to-
concluded that MRC-LSTM significantly outperforms over a state and input-to-state transitions. The ConvLSTM model is
variety of network structures. In [18], authors target to study applied in different areas such as precipitation prediction,
on daily and weekly price prediction of another object detection, traffic accident prediction, Covid-19 case
cryptocurrency Ethereum. In the study, LSTM, GRU, number estimation, etc.
Temporal Convolutional Networks (TCN) and hybrid dual
combinations of them are experimented. It is figured out that D. CNN Long Short-Term Memory Network (CNN-LSTM)
hybrid LSTM GRU is the best model for daily predictions. On CNN Long Short-Term Memory Network, or CNN-
the other hand, TCN has the leading results for weekly LSTM for short [20], is an LSTM architecture designed
predictions. specifically for array prediction problems related to spatial
Our study differs from aforementioned state-of-the-art inputs such as time series, images, and videos. The CNN-
studies in terms of both predicting the price of Bitcoin in a LSTM architecture involves the use of convolutional neural
short-term (hourly-based) and employing hybrid deep network layers for feature extraction in input data in
learning methodologies. conjunction with LSTM to support array prediction. CNN-
LSTM structures are designed to visually predict time series
III. METHODS and create text descriptions, such as video, from image
In this section, methods used in the work are presented. sequences, such as video. In particular, it is one of the
These models are convolutional neural networks (CNNs), preferred methods for creating a textual description of a series
long short-term memory networks (LSTMs) as deep learning of images, creating a text description for a single image,
techniques, convolutional long short-term memory network creating a textual description of a series of images, creating a
(ConvLSTM), CNN Long Short-Term Memory Network textual description of an activity shown in a series of images.
(CNN-LSTM) as hybrid deep learning models. In summary, the CNN-LSTM architecture is a model with the
flexibility to be applied to a variety of tasks involving
A. Convolutional Neural Network (CNN) sequential inputs and outputs, both spatially and temporally.
The usage of convolutional neural networks is very IV. PROPOSED FRAMEWORK
common in the domain of image processing and it is seen that
they are also advantageous in time series analysis applications In this work, it is proposed to predict the price of short
[5-7]. In the literature, CNN is often adopted as a feedforward term Bitcoin Dollar rate (BTC/USD) employing deep and
network that contains various layers such as convolution, hybrid deep learning techniques. For this purpose, data
pooling, and fully connected. Construction of CNNs can be collection stage is performed using free Binance API. Every
varied by adding convolution layers for the purpose of 60 minutes, a request is sent to the API server and information
acquiring features with the help of filters. Then, the features such as instant price, market volume information that makes
that best express the dataset are sent to following layers up the dataset is collected between March 2021 and May
namely, pooling and dense. The features that best express the 2021. Details of the dataset is presented in Table I. By
dataset is obtained with correlations based in original dataset processing the data obtained using the API, the values of
is nominated with utilization of mapping of features. Then, the metrics such as one-hour simple moving average (SMA),
pooling layer is included to the convolutional neural network three-hour simple moving average, five-hour simple moving
for the goal of reducing parameters, calculations, training average, Bollinger band (BB) upper value, Bollinger band
time, dimension and preventing overfitting problem. At the lower value, Bollinger band middle value, relative strength
last step, final decision of CNN is specified by fully connected index (RSI) as a momentum indicator are also added to the
layers in this architecture. dataset as features. Finally, dataset is composed of 1,669
instances and 19 features.
B. Long Short-Term Memory Network (LSTM)
Long short-term memory networks are proposed to defeat TABLE I. DETAILS OF THE DATASET
gradient based difficulties of recurrent neural networks. Feature Description
LSTMs are also known as a subset of RNNs that can keep the Price change between open time and close
information in the buffers for long time in addition to short priceChange
time
time frames. This facilitates to find long dependencies or Percentage price change between open time
priceChangePercent
correlations among features. In addition to this, LSTMs and close time
generate a solution to the problem of exponential error growth The weighted average of the price between
weightedAvgPrice
with the help of back propagation while training procedure is open time and close time
carried out. After that, the architecture decides to keep or prevClosePrice Price (24 hours ago)
authorize of information [9-10]. lastPrice The price of the most recent trade in USDT
The USDT price of the highest priced buy
bidPrice
order.
The USDT price of the lowest priced sell order
askPrice
placed.
634
Authorized licensed use limited to: The University of Toronto. Downloaded on September 21,2022 at 03:33:53 UTC from IEEE Xplore. Restrictions apply.
Downloaded from https://iranpaper.ir
https://www.tarjomano.com https://www.tarjomano.com
Feature Description squared (R2). The following abbreviations are employed for
openPrice Starting price at open time
the deep and hybrid deep learning models. CNN:
Convolutional neural network, LSTM: Long short-term
highPrice Maximum price between opening and closing memory network, ConvLSTM: Convolutional long short-term
lowPrice Minimum price between opening and closing memory network, CNN-LSTM: CNN Long Short-Term
Memory Network. All experiments are carried out Google
quoteVolume Instant market volume in USDT Colab environment supplied free GPU utilization by Google.
Count
Total number of transactions performed The best MAPE, MAE, MSE, and R2 results are demonstrated
cumulatively in bold letters in the table. The dataset is divided randomly
into two parts where 80% of data is used for training and 20%
After constructing dataset, convolutional neural networks for testing.
(CNNs), long short-term memory networks (LSTMs) are
TABLE II. PREDICTION RESULTS OF DEEP AND HYBRID DEEP
assessed as deep learning techniques and convolutional long LEARNING MODELS
short-term memory network (ConvLSTM), CNN Long
Short-Term Memory Network (CNN-LSTM) are evaluated Models
Metric
as hybrid deep learning models to forecast the price of short- ConvLSTM LSTM CNN
CNN-
LSTM
term bitcoin dollar rate (BTC/USDT). The CNN model is
constructed with 4 convolution layers, global maximum type MAPE 2.4076 3.6479 4.9474 7.3124
pooling layer, flatten layer, fully connected layer, and output
MAE 0.0123 0.0189 0.0268 0.2872
layer. The first convolution layer composes of 128 filters. It
is followed by 64 filters in the second layer, 32 filters in the MSE 0.0022 0.0052 0.1139 0.2380
third layer, and 16 filters in the fourth layer. The kernel size
is adjusted to 2 and rectified linear unit (ReLU) is assigned as R2 0.9991 0.9979 0.8907 0.5597
an activation function. After the last convolution layer, a
pooling layer is utilized as global maximum, and its size is In Table II, MAPE, MAE, MSE, and R2 results of four
assigned to 2. It is followed by the flattening layer, followed different deep and hybrid deep learning models are
by the fully connected layer with the 4 neurons and ReLU demonstrated at 80% training set size. It is clear that 2.4076
activation function. To avoid challenge, the regularizer is MAPE of ConvLSTM beats other models. It is followed by
adjusted as adaptive moment estimation (ADAM), the loss CNN, which has 4.9474 MAPE and CNN-LSTM, which has
value is set to MSE. In addition, the batch size is assigned to 7.3124 MAPE. The CNN-LSTM approach, on the other hand,
8 and the number of iterations is 200. One LSTM layer and has the worst performance, with a MAPE of 7.3124. As a
fully connected output layer are employed in time series result, CNN-LSTM approach is ineffective for predicting the
analysis. The LSTM layer is composed of 256 neurons, ReLU price of Bitcoin on its own. When MAPE results are taken
activation function, 16 batch sizes and 200 iteration values into account, the LSTM technique achieves a 3.66
employing the ADAM regularizer. improvement, while the CNN model achieves a 2.36
In the construction of CNN-LSTM model, one improvement in the difference between error statistics when
convolution layer, a pooling layer of global maximum type, a compared to CNN-LSTM success. Furthermore, as compared
flattening layer, and a fully connected layer are employed, to the CNN model, LSTM shows a 1.30 improvement. Table
respectively. In the convolution layer, the number of filters is II shows that LSTM, as a deep learning technique, is useful
64, the kernel size is 8, and ReLU is chosen as the activation for forecasting the price of the Bitcoin whereas as a hybrid
function. In the following, the size of the global maximum deep learning technique ConvLSTM is the best MAPE result
pooling layer is assigned as 2. In addition, TimeDistributed of 2.4076. The performance order of all approaches can be
as a layer wrapper is applied to convolution, pooling and concluded as ConvLSTM> LSTM> CNN> CNN-LSTM as a
flattening layers. 64 neurons and ReLU activation function is result of Table II. Both MAE and MSE assessment metrics
defined by the output layer of the construction of the CNN- have a similar performance order.
LSTM model together with the LSTM layer, the regularizer
of which is ADAM. Moreover, the batch size is set to 32, and
the iteration value is assigned as 500. The ConvLSTM model
is constructed by two ConvLSTM layers, followed by a
flattening layer and an output layer. In the first ConvLSTM
layer, the number of filters is 64 and kernel size is 1. 32 layers
are employed in the second layer and kernel size is set to 2.
Activation function is assigned as ReLU, and regularizer is
ADAM. The batch size and number of iterations are same as
the CNN-LSTM model.
V. EXPERIMENT RESULTS
Fig. 1. The actual and forecasted price performance of ConvLSTM model.
In this study, comprehensive experiments are carried out
to monitor the effect of both deep and hybrid deep learning
At 80% training set size, actual price of the Bitcoin and the
methods for the forecasting of price of Bitcoin Dollar rate
predicted price of the Bitcoin using the ConvLSTM method
(BTC/USDT) in a short-term. Prediction performance of all
are shown in Fig. 1. As can be shown in Fig. 1, the proposed
the techniques is evaluated in terms of the widely-used error
model predicts Bitcoin price movements for the test part of the
statistics. These are mean absolute percentage error (MAPE),
data set (20%), which means the proposed model predicts
mean absolute error (MAE), mean squared error (MSE), R-
635
Authorized licensed use limited to: The University of Toronto. Downloaded on September 21,2022 at 03:33:53 UTC from IEEE Xplore. Restrictions apply.
Downloaded from https://iranpaper.ir
https://www.tarjomano.com https://www.tarjomano.com
636
Authorized licensed use limited to: The University of Toronto. Downloaded on September 21,2022 at 03:33:53 UTC from IEEE Xplore. Restrictions apply.
Downloaded from https://iranpaper.ir
https://www.tarjomano.com https://www.tarjomano.com
Midwest Symposium on Circuits and Systems, Dallas, TX, USA, pp. [16] G. Serafini, P. Yi, Q. Zhang, M. Brambilla, J. Wang, Y. Hu, and B. Li,
307-310, August 4-7, 2019. “Sentiment-driven price prediction of the Bitcoin based on statistical
[11] H. Zheng, Z. Yang, W. Liu, J. Liang, and Y. Li, “Improving deep neural and deep learning approaches,” IEEE International Joint Conference on
networks using softplus units,” International Joint Conference on Neural Networks, Glasgow, UK, pp. 1-8, July 19-24, 2020.
Neural Networks, Killarney, Ireland, pp. 1-4, July 12-17, 2015. [17] Q. Guo, S. Lei, Q. Ye, and Z. Fang, “MRC-LSTM: A hybrid approach
[12] Y. Geifman, and R. El-Yaniv, “Selective classification for deep neural of multi-scale residual CNN and LSTM to predict Bitcoin price,”
networks” arXiv:1705.08500 [cs], May. 2017, [Online]. Available: arXiv:2105.00707 [q-fin.TR], May 2021 [Online]. Available:
https://arxiv.org/abs/1705.08500 https://arxiv.org/abs/2105.00707v1.
[13] V. Sze, Y. H. Chen, T. J. Yang, and J. S. Emer, “Efficient processing [18] A. Politis, K. Doka, and N. Koziris, “Ether price prediction using
of deep neural networks,” Synthesis Lectures on Computer advanced deep learning models,” IEEE International Conference on
Architecture, vol. 15, no. 2, pp. 1-341, June 2020. Blockchain and Cryptocurrency, Sydney, Australia, pp. 1-3, May 3-6,
2021.
[14] M. M. Patel, S. Tanwar, R. Gupta, and N. Kumar, “A deep
learning-based cryptocurrency price prediction scheme for financial [19] A. Kelotra, P. Pandey, “Stock market prediction using optimized Deep-
institutions,” Journal of Information Security and Applications, vol. 55, ConvLSTM model,” Big Data, vol. 8, no. 1, pp. 5-24, February 2020.
pp. 102583-102595, December 2020. [20] I. E. Livieris, E. Pintelas, P. Pintelas, “A CNN–LSTM model for gold
[15] S. Ji, J. Kim, and H. Im, “A comparative study of Bitcoin price price time-series forecasting,” Neural Computing and Applications,
prediction using deep learning,” Mathematics, vol. 7, no. 10, pp. 898- vol. 32, no. 23, pp. 17351–17360, April 2020.
918, September 2019.
637
Authorized licensed use limited to: The University of Toronto. Downloaded on September 21,2022 at 03:33:53 UTC from IEEE Xplore. Restrictions apply.